You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Paul McFerrin <pm...@columbus.rr.com> on 2008/11/16 08:33:10 UTC

[users@httpd] debugging my Virtual Hosts

My Virtual Hosts are not working..

Here is the scoop.  Running Apache 1.3 and have the following 
configuration file:
  NameVirtualHost pmcferrin.homedns.org:80
[[default virtual hosts definitons]]
<VirtualHost    pmcferrin.homedns.org:80>
      DocumentRoot /usr/local/apache/htdocs
      ServerName mcferrin.homedns.org
      ErrorLog /usr/local/apache/logs/error_log
      CustomLog logs/access_log common
</VirtualHost>

<VirtualHost genealogy.homedns.org:80>
      VirtualDocumentRoot /e/genealogy
      ##DocumentRoot /e/genealogy
      ServerName genealogy.homedns.org
      ErrorLog /usr/local/apache/logs/error_log
      CustomLog logs/access_log common
</VirtualHost>

I have TWO domain names pointing to the same host machine.  I ran  
apachectl configtest whth no errors.  I tried using IP address for the 
container; no go.  It seems to be setting the first VirtualHost only.

My Dynamic DNS has both domains with the same IP.  I'm trying to get 
BOTH domains to respond with their different web page,  I want to avoid 
using IP address to minimize maintenance

What gives?  Not find anything useful in the FAQ's.

You can view my COMPLETE httpd.conf file at:  
http://pmcferrin.homedns.org/httpd.conf


---------------------------------------------------------------------
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


Re: [users@httpd] debugging my Virtual Hosts

Posted by André Warnier <aw...@ice-sa.com>.
Tom Evans wrote:
> On Sun, 2008-11-16 at 02:33 -0500, Paul McFerrin wrote:
>> My Virtual Hosts are not working..
>>
>> Here is the scoop.  Running Apache 1.3 and have the following 
>> configuration file:
>>   NameVirtualHost pmcferrin.homedns.org:80
>> [[default virtual hosts definitons]]
>> <VirtualHost    pmcferrin.homedns.org:80>
>>       DocumentRoot /usr/local/apache/htdocs
>>       ServerName mcferrin.homedns.org
>>       ErrorLog /usr/local/apache/logs/error_log
>>       CustomLog logs/access_log common
>> </VirtualHost>
>>
>> <VirtualHost genealogy.homedns.org:80>
>>       VirtualDocumentRoot /e/genealogy
>>       ##DocumentRoot /e/genealogy
>>       ServerName genealogy.homedns.org
>>       ErrorLog /usr/local/apache/logs/error_log
>>       CustomLog logs/access_log common
>> </VirtualHost>
>>
>> I have TWO domain names pointing to the same host machine.  I ran  
>> apachectl configtest whth no errors.  I tried using IP address for the 
>> container; no go.  It seems to be setting the first VirtualHost only.
>>
>> My Dynamic DNS has both domains with the same IP.  I'm trying to get 
>> BOTH domains to respond with their different web page,  I want to avoid 
>> using IP address to minimize maintenance
>>
>> What gives?  Not find anything useful in the FAQ's.
>>
>> You can view my COMPLETE httpd.conf file at:  
>> http://pmcferrin.homedns.org/httpd.conf
>>
> 
> You want to define your vhosts like so:
> 
> NameVirtualHost *:80
> <VirtualHost *:80>
>   ServerName myvhost
>   ....
> </VirtualHost>
> 
> <VirtualHost *:80>
>   ServerName myothervhost
>   ....
> </VirtualHost>
> 
> If apache cannot determine which vhost to use, it uses the first defined
> vhost in your httpd.conf
> 
One more thing : you may want to give your virtual hosts each their own 
logfiles, like :
 > NameVirtualHost *:80
 > <VirtualHost *:80>
 >   ServerName myvhost
 >>       ErrorLog /usr/local/apache/logs/myvhost_error_log
 >>       CustomLog logs/myvhost_access_log common
 >   ....
 > </VirtualHost>
 >
 > <VirtualHost *:80>
 >   ServerName myothervhost
 >   ....
 >>       ErrorLog /usr/local/apache/logs/myothervhost_error_log
 >>       CustomLog logs/myothervhost_access_log common
 > </VirtualHost>
It will make it easier to see what happens in which vhost.


---------------------------------------------------------------------
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


Re: [users@httpd] debugging my Virtual Hosts

Posted by Tom Evans <te...@googlemail.com>.
On Sun, 2008-11-16 at 02:33 -0500, Paul McFerrin wrote:
> My Virtual Hosts are not working..
> 
> Here is the scoop.  Running Apache 1.3 and have the following 
> configuration file:
>   NameVirtualHost pmcferrin.homedns.org:80
> [[default virtual hosts definitons]]
> <VirtualHost    pmcferrin.homedns.org:80>
>       DocumentRoot /usr/local/apache/htdocs
>       ServerName mcferrin.homedns.org
>       ErrorLog /usr/local/apache/logs/error_log
>       CustomLog logs/access_log common
> </VirtualHost>
> 
> <VirtualHost genealogy.homedns.org:80>
>       VirtualDocumentRoot /e/genealogy
>       ##DocumentRoot /e/genealogy
>       ServerName genealogy.homedns.org
>       ErrorLog /usr/local/apache/logs/error_log
>       CustomLog logs/access_log common
> </VirtualHost>
> 
> I have TWO domain names pointing to the same host machine.  I ran  
> apachectl configtest whth no errors.  I tried using IP address for the 
> container; no go.  It seems to be setting the first VirtualHost only.
> 
> My Dynamic DNS has both domains with the same IP.  I'm trying to get 
> BOTH domains to respond with their different web page,  I want to avoid 
> using IP address to minimize maintenance
> 
> What gives?  Not find anything useful in the FAQ's.
> 
> You can view my COMPLETE httpd.conf file at:  
> http://pmcferrin.homedns.org/httpd.conf
> 

You want to define your vhosts like so:

NameVirtualHost *:80
<VirtualHost *:80>
  ServerName myvhost
  ....
</VirtualHost>

<VirtualHost *:80>
  ServerName myothervhost
  ....
</VirtualHost>

If apache cannot determine which vhost to use, it uses the first defined
vhost in your httpd.conf


---------------------------------------------------------------------
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