[thelist] Local apache

Jeroen Coumans jeroen at jeroencoumans.nl
Tue Jan 27 18:14:55 CST 2004


Thanks J.J.SOLARI! I'm now using the VirtualHost directive under
Apache-1.3 on Linux. Here's a summary:

You can test websites locally under Apache by using the VirtualHosts
directive. For each site you wish to test, use a seperate directory, eg.
/www/local.site.com. Now add the following lines to your httpd.conf:

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
ServerName 127.0.0.1
DocumentRoot /www/
</VirtualHost>

Now for each site you wish to test, add a VirtualHost directive. You can
use the following as a template:

<VirtualHost local.site.com>
DocumentRoot /var/www/local.site.com
ServerName local.site.com
</VirtualHost>

Reload Apache. To make the site accessible from your browser as
http://local.site.com, add the following line to /etc/hosts:

127.0.0.1 local.site.com

You'll have to add a line such as that for each site, changing the
hostname as appropriate, but leaving the IP address alone.

-- 
Groeten/Greetings,
Jeroen Coumans
www.jeroencoumans.nl



More information about the thelist mailing list