Reconnecting to wamp server with same configuration failed - wamp

I can't able to successfully connect to the wamp server from other machine from where I used to connect previously. With the same httpd.conf I connected successfully earlier. I turned of firewall and changed the httpd.conf file accordingly to connect from the other machine. I am facing the same issue continuously. Need suggestions to resolve the issue. Thanks in advance.

Please remember WAMPServer is primarily a developer tool and as such is configured for the security of beginners. Apache is setup to only be accessible from the PC running WAMPServer.
If you want to allow access from other PC's i your network all you need to do is put it online.
(left click) wampmanager -> Put Online
This will chnage the httpd.conf file to allow access from any ip, so as long as your network is not accessible form outside your network it is not a security issue.
Additional Info:
Possibly the "Put Online" has not worked, it sometimes happens if manual amendments have been made to the httpd.conf file. In that case make the amendments manually.
Edit httpd.conf using the wampmanager menus
(left click) wampmanager -> Apache -> httpd.conf
Find this section
<Directory "c:/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
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# 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:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require local
</Directory>
And change the following part by adding the triplet for your local network subnet i.e. only the first 3 of the 4 quartiles and any ip in that subnet will be allowed access to apache
# onlineoffline tag - don't remove
Require local
Require ip 192.168.1
Alternatively, you can allow any ip in the universe
# onlineoffline tag - don't remove
Require all granted
This is a little dangerous if your network can be accessed from the internet.
Also you will need to check your Firewall. You need to grant access on port 80 to external TCP access, and port 443 if you using SSL.

Related

AH01630: client denied by server configuration WAMP

I have seen alot alot of guides how to fox the AH01630 error and some httpd corrections and tweaks.
Surely some will be annoyed me asking for help on this specific topic but I was trying to figure out for hours how to fix my issue.
What did I do?
I have port-forwarded the required ports for Apache and MySQL
I installed WAMP on my computer
I tried to config. httpd
I read about 50 topics according to make my server public accessible
-
I tried to set up the whole thing on a fresh virtual machine
I reinstalled WAMP a few times
So what doesn't work?
The usual access refuse message: Forbidden You don't have permission to access / on this server.
-I found this in the error log: AH01630: client denied by server configuration
I have tried to fix the issue by my own and couldn't proceed further after hours, maybe I forgot a little detail or just something I have to know but I don't because I am uneducated in this specific area
Thanks in advance
Here are the logs and config, if you don't mind and know how to fix the problem send me the finished file
httpd.conf
apache_error.log http:// pastebin. com/YSZDc0tp
access.log http:// pastebin. com/xfwv5ebB
In WAMPServer 3+ there is a Virtual Host defined for localhost by default, and that is where you should make the access amendments and not in httpd.conf
So in httpd.conf replace
# onlineoffline tag - don't remove
Require all granted
</Directory>
With
# onlineoffline tag - don't remove
Require local
</Directory>
Edit \wamp\bin\apache\apache\apache2.4.18\conf\extra\httpd-vhosts.conf and replace Require local with Require all granted
EG
#
# Virtual Hosts
#
<VirtualHost *:80>
ServerAdmin webmaster#homemail.net
ServerName localhost
DocumentRoot E:/wamp/www
<Directory "E:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

you don't have permission to access [custom alias] on this server

can anyone help with a following issue:
I am using wamp to run projects in my chrome browser.
after adding a newAlias which points to my project directory c:/dev/myProject
I am getting Forbidden message: you don't have permission to access /newAlias on this server.
I can access default Aliases such as phpmyadmin, webgrind...
but i cannot access my own.
I am using WampServer Version 2.5 64bit on Win 8.1 64bit located in c:/wamp.
I tried basic stuff from the net but with no luck.
Any suggestions?
Edit: content of newAlias:
Alias /bs1/ "c:/_DEV_/git/NewProject/www/"
<Directory "c:/_DEV_/git/NewProject/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Dont change that section of your httpd.conf. Those few lines control access to the root folder of the drive that Apache is installed on. So you just gave full access to anybody with a handy hack.
The process of securing the access via Apache is to deny all access to everything from the root folder and below, and then selectively allow access for specific sites to specific areas/folders of the drive.
A better solution would be to change httpd.conf back to how it was and make the change in your Alias definition. Like this :-
Alias /bs1 "c:/_DEV_/git/NewProject/www/"
<Directory "c:/_DEV_/git/NewProject/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local <-- to develop on this PC
Require ip 192.168.1 <-- to access the server from another PC on your network
Require all granted <-- to allow the world to see the beauty of your site
</Directory>
It is actually a better idea to use Virtual Hosts to control each site and not Alias's.
Here is a why and Howto :- WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts
I've updated WAMP from 2.2.22 to 2.4.9 and found that new aliases didn't work (same error message as yours).
Checking the default aliases like phpmyadmin, I've found this:
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.1.14/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Require local
#
# by
#
# Require all granted
#
<Directory "c:/wamp/apps/phpmyadmin4.1.14/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Deny from all
Allow from localhost ::1 127.0.0.1
</IfDefine>
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360
</Directory>
If you see the contents of the file you'll notice the <IfDefine APACHE24> and <IfDefine !APACHE24> conditionals. So I've changed my alias .conf file from:
Alias /svn "c:/work/website-svn/"
<Directory "c:/work/website-svn/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
to:
Alias /svn "c:/work/website-svn/"
<Directory "c:/work/website-svn/">
Options Indexes FollowSymLinks MultiViews
Require local
</Directory>
That solved my problem, I hope it solves yours.
I am no expert on this but the answer above seemed like I was granting access to my entire computer...So tried modifying the above answer to only giving access to where my alias folder is...
So instead...Go to the httpd.conf file...and do a search for...
<Directory />
AllowOverride none
Require all denied
</Directory>
and below that add the following
<Directory "c:/path-to-your-alias-folder...">
AllowOverride none
Require all granted
</Directory>
This worked to me and I think it might be a bit safer...Again I am no expert here...Just trying to make it work...
for allow permission for your server & wamp you require 3 steps please ensure these 3 things after that you can access your site from other network with ip address e.g http://192.168.1.1/yoursitefoldername
(192.168.1.1 is you computer or vps ip address "yoursitefoldername" is folder name of your site which should be in your wamp->www folder)
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
I found a solution which worked for me.
In httpd.conf i changed:
<Directory />
AllowOverride none
Require all denied
</Directory>
to
<Directory />
AllowOverride none
Require all granted
</Directory>
Which solved the issue and allowed me to access my custom aliases.
I would suggest that you consider setting up virtual hosts instead. It takes a few more minutes, but it's more bulletproof. RiggsFolly's answer to a similar question is excellent in its detail, rigor, and utility:
Project Links do not work on Wamp Server

How to bring wamp server online?

I have already tried port forwarding through router and also disabled my firewall.
I also edited httpd.conf. There I changed
Listen 80
to
Listen 8080
I also changed ServerName from localhost:80 to <private-ip>:80 i.e 192.168.1.2:80.
Finally I changed to
Order Allow,Deny
Allow from all
in offlineonline tag.
I have DLink DSL-2730U. In that in advanced settings> NAT > external port start 8080 and end 8080> internal port start 8080 and end 8080>Server ip i kept as 192.168.1.2
Then restarted all the sevices i.e both router and wamp.
But still i am unable to access wamp through my public ip which is 59.95.81.56.
It should have been a simple case of left clicking the WAMPManager menu and clicking Put online.
What that would have done is changed this section of httpd.conf from this:
If using Apache 2.2.x
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
To this:
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
If using Apache 2.4.x
# onlineoffline tag - don't remove
Require local
To this:
# onlineoffline tag - don't remove
Require all granted
And strictly thats all you should have needed to do!
But as you have done some manual messing with httpd.conf here are some things you need to check. I am assuming you wanted to change the port to 8080 rather than thinking you had to for some reason. If you didnt want to change port number to 8080 then use 80 in the following info instead of 8080. Changing to 8080 just makes life more complicated for your users, but if this is just a play site that does not really matter I suppose.
httpd.conf
# as your router probably does not support IPV6 change so apache only listens on IPV4
# you dont need to put the actual ip address of this PC in here as you say you did.
Listen 0.0.0.0:8080
# ServerName port need to match the Listen, your question made me think you may have left this as localhost:80
ServerName localhost:8080
If using Apache 2.2.x
# Assuming your site is in c:\wamp\www ( this section should already exist I just removed all the comments for brevity)
<Directory "d:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
</Directory>
If using Apache 2.4.x
# Assuming your site is in c:\wamp\www ( this section should already exist I just removed all the comments for brevity)
<Directory "d:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require from all
</Directory>
If you made the common mistake of changing this section, change it back to this, or you will be giving access to your C:\ to anybody.
If using Apache 2.2.x
<Directory />
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
If using Apache 2.4.x
<Directory />
Options FollowSymLinks
Require all denied
</Directory>
I hope something in here makes you stumble upon your mistake or ommission.
EDIT: Additional info
phpMyAdmin is protected from prying eyes like this:
edit c:\wamp\alias\phpmyadmin.conf
Alias /phpmyadmin "d:/wamp/apps/phpmyadmin3.5.1/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#
<Directory "d:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
See the line Allow from 127.0.0.1 that stops anyone not on the same PC as the database using it.
So if you are trying to access that from the internet, it wont work.
I suppose you could TEMPORARILY change it to :
Order Allow,Deny
Allow from all
Or better still if you know the ip address of where you are going to test it from you coudl do
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
Allow from xxx.yyy.zzz.aaa
Where xxx.yyy.zzz.aaa is your friends IP address.
I got the answer at here.
The part I missed in other solution was the Configurtion below:
Configuring the server to be reachable by everyone
The last step! Open your httpd.conf and find this line:
ServerName localhost:80
Change it to:
ServerName <your private IP>:80
Example:
ServerName 192.168.1.27:80
Additionally to RiggsFolly's answer you can open a port in your firewall instead of disabeling it.
The Firewall protects you from many things and disabeling it will make your computer much more vulnerable to hacks
Open port in Windows Firewall

Wamp is stuck on "Server Offline" after directory change

I wanted to change the folder from which Wamp reads its files, from the www folder inside the wamp folder to somewhere else.
I've tried to change the httpd.conf file and replace each occurrence of the original www folder with my new folder. The problem is that after I do that and run Wamp, it is stuck on an orange icon with the message "Server Offline" and doesn't seem to really start. When I change the httpd.conf file back to what it was Wamp manages to run successfully.
What am I doing wrong? How can I change the www folder and still have a working Wamp?
It is best to create Virtual Hosts for this purpose. Leave wamps stuff where it is and create a Virtual Hosts for each of your projects.
HowTo: Create Virtual Hosts in WAMPServer
BEFORE DOING ANY OF THIS PLEASE ENSURE APACHE AND MYSQL ARE WORKING PROPERLY FIRST!!!
Create a new folder outside the wamp directory structure. This folder can be on any disk drive visible to the PC running wamp. So if you installed WAMP on C:\ this could be on D:\ or E:\ etc
C:\websites
Create a subfolder in c:\websites for each site you want to create.
eg:
C:\websites\site1
C:\websites\site2
Edit the file C:\wamp\bin\apache\apachex.y.z\conf\extra\httpd-vhosts.conf where x,y and z are the version numbers of apache that you actually have installed.
NOTE: If you are switching between 2 or more versions of apache this will have to be done to all your versions of apache in turn.
SUGGESTION: I like to use the format sitename.dev to make it obvious to me that I am dealing with my localhost development copy of a site, you may prefer another notation, thats ok, the word dev has no actual defined meaning in this case, its just my way of naming my development versions of a live site.
Remove the lines that already exists in this file. They are just examples.
NameVirtualHost *:80
## must be first so the the wamp menu page loads when you use just localhost as the domain name
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "C:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from localhost
Allow from ::1
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/websites/site1"
ServerName site1.dev
ServerAlias www.site1.dev
Options Indexes FollowSymLinks
<Directory "C:/websites/www/site1">
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from localhost
Allow from ::1
</Directory>
</VirtualHost>
Add as many as you require so each of your sites have one, changing the DocumentRoot, ServerName and any other of the parameters as appropriate.
This also allows you to make SITE SPECIFIC changes to the configuration.
NOTE: This will make the wamp manager "Put Online" function no longer have any effect on these new vhost'ed sites as the security for each one is now part of the vhost definition, so leave WAMP, OFFLINE. If you want to put one or more sites online you will have to change the Allow commands MANUALLY in the httpd-vhosts.conf file.
To check your subnet do the following:
Launch a command window, and run
ipconfig
Look for the line "Default Gateway" in the output and use the third number in your Allow commands.
Edit your httpd.conf file and search for these lines, they are near the bottom of the file.
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
Remove the '#' comment character on this line to Include your newly changed vhosts, this will cause apache to register their existance.
While still editing your httpd.conf file search for this section of it
onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
DO NOT CHANGE THESE LINES!
Add the following after the <\Directory> tag to secure your new C:\websites folder.
<Directory "C:/websites/">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from localhost
Allow from ::1
</Directory>
This is to set security on your new directory structure so that access to these new sites is only allowed from 127.0.0.1 (localhost) unless amended from within a specific VHOST.
You can add to this as your requirements change. For example if you want anyone on your subnet to be allowed access to your site(s) you can add `Allow from 192.168.0' to this list assuming you are on subnet 192.168.0, check using 'ipconfig'.
Now in order for your browser to know how to get to these new domain names i.e. site1.dev and site2.dev, we need to tell windows what IP address they are located on. There is a file called HOSTS that is a hangover from the days before Domain Name Servers (DNS) were invented. It is a way of giving nice easy rememberable names to IP address's, which of course is what DNS Servers do for us all now.
Edit your HOSTS file, this can be found in C:\windows\system32\drivers\etc , the file does not have an extension. Windows protects this file so you must be an Administrator to be allowed to save changes to this file.
If you are using VISTA or Windows7/8 you may think you are an Administrator BUT YOU ARE NOT!!!!
So to edit this file you must launch your editor, or Notepad in a specific way to gain Administrator rights. To do this find your editors icon and launch it using the following key strokes:
Shift + Right Click over its icon, this will display a menu, click the item "Run as Administrator", and click "Allow" on the challenge dialog that will appear.
Now you are ready to edit the hosts file so navigate your editor to c:\windows\system32\drivers\etc\hosts
Add the following lines to this file
127.0.0.1 site1.dev
127.0.0.1 site2.dev
NOTE: You will need to add one line in this file for each of your new virtual hosts.
In order for Apache to pick up these changes you must bounce ( stop and restart ) apache.
Do this by: Wampmanager -> Apache -> Service -> Restart Service
You should now be able to use the address site1.dev in your browser to get to your new sites. Copy your sites code into the "C:/websites/xxxx" folder if you already have a site coded or, place a quick and simple index.php file into the "c:\websites\xxxx" folder to proove it all works.
example:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>SITE1</title>
</head>
<body>
<?php
echo '<div style="background-color:red;color;white;text-align:center;font-size:18px">HELLO FROM Site1</div>';
?>
</body>
</html>
TROUBLE SHOOTING:
If you have used the new domain name ( site1.dev ) and it has not found the site.
a. Check the changes to the hosts file.
b. Restart the "DNS Service" that runs in windows. This caches all doman names that you use in a browser so that the browser does not have to query a DNS Server each time you re-use a domain name. This may have cached your failed attempt but a restart is easy and should solve the problem and is quicker that re-booting windows, which should also work.
To do this launch a command window as an Administrator ( Shift + Left Click over the command window icon ) and run these 2 commands.
net stop "DNS Client"
net start "DNS Client"
Note: The quotes are required as there is a space in the services name.
Apparently it was because I tried to change my Wamp directory to something inside Google Drive. This solved my problem: https://stackoverflow.com/a/14444634/458152

Client denied by server configuration with tomcat

I have found at least a dozen entries for this error even in this forum, and many outside. All are basically saying that inside <Directory></Directory>, I have "deny all" directive, and no "allow" directive.
I cannot write a fixed directory to match because it is created on the fly by a backend tomcat server.
When I entered "myUrl/test/request/user1/1234567890/download", I get
403 Forbidden: You don't have permission to access /test/request/user1/1234567890/download.
httpd error log shows:
[error] [client xxx.xx.xx.xxx] client denied by server configuration: /data/test, referer: myUrl/test/request/user1/1234567890
The part beginning with "test" is created by the backend tomcat, in which "user1" and "1234567890" vary, while the other parts of the directory structure remain fixed.
In my httpd.conf, I do have:
<VirtualHost *:80>
DocumentRoot /data
---
---
RewriteRule ^/test - [L]
---
</VirtualHost>
How do I solve this? Even if I create a different and create another document root, I will need a regex. Somewhere outside , I tried this:
<Directory "/data/test/request/*/*/download">
Options -Indexes -FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
But no success.
I am using "ajp" to talk to backend tomcat and have necessary module in place and I can telnet the backend tomcat server (on 8009) . So it should not be ajp communications problem.
The "test" piece in above url is actually a "context" inside /webapps directory of tomcat. Owner in that "test" context is tomcat, but I have added read permission for everyone.
First, I had to "deny all" for "/"
Directory
Deny from all
/Directory
Only then "Allow for all" for "/data"
Directory /data
---
---
Allow from all
/Directory
Then I rearranged RewriteRule, Redirect, ProxyPass, ProxyPassReverse inside the
VirtualHost *:80
/VirtualHost
and it worked!