惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Troy Hunt's Blog
Latest news
Latest news
Vercel News
Vercel News
S
SegmentFault 最新的问题
V
Vulnerabilities – Threatpost
博客园 - Franky
P
Privacy International News Feed
A
Arctic Wolf
T
The Blog of Author Tim Ferriss
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Tor Project blog
Jina AI
Jina AI
GbyAI
GbyAI
The Hacker News
The Hacker News
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
T
Threatpost
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Scott Helme
Scott Helme
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Microsoft Azure Blog
Microsoft Azure Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 司徒正美
A
About on SuperTechFans
Recorded Future
Recorded Future
爱范儿
爱范儿
L
LangChain Blog
V
V2EX
C
Cybersecurity and Infrastructure Security Agency CISA
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
D
DataBreaches.Net
宝玉的分享
宝玉的分享
Google Online Security Blog
Google Online Security Blog
C
Cisco Blogs
L
Lohrmann on Cybersecurity
Help Net Security
Help Net Security
AWS News Blog
AWS News Blog
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY

博客园 - 周国选

SQL数据库中修改表的所有者 llinux mount 新建磁盘到指定目录 CentOS Apache配置详解 Fotolog 的 Solaris/MySQL 架构 mysql不预读数据库信息(use dbname 更快,不会卡) Linux MySQL主从复制(Replication)配置 MySql常用命令总结 备份MySQL出现Can’t open file when using LOCK TABLES错误 ORACLE常用Script Oracle的特色和选项 Oracle入门--启动和关闭详解 如何在sql*plus中使用方向键和删除键 SQL Plus常用命令 SELinux相关指令工具 在Linux上安装Memcached服务 LINUX常用命令 Linux VI/VIM常用命令 memcached telnet操作 Quartz.NET克隆表达式 - 周国选 - 博客园
Centos下apache默认主页修改
周国选 · 2011-09-22 · via 博客园 - 周国选

2011-09-22 16:37  周国选  阅读(18250)  评论()    收藏  举报

年前把服务器重装了下,系统Centos5.4.主要做网站发布,装的apache服务。

当时做的时候因特殊原因,要改默认主页为 default.php,安装默认是 :DirectoryIndex  index.html

于是就修改 /etc/httpd/conf/httpd.conf 文件 DirectoryIndex  index.html 为 DirectoryIndex  default.php index.php index.html

重启服务器,无效!

查了一些资料,没有得到解决。应急的处理方法是在原index.php页面做一次跳转。

今天,因为网页流程上的一些问题,这个设置失效的bug显现出来,于是再次致力解决此问题。

最好的老师和技术指导任然是网络,我查了许多资料,一个下午,没有得到有效解决方案。

晚上回家,还是放不下,也不甘心。我来到服务器。

cd /etc/httpd/

发现我一直忽略了conf.d 文件夹,进入这个文件夹,可以看到很多配置文件,其中有一个就是php.conf

打开此文件,发现也有:DirectoryIndex  index.php 配置。

于是我怀疑 是这个文件的此配置覆盖了/etc/httpd/conf/httpd.conf 的配置

我试着把这句也改成DirectoryIndex  default.php index.php 。

重启apache:/etc/init.d/httpd restart

访问测试页面(自己写的:defult.php和index.php)成功访问defult.php..说明配置成功!

总结:

修改apache默认主页要修改两个文件:

/etc/httpd/conf/httpd.conf

/etc/httpd/conf.d/php.conf

修改这两个文件的 DirectoryIndex  后的文件名。