127.0.0.1 Forbidden but localhost OK?
Posted by: herb (---.nwrknj.fios.verizon.net)
Date: January 14, 2014 09:01PM

Hi Guys,

I really hate to ask for help, but for the past two days I've unable to get my new machine up with Wampserver, and I'm afraid it might be something easy for the experts.

My new machine is running 64 bit Windows 7 Ultimate SP1.

My previous machine that works fine is also 64 bit Windows 7 Ultimate SP1 and is still running Wampserver 2.0 with Apache 2.2.11, PHP 5.2.8, MySQL 5.1.30

I initially installed the Wampserver (64 bits * PHP 5.4) version 2.4 but found that my Drupal 6.14 site didn't like PHP 5.4. I tried to install the older PHP 5.31 on this install but it said that it was incompatible with Apache 2.4.4

I then uninstalled from control panel this version and installed the Wampserver (64 bits * PHP 5.3) version 2.2E (No registry removal of wamp* was done)

After visiting the localhost and PhpMyAdmin with the new install I got a permissions error accessing PhpMyAdmin. I “fixed” this in the phpmyadmin.conf by editing to Allow from all as follows:

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

The server works fine on using static pages accessed via the localhost url but not by using 127.0.0.1

However, think that this 127.0.0.1 error might also be causing some problems with (Access denied for user herb@localhost using password: YES), permissions in opening my drupal database even though I have repeatedly confirmed the user permissions, password, and username are correct.

I followed the instructions at [forum.wampserver.com] to Ignore the IPV6 Address range by editing the http.conf file to
Listen 0.0.0.0:80
and edited the hosts file to comment out the ::1 as in #::1

However, even with these edits I cannot get to 127.0.0.1 without a (Forbidden You don’t have permission to access / on this server). While localhost works fine.

FWIW, everything worked fine with Wampserver 2.0 without any of these edits so I guess it must be a function of the security in the 2.2 Wampserver or Apache 2.2.22 vs 2.2.11

Any suggestions you could offer would be greatly appreciated.

If there are no obvious errors could I attempt another complete uninstall and re-install after deleting all wamp* references in the registry and/or look for a Wampserver 2.0 to try to install?

Thanks greatly for all your efforts!!!

OK - Just uninstalled everything, cleaned the registry, and started over.

A ping on localhost returned ::1 so it confirmed I have an IPV6 issue.

I used option 2 on [forum.wampserver.com] to enable IPV6 localhost usage on my machine.

This fixed the problem of not accessing the localhost via 127.0.0.1,, however, I still cannot open my Drupal database using the correct username and password... so I fear I still have some other permissions challenges to resolve.

Any further suggestions would be greatly appreciated



Edited 1 time(s). Last edit at 01/15/2014 12:21AM by herb.

Options: ReplyQuote
Re: 127.0.0.1 Forbidden but localhost OK?
Posted by: RiggsFolly (---.as13285.net)
Date: January 15, 2014 12:28AM

Try setting up these 3 users in mysql and give them all access to your drupal database.

DRUPALUSER@127.0.0.1
DRUPALUSER@localhost
DRUPALUSER@::1

Just to cover all the bases

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: 127.0.0.1 Forbidden but localhost OK?
Posted by: herb (---.nwrknj.fios.verizon.net)
Date: January 15, 2014 01:08AM

Thanks for the prompt response... I tried that with no luck as of yet... I think my next step is a new Drupal install to see if that works, and then see if I can find any differences.

Options: ReplyQuote
Re: 127.0.0.1 Forbidden but localhost OK?
Posted by: RiggsFolly (---.as13285.net)
Date: January 15, 2014 12:49PM

Ok here goes


Change this
<Directory "s:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>

To

<Directory "s:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>


Now also check your httpd.conf, look for this section

<Directory "s:/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
    # [httpd.apache.org]
    # 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:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 localhost ::1
    # You could also add this line if you want to be able to access from another PC on your internal network
    # assuming your internal network subnet start with 192.168.0
    Allow from 192.168.0
</Directory>

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 01/16/2014 10:31AM by RiggsFolly.

Options: ReplyQuote
Re: 127.0.0.1 Forbidden but localhost OK?
Posted by: herb (---.nwrknj.fios.verizon.net)
Date: January 15, 2014 08:03PM

Thank You,, Thank You, Thank You!!!

I had already made the changes you offered in your last post,,, but I went back and checked my new users..

DRUPALUSER@127.0.0.1
DRUPALUSER@localhost
DRUPALUSER@::1

While I had entered them I thought, and given the appropriate permissions to the database.. it seems that it wasn't really working.

I restarted the system,, and then entered the users.. restarted again, and created the database,, (I think the ::1 user wouldn't be applied to the database unless it had all complete permissions.

Anyway,, I did it all over again with complete permissions, the database showed the 3 users, and the page opened!!!

Much appreciated! I owe you a beer(s).

Options: ReplyQuote


Sorry, only registered users may post in this forum.