Error 404 when acessing wamp from LAN
Posted by: Burway (---.range86-183.btcentralplus.com)
Date: March 30, 2012 11:11PM

Hi,
I have just set up WAMPserver on an XP machine so that I can develop sites from my Laptop.
However I am unable to acess the WAMPserver from any other machine. I have eliminated firewall problems as far as I can by shutting down the firewall on both machines and adding Port forwarding on Port 80 on the router (TCP)
I have added Allow from xxx.xxx.xxx.xxx # laptop fixed ip .. into the httpd.conf file directory entry and I have made sure that WAMP is in online mode.
Wamp management can be accessed on localhost on the serving machine and appears to be functioning OK.
Now running out of ideas so any suggestions would be appreciated.
Thanks

Options: ReplyQuote
Re: Error 404 when acessing wamp from LAN
Posted by: RiggsFolly (---.as13285.net)
Date: April 03, 2012 01:16PM

The best way I find is to setup a virtual host.

In httpd.conf uncomment the line
#Include conf/extra/httpd-vhosts.conf

Edit /extra/httpd-vhosts.conf file and add something like this


#
# Use name-based virtual hosting.
#
NameVirtualHost *:80


## must be first so the the wamp menu page loads on the server machine
<VirtualHost *:80>
ServerAdmin webmaster@.localhost
DocumentRoot "D:/wamp/www"
ServerName localhost
ServerAlias localhost
</VirtualHost>

## This assumes you will place your site outside the www directory ( much better idea than using wamp\www )
<VirtualHost *:80>
ServerAdmin webmaster@site1.localserver
DocumentRoot "C:/websites/www/site1"
ServerName site1.localserver
ServerAlias site1.localserver
</VirtualHost>

... add as many of these as sites you want to host for testing



Restart All Services from wamp manager.

Check apache comes up ok!! If not you probably spelt a folder name incorrectly or have not yet created the folder. Create it or check spelling. Load your site into the the C:/websites/www/site1 folder.


On your laptop edit the c:\windows\system32\drivers/etc/hosts file.
You will need to launch your editor or the command window using "Run as Administrator" as this file is protected by the operating system from accidental/bad-guy access.
Sometimes it also is set to read-only so you may need to run this command from a command window
attrib -r hosts
to remove the read-only attribute.

Add a line per site you have created as a virtual host as follows:
192.168.x.x site1.localserver

The 192.168.x.x is the IP Address of your serving PC, the server PC need to be a static IP as well as the laptop.

From the laptop you can now address your site as [site1.localserver]
and everything you code such as relative directory references should remain perfectly usable when you copy the site to an actual hosting package.


Hope this helps

Options: ReplyQuote
Re: Error 404 when acessing wamp from LAN
Posted by: Burway (---.range86-144.btcentralplus.com)
Date: April 05, 2012 08:08AM

Thank you,
I have managed to sort the problem using VH as suggested. Your instructions were a great help.
I had put the Vhost configuration into the httpd.conf file instead of the httpd-vhosts.conf file. Stupid mistake I know, but going through your instruction I was able to see my error so thank you again.
K

Options: ReplyQuote
Re: Error 404 when acessing wamp from LAN
Posted by: RiggsFolly (---.as13285.net)
Date: April 05, 2012 10:07AM

You are more than welcome.

Options: ReplyQuote


Sorry, only registered users may post in this forum.