403 error for phpmyadmin
Posted by: bizguy72 (---.nsw.bigpond.net.au)
Date: June 18, 2007 08:58AM

Hi,

I've just installed WAMP5. All services are running and server is online. When I point my browser to:

[localhost]

....this works fine; I see the WAMP5 homepage that displays all of my config info. If I then click on:

[localhost]

...this works fine too. However, when I try and access:

[localhost]

...I get a '403 Forbidden' error (You don't have permission to access /phpmyadmin/ on this server). Here is a copy of what is being output to the Apache error log:

[Mon Jun 18 16:42:26 2007] [error] [client 0.0.0.0] client denied by server configuration: C:/wamp/phpmyadmin/, referer: [localhost]

Same behaviour when trying to access [localhost]

I just followed the default installation - I didn't do anything tricky.

I'm running Windows 2000, service pack 4

Any suggestions would be greatly appreciated.

Thanks
Adam

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: dval (---.chrcitadelle.be)
Date: June 18, 2007 02:39PM

to access phpmyadmin, put wamp in offline mode and
[localhost]

and make sure you add the slash ( / ) at the end of the url or it wont work

and if it is not enough :
add Win32DisableAcceptEx in the httpd.conf
see also :
[www.apachelounge.com]

To use the workaround, put the Apache directive Win32DisableAcceptEx (http://httpd.apache.org/docs/2.2/mod/mpm_winnt.html#win32disableacceptex)
in your httpd.conf file.
It is just a one-word directive with no arguments. It should be outside of any blocks like <Directory>, <VirtualHost>, <Location>, etc.

This causes Apache on Windows systems to use the standard socket accept() (http://msdn2.microsoft.com/library/ms737526.aspx)
function instead of the higher-performance Microsoft-specific AcceptEx() (http://msdn2.microsoft.com/library/ms737524.aspx)
function to accept incoming requests.

See Apache bug #41321 (http://issues.apache.org/bugzilla/show_bug.cgi?id=41321)
for more info about how the getpeername() function doesn't work on Windows 2000 if AcceptEx() is used.

--------------------------------------
Apache bug #41321
**********************
Change 480213 (& 480212) to network_io/win32/sockets.c
now causes apr_socket_addr_get() in network_io/unix/sockaddr.c
to call get_remote_addr() because remote_addr_unknown is set.

get_remote_addr() calls the Windows function getpeername().

This step is unnecessary on Windows - the remote IP is already present.

getpeername() does not work correctly on Windows 2000, it always returns
0.0.0.0. It works correctly on XP and Win2003. Windows bug?

getpeername() doc is at [msdn2.microsoft.com]

------- Additional Comment #1 From Will Rowe 2007-01-09 11:22 [reply] -------
Fixed remote_host_unknown in APR trunk/1.2 branch for apr_socket_make.

Following AcceptEx, apr_socket_make must be passed the collected remote socket
on such platforms as it inhibits the proper behavior of getpeername in some
circumstances.

Workaround is to avoid AcceptEx altogether on affected systems.



Post Edited (06-19-07 09:27)

Dval
(depuis la Belgique, enfin encore pour l'instant... pfff. quel pays :-)

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: bizguy72 (---.nsw.bigpond.net.au)
Date: June 18, 2007 03:25PM

Thanks for responding...

>>to access phpmyadmin, put wamp in offline mode
>>and [localhost]

Tried this first and it still didn't work....but why would I expect this to work
anyway if wamp is in offline mode?

>>and if it is not enough :
>>add Win32DisableAcceptEx in the httpd.conf

I added this directive and restarted the services/server but still
get no joy...here is the apache error log file that shows apache
starting back up and the resulting error when I try to access
[localhost]:

[Mon Jun 18 23:10:37 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 configured -- resuming normal operations
[Mon Jun 18 23:10:37 2007] [notice] Server built: Jan 9 2007 23:17:20
[Mon Jun 18 23:10:37 2007] [notice] Parent: Created child process 2196
[Mon Jun 18 23:10:37 2007] [notice] Disabled use of AcceptEx() WinSock2 API
[Mon Jun 18 23:10:37 2007] [notice] Child 2196: Child process is running
[Mon Jun 18 23:10:37 2007] [notice] Child 2196: Acquired the start mutex.
[Mon Jun 18 23:10:37 2007] [notice] Child 2196: Starting 250 worker threads.
[Mon Jun 18 23:10:38 2007] [notice] Child 2196: Listening on port 80.
[Mon Jun 18 23:11:24 2007] [warn] (OS 10038)An operation was attempted on something that is not a socket. : getsockname failed

In fact, I get the same error now even when accessing just 'http://localhost/' - if I remove the Win32DisableAcceptEx directive, once again 'http://localhost/' works fine but 'http://localhost/phpmyadmin/' doesn't.

Any other ideas?

Thanks
Adam

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: CyberSpatium (71.237.217.---)
Date: June 18, 2007 08:14PM

when wamp is in offline mode the server is running, but it is only accessible to you, localhost. when it is in online mode, it is accessible to everyone using your ip address

do not enable the Win32DisableAcceptEx unless you you are getting Win32DisableAcceptEx error messages from apache.

roms, the creator of wamp setup phpmyadmin and sqlitemanager to be only accessible by you using localhost. so, this means even if your server is in online mode, only you will have access to those scripts.

you need to edit the permission setting to allow you to access those scripts with your ip address, so open these two files located:
C:\wamp\Apache2\conf\alias\phpmyadmin.conf
C:\wamp\Apache2\conf\alias\sqlitemanager.conf


in each file, just below Allow from 127.0.0.1 add:
Allow from your.ip.address.here

make sure you add this to both files. after you are done editing the files, restart apache for the new changes to take effect.

if you do not know your ip address:
www.whatismyipaddress.com



CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.


Mortgage and Home Loan Advice:
Clarify Loans

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: chrisbob12 (---.ppp.onetel.net.uk)
Date: June 19, 2007 01:34AM

I get the same result with a similar setup. I'm aiming to have a Drupal development site on my PC.

I have a W2K multiboot system (Hyperos) plus Zone Alarm Pro, and put WAMP in /Program Files/, but that shouldn't make a difference. Right?

The tray comes on and I can get to localhost OK, and it shows any directories I put in 'www' so something is working right.

I tried the .conf file modifications, but it is not working online or off-line yet.


Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: bizguy72 (---.nsw.bigpond.net.au)
Date: June 19, 2007 02:14AM

Hi Cyberspatium,

OK, I got this working by doing the following:

Firstly, I was getting this error in the Apache log:

[Mon Jun 18 16:42:26 2007] [error] [client 0.0.0.0] client denied by server configuration: C:/wamp/phpmyadmin/, referer: [localhost]

So I then went and edited file C:\wamp\Apache2\conf\alias\phpmyadmin.conf as
you suggested but I added the following line:

Allow from 0.0.0.0

....and now everything works fine.

This installation is just for me to use on my laptop so I'm not overly concerned if I've just opened up some sort of security hole.

Thanks for your help everyone!

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: CyberSpatium (71.237.217.---)
Date: June 19, 2007 04:13AM

chrisbob12, did you restart apache after you edited the config file?


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.


Mortgage and Home Loan Advice:
Clarify Loans

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: chrisbob12 (---.ppp.onetel.net.uk)
Date: June 20, 2007 12:21AM

Hi Cyberspatium, thanks for replying.

Yes I restarted Apache, then the PC, just to be sure.

I uninstalled and reinstalled the package a couple of times, and from a fresh install, I select localhost and get localhost when online and 403 when offline.

I get 403 for phpmyadmin and sqlitemanager when online or offline.

Same when I modify the .conf files to minclude the IP address returned by whatismyipaddress.com

Is it likely to be anything to do with my router?

Regards, C.

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: chrisbob12 (---.ppp.onetel.net.uk)
Date: June 20, 2007 12:55AM

I tried 'Allow from 0.0.0.0' and it sort of works:

1 I remove my internet cable for this one
2 localhost, myphpmanager, sqlite manager all work when WAMP is set to 'online'
3 localhost gives error 403 when WAMP is set to 'offline', php & sql still work

So thanks for the tip Bizguy72, but my PC is plugged in all the time, so 'Allow from 0.0.0.0' is a bit scary for me, especially if I can't use it offline, so I'm still open to suggestions.

An interesting journey.

It's going to be something really obvious, I'm sure...

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: bizguy72 (---.nsw.bigpond.net.au)
Date: June 20, 2007 09:57AM

chrisbob12,

I'm certainly no expert so this suggestion might not be practical but if you're running any type of firewall on your laptop (which you should be) then I'm thinking that you just might be able to set up a rule to block all *incoming* port 80 traffic; therefore by allowing 0.0.0.0 and having WAMP set to 'online' you will be able to run apache locally with no problems and all other external attempts to access the web server should be blocked....just an idea...perhaps someone else can comment if this would work. (I acknowledge that the best solution would be to work out what the problem is and fix the source but my suggestion is in case you get no joy there).

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: chrisbob12 (---.ppp.onetel.net.uk)
Date: June 20, 2007 10:06PM

Hi bizguy72,

Sounds convincing. I've set it up in Zone Alarm Pro.

Hmm UDP port? TCP port? I choose both (incoming only) and leave the router firewall for the time being.

Hopefully this thread will resolve. I think WAMP is a neat package.
Thanks also to Cyberspatium and dval for input.

Options: ReplyQuote
Re: 403 error for phpmyadmin
Posted by: Paramount X (---.dyn.optonline.net)
Date: July 05, 2007 11:27PM

I tried this and it works for me some waht

I tried putting my ip under
Allow from (myrouter ip)

that didn't work

I did this

Allow from 0.0.0.0 or all

But that it making it avaible to everyone..but when I put my ip it doesn't work..ways that

and do i fix it. I also can visit phpmyadmin when online mode too.

Options: ReplyQuote


Sorry, only registered users may post in this forum.