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

推荐订阅源

Project Zero
Project Zero
GbyAI
GbyAI
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
小众软件
小众软件
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
F
Fortinet All Blogs
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
O
OpenAI News
V
V2EX
博客园 - 三生石上(FineUI控件)
AI
AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
P
Privacy International News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
H
Help Net Security
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tenable Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cisco Talos Blog
Cisco Talos Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News: Ask HN
Hacker News: Ask HN
S
Security @ Cisco Blogs
S
Securelist
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
雷峰网
雷峰网
V2EX - 技术
V2EX - 技术

博客园 - 周国选

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  后的文件名。