running 2 site on one apache - need help
Dave Gavin
dgavin at davegavin.com
Thu Dec 4 22:21:22 EST 2003
Dave,
Try setting the different host names on the VirtualHost line rather than the
IP address. I have three aliases in my host file & local dns that all point to
the same address, and here's what works for me:
NameVirtualHost 192.168.1.12
<VirtualHost setanta.home.davegavin.com>
ServerName setanta.home.davegavin.com
HostNameLookups off
ErrorLog logs/setanta-error_log
CustomLog logs/setanta-access_log common
</VirtualHost>
<VirtualHost loghost.home.davegavin.com>
ServerName loghost.home.davegavin.com
HostNameLookups off
DocumentRoot /var/www/loghost
ErrorLog logs/loghost-error_log
CustomLog logs/loghost-access_log common
</VirtualHost>
<VirtualHost mailhost.home.davegavin.com>
ServerName mailhost.home.davegavin.com
HostNameLookups off
DocumentRoot /var/www/mailhost
ErrorLog logs/mailhost-error_log
CustomLog logs/mailhost-access_log common
</VirtualHost>
The first VirtualHost gets the default DocumentRoot as one isn't spec'ed and
each virtualhost's has it's own log. I think that you have to use the
"HostNameLookups off" to keep the three aliases straight as all three names
resolve to the 192.168.1.12.
HTH,
Dave Gavin
On Thu, 4 Dec 2003 18:36:17 -0800 (PST)
Dave Peters <gameslover987 at yahoo.com> wrote:
> Hi all,
>
> I have redhat 9.0 linux setup with apache web server.
> I run single web site, the server runs perfect without
> any error. I try to run 2 web site on one apache and
> cause big problem: i.e. nothing coming. Any help are
> very appreciated.
>
> What I did for setup 2 web site:
> 1) the site location: /var/www/www.site1.com &
> /var/www/www.site2.com
> 2) I edit httpd.conf add the virtalhost:
> *************************
> Listen 80
>
> NameVirtualHost *:80
> <VirtualHost 192.168.1.110>
> ServerName www.site1.com
> DocumentRoot /var/www/www.site1.com
>
> </VirtualHost>
>
> <VirtualHost 192.168.1.110>
> ServerName www.site2.com
> DocumentRoot /var/www/www.site2.com
>
> </VirtualHost>
> **************************
> 3. I can start httpd without error.
> 4. I could not open both site when I browse it
>
> What did I miss? Any httpd.conf need to add? Any help
> are very appreciated.
>
> Thanks.
>
> DP
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://www.blu.org/mailman/listinfo/discuss
--
Being shot out of a cannon will always be better than being squeezed
out of a tube. That is why God made fast motorcycles, Bubba....
"Song of the Sausage Creature" Hunter S. Tompson
More information about the Discuss
mailing list