更改默认页面的Ubuntu的Apache2 [英] Change default page Apache2 Ubuntu

查看:460
本文介绍了更改默认页面的Ubuntu的Apache2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我去我的网站上所有文件的索引显示出来,当我选择一个特定页面的HTML是无法访问文件中的图像。我怎样才能让的Apache2自动启动,而不是在/ var / WWW /var/www/home.html?

When I go to my website an index of all the files shows up, when I choose a specific page the html isn't able to access the images in a file. How can I make Apache2 automatically launch /var/www/home.html instead of /var/www?

推荐答案

您可以在vitual主机环境中使用DirectoryIndex指令。

You can use DirectoryIndex directive in vitual host context.

Apache的网站

DirectoryIndex指令集资源寻找的名单,
  当客户端通过指定请求目录的索引/
  在目录名的末尾。

The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name.

下面的例子:

<virtualhost *:80>

  ServerName  domain.com
  ServerAlias www.domain.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex home.html index.html
  DocumentRoot /var/www

</virtualhost>

这篇关于更改默认页面的Ubuntu的Apache2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆