开发者

All localhost pages via WAMP blocked?

I've been trying to fix a weird 403 Forbidden error I get when I try to go to one of m开发者_Python百科y pages via WAMP on the localhost.

After adding a rule to open up port 80 via Windows Firewall, which apache uses, I notice that this does NOT fix my problem and instead gives me a 403 forbidden for ALL my pages via localhost.

Removing the rule I just made (which caused this to begin with) does not fix it. Disabling Windows Firewall does not fix it. Restarting my computer does not fix it. Any ideas?

EDIT2: I AM able to go to localhost/phpmyadmin for whatever that's worth.

EDIT3: The contents of my httpd.conf: http://www.mediafire.com/?p54a53443efkefs


In httpd.conf, find the following sections and ensure they are correct:

DocumentRoot "C:/wamp/www"

<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory C:/wamp/www>
    Options None
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Those are the settings that I am using in my install and they work fine. Make sure you restart Apache if you make any changes.

If you continue having issues, please update your original question with your httpd.conf.


Edit:

This is kludgey and I'm just grasping at straws here, but try adding a new entry to your vhosts:

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www"
    ServerName localhost
</VirtualHost>


It can be an ipv6 issue. So in your httpd.conf add your ipv6 local address:

Change:

Allow from 127.0.0.1

to:

Allow from 127.0.0.1
Allow from ::1:


Try changing the line in httpd.conf

Allow from 127.0.0.1 

or

 Allow from all

Refer to the documentation


Marco Tamanti solution worked for me:

Allow from 127.0.0.1
Allow from ::1:

so I have:

<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>


Your "Deny From All" is what's causing the 403 error. The setup you post is used to prevent all traffic, with the intention of later allowing specific traffic. If you never allow specific traffic, you'll never get it to work.

With your 404 error, ensure you're using the right path and there's no errors in your apache error log.

http://httpd.apache.org/docs/current/mod/core.html#directory


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.

All localhost pages via WAMP blocked?

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


Simple solutions. Just Run as Administrator the Wamp Installations file and they will works like a charm :)


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜