WAMP 403 Forbidden message on Windows 7

后端 未结 26 1509
抹茶落季
抹茶落季 2020-11-27 12:51

I have installed WAMP version 2.1 on my windows 7 machine. When i browse to localhost in my browser, the WAMP server page is visible.

But when I browse to my IP in m

相关标签:
26条回答
  • 2020-11-27 13:20

    The access to your Apache server is forbidden from addresses other than 127.0.0.1 in httpd.conf (Apache's config file) :

    <Directory "c:/wamp/www/">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
    </Directory>
    

    The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :

    <Directory "c:/wamp/apps/phpmyadmin3.4.5/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1
    </Directory>
    

    You can set them to allow connections from all IP addresses like follows :

    AllowOverride All
    Order allow,deny
    Allow from all
    
    0 讨论(0)
  • 2020-11-27 13:20

    The solution for changing the permissions in the httpd.conf will work if you are OK with providing access to the WAMP server from outside.

    If you do not want to do that then all you have to do is tell windows that the "localhost" domain points to 127.0.0.1. You can do that by editing the hosts file in your system directory.

    The file is placed at : C:\Windows\System32\drivers\etc\hosts

    by default windows 7 ships with :

    # localhost name resolution is handled within DNS itself.
    #   127.0.0.1       localhost
    #   ::1             localhost
    

    You have to un-comment the mapping for localhost:

    # localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost
    #   ::1         localhost
    

    Note: you will not be able to edit the hosts file as its a read-only file. To edit, you have to be the administrator, copy the file to some other location, edit it and then copy it back to the etc directory.

    I do not recommend the change of the hosts file. Use the permissions of httpd.conf file. use the hosts file approach only if you do not want the server accessed from outside.

    0 讨论(0)
  • 2020-11-27 13:20

    Try adding the following lines of code to the file httpd-vhosts.conf:

    <VirtualHost *:80>
    ServerAdmin serveradmin@host.com
    DocumentRoot "C:\wamp\www"
    ServerName localhost
    </VirtualHost>
    
    0 讨论(0)
  • 2020-11-27 13:21

    For Wamp 3.1.3 and Apache 2.4 I simply had to change 1 line in my httpd-vhosts.conf file.

    1. Open httpd-vhosts.conf
    2. Change "Require local" to "Require all granted"
    3. Restart all services

    I was then able to get to my apache server from other computers.

    Give credit to this video: https://www.youtube.com/watch?v=Sy_f6wBGnjI

    0 讨论(0)
  • 2020-11-27 13:22

    I read & tried All Fixes But Not one worked. At last i Found that the Wamp Server Logo Is Green But Need to Be "PUT ONLINE". So simple & a Quick Fix After Checking Your PHPMyAdmin.Cofg & HttPD.cofg Just Click on PUT ONLINE

    0 讨论(0)
  • 2020-11-27 13:24

    Another thing I found out is that if your network adapter uses IPV6, it will not show as 127.0.0.1 but ::1

    What I ended up doing is this:

    <Directory "c:/wamp/www/">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
        Allow from ::1
    </Directory>
    

    The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :

    <Directory "c:/wamp/apps/phpmyadmin3.4.5/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1
            Allow from ::1
    </Directory>
    
    0 讨论(0)
提交回复
热议问题