Apache的默认首页为index.html,当我们需要改首页文件或者增加首页文件时,可以在httpd.conf文件中增加配置语句。
httpd.conf首页文件默认配置语句如下:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
如果我们需要增加首页文件xxx.htm时,可以在DirectoryIndex index.html下增加加一行语句DirectoryIndex xxx.htm,优先级从上到下。
例如我需要增加index.htm、defaul.htm、index.php文件,配置语句需改为:
<IfModule dir_module>
DirectoryIndex index.html
DirectoryIndex index.htm
DirectoryIndex default.htm
DirectoryIndex index.php
</IfModule>
改好后保存,需重启Apache后才能生效。
Ubuntu Server 14.04 安装Web服务器(Linux+Apache+MySQL+PHP) http://www.linuxidc.com/Linux/2015-06/119061.htm
Linux下安装配置PHP环境(Apache2) http://www.linuxidc.com/Linux/2015-05/118062.htm
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm
CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm
RedHat 5.4下Web服务器架构之源码构建LAMP环境及应用PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm
Apache 的详细介绍:请点这里
Apache 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-10/124284.htm