[thelist] Local apache

Trent Whaley u233 at shaw.ca
Tue Jan 27 14:37:43 CST 2004


On January 27, 2004 03:31 am, Jeroen Coumans wrote about "[thelist] Local 
apache":
> Hi,
> I have several websites which I maintain. To simplify updates to the
> navigation, I've made all links absolute (eg. /about/ instead of
> ../../about/). To test locally, I've installed Apache. However, I'm
> having troubles figuring out how to configure it so that it works
> locally. For example, I have /var/www/website1.com and
> /var/www/website2.com.
>
> Is it possible to configure Apache so that it translates absolute links
> to the respective document root? I've tried aliasing, but that only
> works for one website. I've also read about virtual hosts but that seems
> to require a DNS server, and I'm a bit reluctant to complicate my setup
> unless it's absolutely necessary.

There are two tricks I've used to get around this...

One: Set up virtual hosting, then add a line as follows:
24.89.67.24	testing.customer1.com testing.customer2.com testing.customer3.org 
(etc)
(where 24.89.67.24 is your IP address assuming you're not behind a NAT 
gateway) to the hosts file of each machine you want to be able to view the 
test site from. (hosts is /etc/hosts on Linux, BSD, etc, and on windows you 
can search for it (include system folders and hidden files). I think it's 
somewhere like 
c:\windows\system\drivers\*
Open it in Notepad.

Two: Set up virtual hosting, and get a bunch of vanity domains from somewhere 
like ods.org or hn.org.

<tip type="CodeRed">
Virtual hosts are also handy if you set up per host logging and make the 
default site (which only shows up if someone types your IP address into the 
browser) something like:


GO AWAY!

(be sure your own site is also set up as a virtual host). This way all the 
CodeRed worm messages get put in one place and your real site logs don't get 
cluttered.

</tip>



More information about the thelist mailing list