Apache2 Virtual Hosting in Ubuntu Linux

June 24, 2006

Recently, I found that Apache2 Virtual Hosting is really easy in Linux. I used Ubuntu Hoary distribution, which can be termed as updated and polished avtar of Debian. The steps for enabling Virtualhost for Apache2 is as follows –

1. Install Apache-2
        #apt-get install apache2

2. Add site specific configuration file in /etc/apache2/sites-available
        #vi /etc/apache2/sites-available/example.org

ServerAdmin webmaster@example.org
         DocumentRoot /home/example/www/example.org
         ServerName example.org:80
         CustomLog /home/example/www/log/apache2-access.log combined
         ErrorLog /home/example/www/log/apache2-error.log

3. Enable the site
        #a2ensite example.org

4. Restart Apache
        #/etc/init.d/apache2 restart

Once you are done, point your browser to http://example.org

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: