httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Brown <seanmichaelbr...@gmail.com>
Subject Re: [users@httpd] VirtualHost confusion
Date Wed, 02 Nov 2005 18:53:38 GMT
On 11/2/05, Adam Roberts <adam@lonetree.com> wrote:
> It has been a longtime since I have needed to use <VirtualHost>'s and now my
> ignorance has caught up with me.
>
> I have a two domain names (domain1.com and domain2.net) that I am trying to
> host on the same machine with VirtualHost, however, I'm not having much
> luck.
>
> Background:
> Apache2 running on RHEL 3 ES Update 6.
>
> VirtualHost snippet from /etc/httpd/conf/httpd.conf
> ----------------------------------------------------------
>
> NameVirtualHost <ip-address>:80
>
> <VirtualHost <ip-address>>
>         ServerName www.domain2.net
>         ServerAdmin webmaster@domain2.net
>         DocumentRoot /var/www/html/domain2
>         ServerAlias www.domain2.net domain2.net
> </VirtualHost>

If you do NameVirtualHost <ip-address>:80, you need to do <VirtualHost
<ip-address>:80>.  Also, though probably not the problem, there's no
need to put ServerAlias  www.domain2.net when you've already named it
as the ServerName.

Finally, make sure to restart Apache after you've made those changes
before you try again.

Sean

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message