美文网首页
服务器 “You don't have permissi

服务器 “You don't have permissi

作者: Amfishers | 来源:发表于2018-11-07 14:14 被阅读14次

    在腾讯云上配置好wamp之后,服务器上打开 localhost 是可以访问的。
    但是在自己电脑上打开网站,却显示
    403 forbidden
    You don't have permission to access /test.html on this server.

    这就纳闷了,经过一番折腾,找到下面这个靠谱的解决办法,原来是apache的配置问题

    一、httpd.conf文件更改
    
    1、找到httpd.conf文件位置:
    
    在你的wamp安装目录下的\bin\apache\apache2.4.9\conf文件夹中。例如路径为:C:\wamp\bin\apache\apache2.4.9\conf
    
    2、httpd.conf代码更改
    
    ①在第242行左右的位置将
    
    <Directory />  
        AllowOverride none  
        Require all denied  
    </Directory>  
    更改为:
    
    <Directory />  
        AllowOverride none  
        #Require all denied  
        Require all granted  
    </Directory>  
    
    也就是允许其他请求访问。
    
    ②在第284行左右的位置在“Require local”后面加上一句:“Require all granted”
    
    即
    
    <Directory "c:/wamp/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  
      
        #  
        # 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  
        Require all granted  
    </Directory> 
    

    另外
    在安装wampserver之前,我单独安装了 php 和 IIS 以及 Mysql,单独安装显得比较麻烦,而且IIS会占用wampserver的80端口, 所以卸载了 才能正常显示

    相关文章

      网友评论

          本文标题:服务器 “You don't have permissi

          本文链接:https://www.haomeiwen.com/subject/mscvxqtx.html