I have been using xampp for quite a while to develop sites on my local machine. Usually I set-up virtualhosts and then edit my hosts file so I can access them by name in my browser.
However - I get tired of having to upload in-development sites to a webserver so that the client can preview how the design is going etc..
My IP address is dynamic, but in reality it hasn't changed in over 18 months even when I have released it, left the router off and gone on holiday for two weeks I always end up with the same ip again!
So what I wanted to do was to make my local virtual hosts accessible from the network so that i could send a client a url http://myipaddress/ and they can see the site. I can do this no problem. So I now want to allow several clients to get previews of sites. eg
client1's site http://myipaddress
client2's site http://myipaddress:40321
This is what I have done...
forwarded the ports 80 and 40321 from the router to the appropriate machine
The Setup
In http-conf...
- Code: Select all
Listen 80
Listen 40321
in httpd-vhosts...
- Code: Select all
NameVirtualHost *:80
NameVirtualHost *:40321
<VirtualHost *:40321>
DocumentRoot "G:\web_development\websites\work\annaspan\html"
ServerName annag
<Directory "G:\web_development\websites\work\annaspan\html">
Order allow,deny
Allow from all
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "G:\web_development\websites\work\rebelit\wp"
ServerName rebelwp
<Directory "G:\web_development\websites\work\rebelit\wp">
Order allow,deny
Allow from all
AllowOverride All
</Directory>
</VirtualHost>
The Problem Result
Now when I someone trys http://myipaddress/ they get served the rebelwp site
however when someone trys http://myipaddress:40321 they still get served the rebelwp site and not the annag site
in the browser the url reverts back to http://myipaddress/
Alternatives
I have also tried the Listen, NameVirtualHost and VirtualHost directives using the machine's IP address and the loopback address
in various combinations.
So I have searched all afternoon on the internet & read and re-read the apache org docs on vhosts & I just can't see what I am doing wrong?
I have verified that the router is forwarding correctly and the server has a fixed IP on the local network otherwise the access to the single site wouldn't work.
Can anyone point out my stupidity please?
Thanks a lot,
Janimal