All localhost pages via WAMP blocked?

后端 未结 8 2450
北恋
北恋 2020-12-15 08:15

I\'ve been trying to fix a weird 403 Forbidden error I get when I try to go to one of my pages via WAMP on the localhost.

After adding a rule to open up port 80 via

相关标签:
8条回答
  • 2020-12-15 09:03

    What I found worked for me after starting WAMP was, left clicking the WAMP icon that appears on the Taskbar, then clicking Start All Services under the Quick Admin. I was then able to access localhost using IE. I even went back to the httpd.config file and set it back to it's defaults.

    Hope this helps.

    0 讨论(0)
  • 2020-12-15 09:17

    you require 3 steps please ensure these 3 things

    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 :

    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot D:/wamp/www
        <Directory  "D:/wamp/www/">
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
        </Directory>
    </VirtualHost>
    

    Amend it to

    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot D:/wamp/www
        <Directory  "D:/wamp/www/">
            Options +Indexes +FollowSymLinks +MultiViews
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>
    

    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

    0 讨论(0)
提交回复
热议问题