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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NameVirtualHost not working 2

Status
Not open for further replies.

arlequin

Programmer
Sep 21, 1999
232
UY
Hi, there!

When I type
C:\apache\bin>apache -S

I have this:
-------------%<-------------------------------------------
[Fri Dec 28 17:35:41 2001] [warn] Registry does not contain key SOFTWARE\Apache
Group\Apache\1.3.14

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server
(/apache/conf/httpd.conf:973)

port 80 namevhost
(/apache/conf/httpd.conf:973)

port 80 namevhost
(/apache/conf/httpd.conf:987)
-------------%<-------------------------------------------

Every thing seems to look all right, but when I point my browser to the server shows me the HTML index page from /apache/htdocs/domainone.

I copy the NameVirtualHost section of my httpd.conf
I don't know what's wrong...
Do I have to establish another port for ?

Thanks!!

-------------%<-------------------------------------------
NameVirtualHost *

<VirtualHost *>
ServerName DocumentRoot &quot;/apache/htdocs/domainone&quot;
ServerAlias domainone.net *.domainone.net

<Directory &quot;/apache/htdocs/domainone&quot;>
Options FollowSymLinks MultiViews ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *>
ServerName DocumentRoot &quot;/apache/htdocs/domaintwo&quot;

<Directory &quot;/apache/htdocs/domaintwo&quot;>
Options FollowSymLinks MultiViews ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
-------------%<------------------------------------------- Arlequín
arlequin@montevideo.com.uy
 
Hi,

Try putting the following in your virtual host containers :

UseCanonicalName off

Also, are you using a http/1.1 compliant browser or netscape 4.7x ? Name based virtual hosting doesn't work with some old browsers. The default if the name can't be matched is to use the first VirtualHost container in the httpd.conf file.

Hope this helps
 
The only difference I see between my VirtualHost
config and yours is that my DocumentRoot directives
contain drive letters...

<VirtualHost *>
ServerName DocumentRoot &quot;D:/ApacheRoot/DomainOne&quot;
</VirtualHost>

Do you perhaps have a valid DocumentRoot with a drive-letter
elsewhere?
 
One more thing: the first VirtualHost gets used
for any request that doesn't match another.

Try flipping the order of your VirtualHost sections
and see whether the DomainTwo stuff is always used.

Perhaps you haven't specified the correct aliases?
Or perhaps the browser isn't offering the proper
hostname header field?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top