Apache2: not defined domains directing to the same virtual host
Posted
by
rafaame
on Server Fault
See other posts from Server Fault
or by rafaame
Published on 2011-06-22T23:51:01Z
Indexed on
2011/06/23
0:24 UTC
Read the original article
Hit count: 588
I have Apache2 configured in a debian box with virtual hosts. I have several domains pointing to the box's IP address. The domains whose virtual hosts are configured works perfectly. But if I type in the browser a domain that is pointing to the box but whose the virtual host is not configured, I get to a random virtual host of another domain in the box. Not a random, but one of the virtual hosts (always the same) but I dunno why it is it. The correct would be that the domains that are not configured as virtual hosts return a hostname error or something, right?
Does someone know how to fix the problem?
One of my virtual hosts config file:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName dl.domain.com
DocumentRoot /var/www/dl.domain.com/public_html/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/dl.domain.com/public_html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
My apache2.conf
http://www.speedyshare.com/files/29107024/apache2.conf
Thanks for the help
© Server Fault or respective owner