CentOS 7.4 解决 403 Forbidden : You don't have permission to access / on this server

今天为服务器安装Wordpress时,遇到如下问题无法访问网页

403 Forbidden : You don't have permission to access /wordpress on this server


403是因为当前没有权限访问服务器指定内容

需要更改apache配置:

配置文件默认路径如下

/etc/httpd/conf/httpd.conf

[root@VM_0_17_centos conf]# vim httpd.conf
[root@VM_0_17_centos conf]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service

之后再次访问IP,成功


具体而言

将下面的一段话


    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
改为

    #Options FollowSymLinks
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order deny,allow
    Allow from all
或将最后两句改为Require All Granted (Apache2.4以上版本)


Source: StackOverFlow


你可能感兴趣的:(Linux)