httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry Carmen <te...@cnysupport.com>
Subject Re: [users@httpd] Set multiple DocumentRoot
Date Fri, 26 Oct 2012 17:35:25 GMT
On 10/26/2012 06:02 AM, jupiter wrote:
> Hi,
>
> I need to set DocumentRoot to two directories, one for development and
> one for testing. But the server has only one IP address, and there is
> no DNS. Is it possible? If so, please give an example.

You can use multiple virtualhosts on one IP address by creating the 
directories:

/var/www/html/prod.example.com
/var/www/html/dev.example.com

And configuring your http.conf file with:

UseCanonicalName Off
VirtualDocumentRoot /var/www/html/%0

You can add the two hosts to your /etc/hosts file to make them resolve 
properly from your machine, if you can't update DNS.

Example: /etc/hosts

127.0.0.1   localhost
123.123.123.123 dev.example.com dev
123.123.123.123 prod.example.com prod


Terry



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message