you don't have permission to access [custom alias] on this server

后端 未结 6 1237
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-14 15:00

can anyone help with a following issue: I am using wamp to run projects in my chrome browser. after adding a newAlias which points to my project directory c:/dev/myProject I am

6条回答
  •  遇见更好的自我
    2021-02-14 16:02

    for allow permission for your server & wamp you require 3 steps please ensure these 3 things after that you can access your site from other network with ip address e.g http://192.168.1.1/yoursitefoldername (192.168.1.1 is you computer or vps ip address "yoursitefoldername" is folder name of your site which should be in your wamp->www folder)

    1.

    first of all Port 80 and 443 must be allow for both TCP and UDP packets. To do this, create 2 inbound rules for TPC and UDP on Windows Firewall for port 80 and 443. (or you can disable your whole firewall for testing but permanent solution if allow inbound rule)

    2.

    If you are using WAMPServer 3 See bottom of answer

    For WAMPServer versions <= 2.5

    You need to change the security setting on Apache to allow access from anywhere else, so edit your httpd.conf file.

    Change this section from :

    #   onlineoffline tag - don't remove
         Order Deny,Allow
         Deny from all
         Allow from 127.0.0.1
         Allow from ::1
         Allow from localhost
    

    To :

    #   onlineoffline tag - don't remove
        Order Allow,Deny
          Allow from all
    

    if "Allow from all" line not work for your then use "Require all granted" then it will work for you.

    WAMPServer 3 has a different method

    In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so dont amend the httpd.conf file at all, leave it as you found it.

    Using the menus, edit the httpd-vhosts.conf file.

    It should look like this :

    
        ServerName localhost
        DocumentRoot D:/wamp/www
        
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
        
    
    

    Amend it to

    
        ServerName localhost
        DocumentRoot D:/wamp/www
        
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride All
            Require all granted
        
    
    

    Hopefully you will have created a Virtual Host for your project and not be using the wamp\www folder for your site. In that case leave the localhost definition alone and make the change only to your Virtual Host.

    3. Dont forget to restart All Services of Wamp or Apache after making this change

提交回复
热议问题