CentOS 7
中, apache
版本为 2.4
,配置细节有所不同。
配置文件
DocumentRoot
默认所有的请求都从该文件夹访问。也可用符号链接此处。
DocumentRoot
设置访问默认文件
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
开启、关闭、重启 apache
$ apachectl start
$ apachectl stop
$ apachectl restart
$ apachectl status
日志文件
访问权限
如果出现 Forbidden You don't have permission to access on this server.
- 要检查
对
apache
用户的访问权限。 - 检查
SELinux
访问权限。开启访问权限命令为setsebool -P httpd_read_user_content 1