Cant access WAMP over LAN - apache

I have read many posts here and many tutorials as well.. and for some reason.. I just cant get access to my WAMP install/pages/content from other machines on the network?
WAMP 2.4 (still) :)
Here is what I have tried so far:
WAMP install machine IP: 192.168.1.121
I have enabled/disbaled Windows Firewall on the WAMP install machine (completely for testing)
I have created a an INBOUND rule allowing (TCP, on PORT 80, private option selected only, also tried to check public)
Apache httpd.config:
Listen 192.168.1.121:80
Listen 80
Then a bit below:
Order Deny,Allow
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
Allow from 192.168.1.101
Allow from all
Complete:
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
# onlineoffline tag - don't remove
Order Deny,Allow
# Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
Allow from 192.168.1.101
Allow from all
</Directory>
I my Apache httpd-vhosts.conf file I have (outside of some other default and test entries) the following:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#BarBot.com
DocumentRoot "c:/wamp/www/barbot/"
ServerName BarBot
ErrorLog "logs/BarBot-error.log"
CustomLog "logs/BarBot-access.log" common
<directory "c:/wamp/www/barbot/">
Options +Indexes +FollowSymLinks +MultiViews
Require all granted
#Deny from all
#AllowOverride All
#Allow from 127.0.0.1
#Require all granted
#Require ip 192.168.1
#Require ip 192.168.1:80
</directory>
</VirtualHost>
I grabbed a netbook I had laying around.. plugged it into my network..
loaded up browser and went to:
192.168.1.121
as well as
192.168.1.121:80
192.168.1.121:80/barbot
I will either get:
timed out message on browser..
or more recently
Not found: The requested URL /barbot was not found..etc..etc..
At this point I am lost.. I dont even have a direction to pursue or test with?
I have also tried to toggle putting WAMP online/offline.. neither state seemed to make a difference?
What am I missing here? What things can I test out? And is there a way to check on things? Logs? Errors? Something that will give me direction? Or help get direction at least?)
Update:
Second PC -
IP: 192.168.1.101
I can PING the 192.168.1.121 machine just fine.. never misses a packet.
Final State:
Something is 'working', but must be configured somehow/somewhere?
When I attempt to open: 192.168.1.121:80/barbot (WAMP machine) I get a NOT FOUND (404) page...
If I try to go to say... 192.168.1.121:8080 (I get Unable to Connect page/message)..

Related

This site can’t be reached - XAMPP ignores custom domain vhosts

Environment
XAMPP 7.2.4 installed on Windows 10
Apache running on ports 80 and 443
Configuration
C:\Windows\System32\drivers\etc\hosts:
127.0.0.1 www.test.local test.local
C:\xampp\apache\conf\httpd.conf:
DocumentRoot "D:/htdocs"
<Directory "D:/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName localhost
<Directory "D:/htdocs">
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName test.local
<Directory "D:/htdocs">
Allow from all
</Directory>
</VirtualHost>
The problem
When I start Apache and I access to localhost is all right. The problem comes when I try to reach test.local: the browser returns a This site can’t be reached message. It's like XAMPP ignores the custom domain vhosts defined into httpd-vhost.conf file. The same message is displayed with the server off.
This site can’t be reached
The webpage at http://test.local/ might be temporarily down or it may have moved permanently to a new web address.
ERR_ADDRESS_INVALID
A few days ago the setup was working and the only changes that I made was the new software installation. I mean, no changes in Apache config files.
If all your stack were working correctly before, don't be like me and don't forget to check if some browser extension is blocking your local traffic, like some extension related with an antivirus system.
In my case it was the Kaspersky Protection extension. When something goes wrong, it shows the following graphic.
C:\Windows\System32\drivers\etc
127.0.0.1 test.local
C:\xampp\apache\conf\extra\httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "C:/wamp64/www/test"
ServerName test.local
<Directory "C:/wamp64/www/hydroboost/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Have you updated your C:\Windows\System32\drivers\etc\hosts file with a mapping like this this?
add this line to the end of the hosts file
127.0.0.1 test.local
the localhost domain works without this mapping, because the OS already recognizes "localhost" as a built in alias for the loopback IP address
(this suggestion is assuming that you are running and testing on the same local machine)

The requested URL / was not found on this server. in Wamp 3.1.0

I know there are similar questions about this but non of them resolve my problem.
I already used virtual host and it was running before until this morning this error occurred when I tried to access this link http://www.notification.test/
I have this kind of error.
Not Found
The requested URL / was not found on this server.
Apache/2.4.27 (Win64) Server at www.notification.test Port 80
I have this in my hosts 127.0.0.1 www.notification.test
and this is my setup in C:\wamp64\bin\apache\apache2.4.27\conf\extra
<VirtualHost *:80>
DocumentRoot C:/wamp64/www/notification/public
ServerName www.notification.test
<Directory C:/wamp64/www/notification/public>
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I just add the directory as what suggested from another post but didn't work.
My Wamp version is 3.1.0 running in 64 bit windows7 OS and the Apache is 2.4.47.
Need some help guys and thank you.
Basically its just a missing / see the <Directory..... parameter.
<VirtualHost *:80>
ServerName notification.test
ServerAlias www.notification.test
DocumentRoot "C:/wamp64/www/notification/public"
<Directory "C:/wamp64/www/notification/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Also you HOSTS file should look like this
127.0.0.1 localhost
127.0.0.1 notification.test
::1 localhost
::1 notification.test
Note:
Require all granted is a bit unnecessary if you are just using other PC's in your own network. Instead use Require ip 192.168.0 for example, to allow any ip in your local network access but nothing outside your own network.

WampServer: 403 Forbidden

All of a sudden my local WampServer vhosts are not working.
I've added a new vhost to vhosts.conf and hosts.
When I load that vhost in a web browser, I receive 403 Forbidden.
In vhosts.conf, I have:
<VirtualHost *:80>
ServerName example.com.au
ServerAlias example.com.au
DocumentRoot "D:\Dropbox\WAMP\WWW\example.com.au"
<Directory "D:\Dropbox\WAMP\WWW\example.com.au">
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
</VirtualHost>
In httpd.conf I have:
Listen 10.0.0.199:80 ::1
Listen [::0]:80
<Directory />
AllowOverride none
Require all denied
</Directory>
where 10.0.0.199 is my PC's IP.
WampServer is online.
WampServer 3.0.6
Apache 2.4.23
Help appreciated.
I changed
<Directory />
AllowOverride none
Require all denied
</Directory>
to
<Directory />
AllowOverride none
Require all granted
</Directory>
in httpd.conf, and that resolved the 403 error.
The default config in httpd.conf has all the Listen parameters you need
Listen 0.0.0.0:80
Listen [::0]:80
This says listen on port 80 of whatever this PC's ip address is for both IPV4 and IPV6 address ranges, and is all you need.
This section of httpd.conf should also be left as you found it. This sets up the basic denial of all rights to all folders on the drive where you installed WAMPServer(Apache) and should do exactly that. Change it back to this
<Directory />
AllowOverride none
Require all denied
</Directory>
This is for your security. It say nobody is allowed access to the root of this driver and therefore no access to anything below the root. Once this is set you are then supposed to open up access to ONLY what Apache actually need access to. That is what you do in your httpd-vhosts.conf file for only the folders that site requires access too.
If you are hacked, then a hacker can only access those folder given access and NOT YOUR WHOLE DRIVE.
Your Virtual Host definition in httpd-vhosts.conf shoudl look like this
<VirtualHost *:80>
ServerName example.com.au
ServerAlias www.example.com.au
DocumentRoot D:/Dropbox/WAMP/WWW/example.com.au
<Directory "D:/Dropbox/WAMP/WWW/example.com.au/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
## Dangerous unless you really mean to
## allow the universe into your server
## I would use one of the other options and comment this one out
Require all granted
# If access from this PC only then us
# i.e. you are a standalone developer
# uncomment this
#Require local
#If access from your local network is required
# i.e. you are working with other devs within your local network
# uncomment this
#Require ip 10.0.0
</Directory>
</VirtualHost>
Note the use of Unix forward slashes and the <Directory.... tag needs a trailing slash
Then check your HOSTS file it should be like this
127.0.0.1 localhost
::1 localhost
127.0.0.1 example.com.au
::1 example.com.au

Accessing Wamp 3.1.0 from other devices

I have Wamp Server 3.1.0 installed on my Windows computer.
I am trying to access my sites from other devices, connected are connected on the same network.
I have searched online. And I have followed tutorials, but nothing matches what I need. The closest I got was: How to enable local network users to access my WAMP sites?
My httpd-vhosts.conf looks like this:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName laravel.dev
DocumentRoot "c:/wamp/projects/forum/public"
<Directory "c:/wamp/projects/forum/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName test.dev
DocumentRoot "c:/wamp/projects/test/public"
<Directory "c:/wamp/projects/test/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local granted
</Directory>
</VirtualHost>
My expectation at this point is I can go onto another device and access my Wamp Server 3.1.0 and my individual projects.
Unfortunately I'm hit with an Error 500 saying:
Forbiddon
You do not have permission to access / on this server.
_______________________________________________________________
Apache/2.4.27 (Win64) PHP/7.1.9 Server at 192.168.1.21 Port 80
I have double checked my ipconfig and IPv4 Address matches the IP in the Error 500 code: 192.168.1.21
I did notice that the Apache version and PHP version match the versions I am using. So I know I'm accessing the server. Just not sure of the Error 500 code.
I have tried accessing my projects from these URLs:
http://192.168.1.21
http://192.168.1.21:80
http://laravel.dev/
http://test.dev/
http://localhost/
And none of them work.
Thanks in advance.
Change Require local granted to Require all granted, if not solved, Try to edit httpd-vhosts.conf file like this:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1
</Directory>
</VirtualHost>
try access your ip computer from other device, for example your computer ip is 192.168.1.4, if you can access this ip, then create your virtual host.
if you can not access that ip, try fixing it so ip can be accessed. then create a virtual hosts.

WAMP 403 Forbidden message on Windows 7

I have installed WAMP version 2.1 on my windows 7 machine. When i browse to localhost in my browser, the WAMP server page is visible.
But when I browse to my IP in my browser, I get the message
403 Forbidden: You don't have permission to access / on this server.
Any suggestions?
The access to your Apache server is forbidden from addresses other than 127.0.0.1 in httpd.conf (Apache's config file) :
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
You can set them to allow connections from all IP addresses like follows :
AllowOverride All
Order allow,deny
Allow from all
I found a simpler fix...
Although the icon was green WAMP still needs to be "Put Online" (last item of menu when left-clicking icon).
After that I had access as normal.
For me the inclusion of "Require local" helped to solve Error 403. The alias config file looks like this:
Alias /mytest/ "C:/mytest/"
<Directory "C:/mytest/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
Require local
</Directory>
The solution for changing the permissions in the httpd.conf will work if you are OK with providing access to the WAMP server from outside.
If you do not want to do that then all you have to do is tell windows that the "localhost" domain points to 127.0.0.1. You can do that by editing the hosts file in your system directory.
The file is placed at : C:\Windows\System32\drivers\etc\hosts
by default windows 7 ships with :
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
You have to un-comment the mapping for localhost:
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
Note: you will not be able to edit the hosts file as its a read-only file. To edit, you have to be the administrator, copy the file to some other location, edit it and then copy it back to the etc directory.
I do not recommend the change of the hosts file. Use the permissions of httpd.conf file. use the hosts file approach only if you do not want the server accessed from outside.
Try adding the following lines of code to the file httpd-vhosts.conf:
<VirtualHost *:80>
ServerAdmin serveradmin#host.com
DocumentRoot "C:\wamp\www"
ServerName localhost
</VirtualHost>
Another thing I found out is that if your network adapter uses IPV6, it will not show as 127.0.0.1 but ::1
What I ended up doing is this:
<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>
The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
For Wamp 3.1.3 and Apache 2.4 I simply had to change 1 line in my httpd-vhosts.conf file.
Open httpd-vhosts.conf
Change "Require local" to "Require all granted"
Restart all services
I was then able to get to my apache server from other computers.
Give credit to this video: https://www.youtube.com/watch?v=Sy_f6wBGnjI
if you have used localhost/phpmyadmin/
simply use
127.0.0.1/phpmyadmin/ for PHPMyAdmin
127.0.0.1/sqlbuddy/ for SQLBuddy
or if you have used localhost:8080/phpmyadmin/ then
127.0.0.1:8080/phpmyadmin/ for PHPMyAdmin
127.0.0.1:8080/sqlbuddy/ for SQLBuddy
Remember to remove dummy elements in httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
For Apache version 2.4.x simply replace Require local with Require all granted in httpd.conf file inside <Directory "c:/wamp/www/"> tag then Restart all services
There could many causes to this problems
What I have experienced are:
1) 127.0.0.1 localhost entry was duplicated in hosts file
2) Apache mod_rewrite was not enabled
Regardless of the cause, backing up your www folder, vhost configuration file (and httpd configuration file) will help.
And such process takes a few minutes.
Good luck
I read & tried All Fixes But Not one worked. At last i Found that the Wamp Server Logo Is Green But Need to Be "PUT ONLINE".
So simple & a Quick Fix After Checking Your PHPMyAdmin.Cofg & HttPD.cofg Just Click on PUT ONLINE
I tried the configs above and only this worked for my WAMP Apache 2.4.2 config. For multiple root site without named domains in your Windows hosts file, use http://locahost:8080, http://localhost:8081, http://localhost:8082 and this configuration:
#ServerName localhost:80
ServerName localhost
Listen 8080
Listen 8081
Listen 8082
#.....
<VirtualHost *:8080>
DocumentRoot "c:\www"
ServerName localhost
<Directory "c:/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8081>
DocumentRoot "C:\www\directory abc\svn_abc\trunk\httpdocs"
ServerName localhost
<Directory "C:\www\directory abc\svn_abc\trunk\httpdocs">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
</VirtualHost>
#<VirtualHost *:8082></VirtualHost>.......
I faced this issue with wamp on windows 7. Adding following code to httpd-vhosts.conf solved the issue for me.
<VirtualHost *:80>
DocumentRoot "F:/wamp_server/www/"
ServerName localhost
</VirtualHost>
Thanks for your question.
I'am using wamp 3 now.
And I find an simple answer to do this under your question.
But that answer should change a little on wamp 3.
The steps are as following:
Right click wamp icon
Choose Wamp Setting
Click the Menu item:online/offline
Left click wamp icon
You will find there is a new item called "Put online"
It took me forever to figure this out.
C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
In this file you will notice several example virtual host files, that look like:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
Simply delete these entries and replace with:
<VirtualHost *:80>
ServerAdmin serveradmin#host.com
DocumentRoot "C:\wamp\www"
ServerName localhost
</VirtualHost>
You definitely need to make sure your other ducks are in a row but this for me with the solution that worked.
hi there are 2 solutions :
change the port 80 to 81 in the text file (httpd.conf)
and click 127.0.0.1:81
change setting the network
go to control panel--network and internet--network and sharing center
click-->local area connection
select-->propertis
check true in the -allow other .....
and --- allo other .....
I had this problem too. The route of my problem was I had made a mistake in my vhosts.conf file. If you are using vhosts this is another thing to check
This configuration in httpd.conf work fine for me.
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
</Directory>
Make sure you aren't using a Windows' directory separator character (backslash) in your path names in your .conf file, even if you are on Windows. Apache doesn't understand them but will still start up and then output a 403 Forbidden Message.
wrong:
<Directory "c:\websites\my-website\">
right:
<Directory "c:/websites/my-website/">
Surprisingly, square brackets in DocumentRoot (and related, like <Directory>) paths can also cause error 403:
DocumentRoot "P:/TRY/web/fatfree/from_github/fatfree-master[bang]" failed with 403, while
DocumentRoot "P:/TRY/web/fatfree/from_github/fatfree-master" worked fine.
(I didn't bother figuring out the Apache path escaping, if any, just renamed the path instead. If anyone knows, comments are welcome.)
My solution was to disable encoding for encoded files (these files are green in windows). Ive got these files from MAC computer and it was encrypted by default.
Ive select these files > right click > properities > general tab > andvanced > uncheck encrypt files...
And voila it works.
I have tried all the stuff except clearing the mess in .htaccess file.
Go to www/ directory and make a copy of .htaccess file in another folder. Then clear all the lines in .htaccess original file.
And add this line,
RewriteEngine On
Then restart the server.
This has solved my problem and got access to all my localhost sites.
Hope it would solve yours too.
Also on Apache 2,4 you may need to add this to the directory directive in conf,
in case you decided to include httpd-vhosts.conf.
By default you can install wamp in C:\ but still choose to deploy your web development in another location.
To do this inside the vhosts.conf you can add this directive:
<Directory "e:/websites">
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
AllowOverride All
<IfDefine APACHE24>
Require local
</IfDefine>
<IfDefine !APACHE24>
Order Deny,Allow
Allow from all
Allow from localhost ::1 127.0.0.1
</IfDefine>
</Directory>
make sure that, the name of the file in the directory c:/wamp/apps/phpmyadmin3.1.3.1/, match the name (or version) in the phpMyAdmin.conf (Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.1.3.1/" )
I have found that if you are using ammps that for some reason its always forbidden when its in your root folder so i put it in the directory above my root folder and made a alias in the httpd.conf using this
Alias /phpmyadmin "C:/Program Files (x86)/Ampps/phpMyAdmin"
please note i am using ammps and i dont know for sure if it will work for others but its worth a try ;)