[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Using multiple ports for virtual hosting



Figured it out myself.

This is in response to me asking about how to have the same domain name on
multiple ports. Basically it would be a production server (port 80) a
staging or testing server (port 8080) and a developement server (port
1080). The idea was to keep a site running as normal, but do all the
development on a different directory. The structure is the same, so you
only have to copy the data with a script or by hand. This was suggested in
an Apache manaual as "Running the perfect site." So far it's working, we
know where all the raw and devlopement files are, and nothing on the
"live" site is being effected. We only did this because we are building
and managing about2-4 sites a day and with multiple people working on
them, you always know where the latest copy of the site it.

Here ya go:

1) Under your /web directory, create three directories called production,
staging & developement. Copy your site into production and developemnt.

Now you need to edit your httpd.conf file

2) Under your <virtualhost> container, change your Document root to
/home/sites/site#/web/production

This is now where your live documents are uploaded and stored. Meaning,
this is just like uploading into /web, but now it is /web/production.

3) Uncomment the line that says Listen 80
Ad the line Listen 1080
Ad the line Listen 8080


4) Right before your <VirtualHost> container undeneathe
NameVirtualHost 192.168.1.1 (or whatever your IP is) add

NameVirtualHost 192.168.1.1:1080
NameVirtualHost 192.168.1.1:8080

5) Now for your say, developement site, copy everything between the
<VirtualHost></VirtualHost> tags for the site you want to mirror.

6) Change everything that says :80 to :1080

7) Change your DocumentRoot to /home/sites/site#/web/developement.

The same goes for your staging or testing container. You can even add an
htaccess file to protect it.

The workflow goes like this:

devlope site and store in developement.
Once ready to launch, copy to staging
Have someone else that hasn't been buried in this thing for months test
it.
Once they sign off or ok they site, backup your /production directory,
clear out all files and move the /staging files into production. Then,
copy the files from /production into development so you always have a
current copy to work with. If you need changes, make them in developement,
and always copy them to staging for testing.

Sorry for such a long novella here, though someone else could use the
info.

Tom Socha
Technical Services
MoJo Graphics
http://www.mojographics.com