httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suomi <apa...@ayni.com>
Subject Re: [users@httpd] VirtualHost (frustrated out of my mind)
Date Wed, 11 Aug 2004 06:54:59 GMT
Hi Scott
I put aside a note. why apache behaves like this you may ask the 
programmers...

suomi

(quote)
you have two basic config files

httpd.conf
ssl.conf

you have one or more virtual server config files.

accweb.example.com
phpweb.example.com
accweb.example.com\:443
phpweb.example.com\:443

in the httpd.conf you have the following Listen directives

Listen 192.168.97.126:80
Listen 127.0.0.1:80

in the ssl.conf you have the following Listen directives

Listen 192.168.97.126:443
Listen 127.0.0.1:443

Then YOU MUST have the following NameVirtualHost directive in the 
httpd.conf

NameVirtualHost 192.168.97.126:80

and in the ssl.conf

NameVirtualHost 192.168.97.126:443


and YOU CANNOT have something like

NameVirtualHost *:80
NameVirtualHost *:443

respectively.

Otherwise apache will just grab what it thinks is the primary virtual 
host and all others are disregarded.
In that example, if you had the wrong NameVirtualHost directive, it 
would probably always go to

phpweb.example.com

and never to

accweb.example.com

(unquote)

Scott Carper wrote:
> This config worked for me also, when the example config in the apache2
> docs ("NameVirtualHost *:80" with "VirtualHost *:80" entires beneath)
> did not.
> Can anyone explain to me WHY this works?  
> I'm glad it works, but I'd REALLY like to know why it works.
> 
> Thanks.
> 
> Scott
> 
> -----Original Message-----
> From: Avery [mailto:schrock@dayzed.com] 
> Sent: Thursday, July 08, 2004 10:29 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] VirtualHost (frustrated out of my mind)
> 
> 
> aman,
> 
> I finally got it to work thanks for your help here is what I did.
> ------------------------------------------
> I needed to have these 2 entrys
> NameVirtualHost 192.168.50.9:80   (this entry goes just above all of the
> virtual domains)
> ServerName domain1.com:80   (this is my main site domain)
> I then needed to duplicated my main site domain in the virtualdomains as
> the first site with the machines IP address as shown below. The second
> virtual host must have a hostname so in otherwords
> ---------------------------------------------------------
> <VirtualHost 192.168.1.1:80>
>     ServerAdmin webmaster@domain1.com
>     DocumentRoot /var/www/html/domain1.com
>     ServerName www.domain1.com
> #    ErrorLog logs/dummy-host.example.com-error_log
> #    CustomLog logs/dummy-host.example.com-access_log common
> </VirtualHost>
> 
> 
> <VirtualHost domain2.com:80>
>     ServerAdmin webmaster@domain2.com
>     DocumentRoot /var/www/html/domain2.com
>     ServerName www.domain2.com
> #    ErrorLog logs/dummy-host.example.com-error_log
> #    CustomLog logs/dummy-host.example.com-access_log common
> </VirtualHost>
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> ---------------------------------------------------------------------
> 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
> 

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