WAMP Server Forbidden error - wampserver

I have been running a website I have been developing on WAMPserver.
When ever I try to access it through my IPv4 address on the computer that it is running on and any other device on the network I ge a error 403 Forbidden You don't have permission to access / on this server.
Please help I kind of need it by a due date.

WAMPServer is designed as a development tool and not an environment for a LIVE site, so by default all the Apache security is based around allowing access from the PC running WAMPServer and nothing else.
If you want to open up your site to the world, you can use the menu item Put Online
left click wampmanager -> Put Online
If this does not work, usually becasue you have chnaged something in the httpd.conf file you can make the required changes manually.
Edit \wamp\bin\apache\apachex.y.z\conf\httpd.conf\httpd.conf
Find this section
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
And change it to
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
If you are using Apache 2.4.x the syntax has chnaged and you shoudl change it to
# onlineoffline tag - don't remove
Require all granted
BE VERY CAREFULL not to change any other section to Allow from all or Require all granted as this can compromise you PC security very easily.

Related

configuration wampserver home router

I can't access my wampserver from anther PC or cell phone.
I think the problem from my wireless router because I reset my router for default setting.
After resets I try to connect my wampserver but I found that I can't connect to the wampserver from others PC and cell phone.
How to configure wireless home router( my router is Dlink dsl) as localhost port?
This is probably nothing to do with your router.
WAMPServer comes configured as a single seat developer tool, and therefore the Apache config is setup to only accept connections from the PC running WAMPServer (Apache) to protect new users from external hacking attempts.
The Hammer to crack a Nut solution is this :
left click wampmanager -> Put Online
This amends the Apache config httpd.conf file to allow connections from any IP address in the universe.
The safer solution is to edit the httpd.conf file yourself and add the following line to allow access just from your internal network. When you are using your phone to connect to your server, it will have to be connected to your WIFI.
Edit htpd.conf using the wampmanager menus
left click wampmanager -> Apache -> httpd.conf
Find these lines in that file
# onlineoffline tag - don't remove
Require local
And add a line like this
# onlineoffline tag - don't remove
Require local
Require ip 192.168.1
Where 192.168.1 is the subnet your router uses.
Note the use of only 3 of the 4 quartiles, this says allow any device on that subnet access to Apache i.e. anything cabled to your router of anything connected to your routers wifi.
If you want to be even more specific you can mention specific ip addresses like this
# onlineoffline tag - don't remove
Require local
Require ip 192.168.1.20
Require ip 192.168.1.21
Require ip 192.168.1.22

Why the error "Forbidden" "You don't have permission to access / on this server." is appearing after installing wampserver2.2d on Windows 7?

I just downloaded wampserver2.2d-x32.exe from source forge and installed on my machine running on Windows 7 operating system.
The setup went well. Now when I started wampserver the W icon has turned Green but when I click on localhost link I get following message in a browser window :
**Forbidden**
You don't have permission to access / on this server.
Even I tried to check phpmyadmin by hitting the link http://localhost/phpmyadmin then I got following message in a browser window :
**Forbidden**
You don't have permission to access / on this server.
Can someone please help me in resolving these issues?
Thanks.
The problem is probably that your browser is using the ip address ::1 the IPV6 localhost address and WAMPServer 2.2d (being rather old now) was released before IPV6 was normally available on Windows Boxes so the httpd.conf does not contain this ip as a valid ip.
So first change the httpd.conf file like this ( use the menus to edit httpd.conf)
Find the Listen parameter it probably looks like this
Listen 80
Change it to
Listen 0.0.0.0:80
Listen [::0]:80
Then look for this section
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from localhost 127.0.0.1
And change it to
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from localhost 127.0.0.1 ::1
Now check the C:\windows\system32\drivers\etc\hosts file and make sure you have at least these entries in it
127.0.0.1 localhost
::1 localhost
To correct phpMyAdmin you will also have to edit the \wamp\alias\phpmyadmin.conf file in the same way, as phpMyAdmin is secured seperately in WAMPServer.
Edit \wamp\alias\phpmyadmin.conf
Look for this section :
Order Deny,Allow
Deny from all
Allow from localhost 127.0.0.1
And also add the IPV6 localhost address like this
Order Deny,Allow
Deny from all
Allow from localhost 127.0.0.1 ::1

403 Forbidden - WAMP Server 2.5

I have installed WAMP version 2.5 on my windows 8.1 machine. When i browse to localhost in my browser, the WAMP server page is visible.
But when I browse to my localhost in my mobile connected to same AP, I get the message "403 Forbidden: You don't have permission to access / on this server".
Any suggestions?
WAMPServer is configured to be a single seat developer tool for the AMP stack on a windows system.
As such and for the security of the complete beginner, WAMPServers Apache is configured to only accept connections from the PC that is running the Apache service.
If you want to connect to Apache from an IP other than that of the PC running WAMPServer, like your phone or another PC on your local network, you have to tell Apache that is allowed.
The simple solution for this is to use the wampmanager menus system :-
wampmanager -> Put Online
This will change the httpd.conf file from
# onlineoffline tag - don't remove
Require local
To
# onlineoffline tag - don't remove
Require all granted
Thus allowing any ip address in the universe to connect to your Apache web server. If you are sure that there is no external access to your local network this is reasonable solution.
If however you think that now or at some future time your network may allow access over port 80 from an external source, I prefer to be a little more specific when I change this parameter. So if you prefer you can
Edit the httpd.conf file, use the wampmanager menus to do this
wampmanager -> Apache -> httpd.conf
Then change this
# onlineoffline tag - don't remove
Require local
To
# onlineoffline tag - don't remove
Require local
Require ip 192.168.1
assuming that your local subnet starts with those 3 quartiles and that your phone is connected to your router via WiFi.
If your phone is using your suppliers network i.e. not your WiFi this will not work and you will have to Port Forward your router, but thats another question.
I searched for solutions to resolve the error "Forbidden" with Wampserver 2.5 in Windows 8.1.
Here's what I found:
Locate the file: httpd.conf
In my case the file is in C:\wamp\bin\apache\apache2.4.9\conf
The look for the line <Directory "c:/wamp/www/">
And then look for the line Require local, next write the following:
Require all granted
Restart your wampserver and you can browse the localhost on every devices that stays connected in your local network.
If you try all the above cannot solve, then try this.
I have the same problem then I realize there is .htaccess file that blocks the directory listing. Try to remove or reconfigure the .htaccess file.
All the best.
I uninstalled and reinstalled the services, almost damage the wampserver.
I tried this, and the section "Fix 403 Forbidden error on other computer in local network" worked for me. It was simplier, becuase the issue was in the ‘httpd-vhosts.conf’ file.
https://www.digifloor.com/simple-steps-fix-403-forbidden-errors-wamp-server-28

Remove ldap auth in htaccess for specific hosts

I have a Rails server (Passenger/Apache) that is running for all intents and purposes, LDAP authentication.
<Directory "/railsapp/public">
AllowOverride All
Allow from all
Require valid-user
Options -MultiViews
</Directory>
I use the REMOTE_USER variable in conjunction with a local database for user authentication. However, I have a set of special hosts that need to be able to wget a route from this rails application. The application already has the logic to not check REMOTE_USER for these routes.
Possible solutions are configuring a .htaccess for a special user and password to use for authentication, but this would grant access to the application. Instead, I was thinking of whitelisting the mostly static list of hosts such that Require valid-user would not apply to these hosts.
How would I setup /railsapp/public/.htaccess and/or the vhost.conf for this?
I tried (in .htaccess)
allow from myhost.mydomain.com
and restarted apache, but I still get 401 Authorization Required when trying from myhost.
How would I go about avoiding the authentication I put on my webapp? Solutions need not be restricted to how I'm trying to go about this, but I absolutely need the LDAP REMOTE_USER for my primary application.
Add the Satisfy directive
Satisfy Any
as well as
allow from myhost.mydomain.com
to your .htaccess.

Call secured application method outside

I have a rails application with apache, passenger, with kerberos protection.
One of the controllers (UsersController) provides one action (responds with json) that must be available externally.
When i try to access it ($ curl ...), the server returns Kerberos authentication error.
What should i do in this kind of situations. Configure httpd.conf to 'allow any' for one specific file, isolating the externally available methods in one file or is it a better solution?
I solved it configuring the specific dir in apache httpd.conf
<Location "/users/user_action.json*">
Order allow,deny
Allow from all
satisfy any
</Location>
Thanks

Resources