你好,游客 登录 注册 搜索
背景:
阅读新闻

Apache站点默认首页设置

[日期:2015-10-19] 来源:Linux社区  作者:guotou [字体: ]

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

linux
相关资讯       Apache默认首页 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款