Apache Virtual Host Issue

Posted by Nik on Server Fault See other posts from Server Fault or by Nik
Published on 2010-05-29T23:31:52Z Indexed on 2010/05/29 23:33 UTC
Read the original article Hit count: 189

I think I hate Apache now, but on with the issue. It might be a configuration error on my end or just my inability to see what's right in front of me, but I'm trying to configure a sub-domain in Apache and no matter what, it always redirects the sub-domain to the web root of the main domain. My configuration is posted below (and yes, the domain name information was purposefully modified):

<VirtualHost *>
DocumentRoot /var/www/root/
ServerName example.com
<Directory /var/www/root/>
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<Directory /usr/share/squirrelmail>
Options Indexes FollowSymLinks
<IfModule mod_php5.c>
php_flag register_globals off
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>

# access to configtest is limited by default to prevent information leak
<Files configtest.php>
order deny,allow
deny from all
allow from 127.0.0.1
</Files>
</Directory>

# users will prefer a simple URL like http://webmail.example.com
<VirtualHost *>
DocumentRoot /usr/share/squirrelmail/
ServerName squirrelmail.example.com
</VirtualHost>

© Server Fault or respective owner

Related posts about apache2

Related posts about configuration