/ Published in: Apache
First of all this refers to a clean Ubuntu 10.04 install with the LAMP and OpenSSH packages installed, but can probably be applied in most cases.
Duplicate the file /etc/apaches/sites-available/default, and name it subdomains.
Edit the new file to look like this one.
Enable the vhost_alias module, "a2enmod vhost_alias".
Activate the new virtual host, "a2ensite subdomains".
Reload apache, "/etc/init.d/apache2 reload".
In order to change the configuration to your needs, [you can go here](
http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html)
Duplicate the file /etc/apaches/sites-available/default, and name it subdomains.
Edit the new file to look like this one.
Enable the vhost_alias module, "a2enmod vhost_alias".
Activate the new virtual host, "a2ensite subdomains".
Reload apache, "/etc/init.d/apache2 reload".
In order to change the configuration to your needs, [you can go here](
http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html)