Apache Virtual Host Issue
- by Nik
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>