Apache站点默认首页设置


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) 

Linux下安装配置PHP环境(Apache2) 

Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置

CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12)

RedHat 5.4下Web服务器架构之源码构建LAMP环境及应用PHPWind

Apache 的详细介绍:请点这里
Apache 的下载地址:请点这里

本文永久更新链接地址

相关内容

    暂无相关文章