配置apache2.4时出现Forbidden You don't have permission to access / on this server. 问题解决方案

安装完wampserver后,通过127.0.0.1或localhost访问网页可以正常访问;

但是通过其他电脑对服务器的公网ip地址进行访问,一直显示forbid....如图:

配置apache2.4时出现Forbidden You don't have permission to access / on this server. 问题解决方案_第1张图片

查阅博客帖子,发现这个问题常规的解决办法是修改httpd.conf中的两处配置。

我的解决过程是

先将


    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

修改为


    Options FollowSymLinks
    AllowOverride none
    Require all granted

接着将

DocumentRoot "${INSTALL_DIR}/www"

    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options +Indexes +FollowSymLinks +Multiviews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
#    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
#    Require local
   AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted

修改为

DocumentRoot "C:/wamp/www"

    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted

这两处配置修改完成后,保存,重启服务。。

结果发现还是不能通过公网ip访问服务器端的网页。

最后通过大佬的帖子得知,还需要修改httpd-vhost.conf的配置。

原帖链接:https://bbs.csdn.net/topics/390904273?list=23494857

配置apache2.4时出现Forbidden You don't have permission to access / on this server. 问题解决方案_第2张图片

最后,将 httpd-vhost.conf的配置按大佬的解决方案修改,保存,重启服务,成功通过服务器的公网ip访问到网页。

配置apache2.4时出现Forbidden You don't have permission to access / on this server. 问题解决方案_第3张图片

你可能感兴趣的:(服务器)