Apache中设置默认首页的方法
2023-05-19 21:35
APACHE
SQL Server
Oracle
MySQL
PostgreSQL
NoSQL
大数据
其他数据库
Windows
Windows Server
Linux
macOS
嵌入式
APACHE
NGINX
redis
Docker
git
互联网
tomcat
Html/Css
JavaScript
jQuery
HTML5
Angular
React
Vue
小程序
架构设计
面向对象
设计模式
领域驱动设计
Android开发
iOS开发
Flutter
鸿蒙
其他手机开发
敏捷开发
项目与团队管理
软件工程其他
.NET
Java
Python
Go
PHP
C++
Ruby
Swift
C语言
Erlang
Delphi
Scala
R语言
Verilog
Dart
Rust
其他语言
asp
nodejs
读书区
翻译区
求职面试
计算机图形学
软件测试
菜谱
SEO技术
摄影
生活技巧
144
0
0
0
标题录入
封面图
Apache中设置默认首页的方法 在你安装后的Apache目录下,有一个conf目录,在这个目录里,有一个"httpd.conf"文件.我们要做的,就是修改这个文件. 比如 /etc/httpd/conf/httpd.conf 在这个文件里,凡是以"#"开头的每一行,都是无效的,如果你想让你的设置起作用,就要把行首的"#"去掉. 找到 DirectoryIndex 这段 /etc/httpd/conf/httpd.conf中的<IfModule dir_module>,其默认内容如下: ``` <IfModule dir_module> DirectoryIndex index.php index.html <IfModule> ``` 把它改成DirectoryIndex index.php index.Html index.html 这样,你的网站目录的默认首页是 index.php, 如果没有index.php系统会自动寻找index.html、html做为默认首页了。 注意事项:index.php index.Html之间要有一个空格 另外你还可以操作一下其它的: 1,设置网站根目录 找到DocumentRoot 这段.把他设成你网站的根目录,比如 DocumentRoot "/www/test" DocumentRoot "/www/test" 2,设置权限 ``` <Directory "/www/test"> Options -Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all DirectoryIndex index.php index.html </Directory> ``` 注意:这两部当中涉及到的两个路径DocumentRooth和Director必须保持一致,否则会报没有权限的错误。
下一篇:
apache中设置只允许本地和另一IP访问!
标题录入,一次不能超过6条
孤独与无聊的定义
T:0.011197s,M:156.02 KB
返回顶部
留言
留言
评论