httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Betts" <>
Subject switching between local and remote copies of websites
Date Sun, 10 Feb 2002 23:30:12 GMT

I need a little help! .... (sorry if this post is a bit long!)

At present I develop websites for hosting on a *nix/apache/php/mysql web host.

Development is performed on a Windows machine with the same versions of the hosting software

To allow me to switch between the local development environment and the remote live web host
I have Apache setup using VirtualHosts
and then I simply switch the hosts file to point to the IP address used by the local Development
Apache VirtualHost settings...

e.g. Apache setup for the 'default' server 'localhost' is as follows

ServerName http://localhost
DocumentRoot "C:/home/localhost/public_html"
ScriptAlias /cgi-bin/ "C:/home/localhost/cgi-bin/"

ErrorLog logs/error.log
CustomLog logs/access.log common

Then for each website hosted on the development machine I add a virtual host

    DocumentRoot c:/home/websitea/public_html
    ScriptAlias /cgi-bin/ c:/home/websitea/cgi-bin/

    ErrorLog logs/
    CustomLog logs/ common

    DocumentRoot c:/home/websiteb/public_html
    ScriptAlias /cgi-bin/ c:/home/websiteb/cgi-bin/

    ErrorLog logs/
    CustomLog logs/ common


When I want to switch to the development versions I would add the following to the hosts file:

or I remove these lines to work on the live hosted version... this is simply done via 2 batch
files that copy the appropriate
version of the a hosts file to the Windows folder (9x) or winnt\system32\drivers\etc (NT/2000).

So far so good ... this all works fine!


What I want to do now is to be able to move the development versions onto a machine on a peer
to peer (p2p) network and then on any
pc on the network be able to switch from the development to web versions as required ... as

What I have working now is ... the PC running the Apache server (same config as above) only
serves one website to any other pc on
the p2p network... this is the localhost site ... and is accessable from any other pc by entering
either the server ip address in a
browser (e.g. or if I point each computers hosts file to the ip address
of the computer running the Apache
server, for each web address that is currently a VirtualHost on the Apache server conf file...

These will both serve the localhost website from the Server machine.

I have tried switching to a name based conf where they all share the same ip address on the
server machine ... but get the same

The main question is... How do I do this? ... Can I do this? ... am I going the right way
about this?

Under network settings for TCP/IP for a network card I have 'Disable DNS' .... should I be
setting up a DNS?

If so how? (do you know of a suitable online reference) and how do I make it easily changable?...
I dont particularly want to have
to keep going into network settings to change the DNS entries there if there is a simple option
like the use of the hosts file

If I do this, would it mean that all pc's have to be in local or remote mode at one time,
as a DNS would presumably be shared across
the local network?

Am I asking the right questions? I dunno!

If you have had any similar experience or a different approach to the problem some advice
would be greatly appreciated.



Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.323 / Virus Database: 180 - Release Date: 08/02/02

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message