Apache Virtual Hosting

This is extremely easy to do.  This was done on Ubuntu 8.04.  Replace “SERVER_IP” with the IP address of your  server.

Edit /etc/apache2/apache2.conf and add the following:

NameVirtualHost SERVER_IP:80

Create a new file “subdomain” in /etc/apache2/sites-available with the content:

<VirtualHost SERVER_IP:80> *

ServerName subdomain.yourdomain.com
DocumentRoot /var/www/subdomain

<Directory “/var/www/subdomain”> **
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

Then run:
a2ensite subdomain
/etc/init.d/apache2 restart

Are you a Git user? Let me help you make project management with Git simple. Checkout Gitpilot.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.