热门搜索 :
考研考公
您的当前位置:首页正文

CentOS 7 中 apache 配置问题

来源:东饰资讯网

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.

  1. 要检查 apache 用户的访问权限。
  2. 检查 SELinux 访问权限。开启访问权限命令为 setsebool -P httpd_read_user_content 1
Top