Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple vhosts - one out of many does not work 1

Status
Not open for further replies.

back2db

Technical User
Jun 17, 2005
23
0
0
CZ
Apache/2.2.8

i have several vhosts set up for different domains. one of them resolves to the default, no matter what I try and yet, the directives are an exact clone of directives which work.

the response code is 302. here is a listing of two, first is working, second is not ...

,
,
,

<VirtualHost slavekhanzlik.net:80>
DocumentRoot /ServerName <Directory "/allow from all
Options +Indexes
</Directory>
ErrorLog "logs/slavek-error_log"
CustomLog "logs/slavek-access_log" common
</VirtualHost>

<VirtualHost habr.ca:80>
DocumentRoot /ServerName <Directory "/allow from all
</Directory>
ErrorLog "logs/habr-error_log"
CustomLog "logs/habr-access_log" common
</VirtualHost>

are there any tests I could try to narrow the problem?
 
sorry, but that makes no difference. i deleted ity to try without it.
 
30Does it appear in habr's logs? What is the log line? You say 2 things, it goes to the default AND it 302s.
 
Thank you for responding. both my statements are true.

It goes to the default for the ip to which it resolves. when I try with curl i get the 302 redirection...

however, I figured it out ... when apache configures vhosts, it accesses the IP address to which the servename resolves. My nameserver resolves to the old address, other nameservers have been already refreshed and resolve to the new address. apache set up the vhost for the old address. that is all.
 
Make sure you have the following:

NameVirtualHost *:80 This tells apache to use name based addressing.

<VirtualHost *:80> You don't need the hostname here.

ServerName domain.com
ServerAlias These are what apache uses to resolve the requested domain.
 
Thank you for your response.

actually, my vhost design is quite complex - it virtualizes also access to tomcat ssl secured sites and the format I use is necessary.

My mistake was not checking the nameserver my server is using.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top