The walkthrough below explains how to add a new forums subdomain. Refer here for information on setting up virtual hosts with Apache.
Note: The steps below follow some Debian conventions.
1. Make sure you have the following at the very top of one of your apache config files (example: /etc/apache2/sites-available/deki)
NameVirtualHost *
2. Create a new virtual host configuration file under /etc/apache2/sites-available:
<VirtualHost *>
ServerName forums.myserver
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log common
DocumentRoot "/var/www/forum"
</VirtualHost>
3. create a symlink to sites-enabled
ln -s /etc/apache2/sites-available/<configFileName> /etc/apache2/sites-enabled/<configFileName>
Note: if you'd like the config files to be loaded in a specific order, create the symlink like this:
ln -s /etc/apache2/sites-available/forums /etc/apache2/sites-enabled/001-forums ln -s /etc/apache2/sites-available/blog /etc/apache2/sites-enabled/002-blog
In this case, the forums VirtualHost will be processed before the blog VirtualHost
4. reload apache
/etc/init.d/apache2 force-reload
5. add the DNS entry for forums.<servername>
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80