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

推荐订阅源

W
WeLiveSecurity
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
Cloudbric
Cloudbric
The Register - Security
The Register - Security
小众软件
小众软件
PCI Perspectives
PCI Perspectives
G
Google Developers Blog
AI
AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
TaoSecurity Blog
TaoSecurity Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
N
Netflix TechBlog - Medium
博客园_首页
Last Week in AI
Last Week in AI
A
Arctic Wolf
B
Blog RSS Feed
J
Java Code Geeks
C
Cybersecurity and Infrastructure Security Agency CISA
I
InfoQ
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
NISL@THU
NISL@THU
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Jina AI
Jina AI
有赞技术团队
有赞技术团队
S
Schneier on Security
L
Lohrmann on Cybersecurity
P
Privacy & Cybersecurity Law Blog
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
Vercel News
Vercel News
博客园 - 司徒正美
Webroot Blog
Webroot Blog
Hacker News: Ask HN
Hacker News: Ask HN
A
About on SuperTechFans

博客园 - 周国选

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