Virtual host config

Virtual hosts in Apache are the same thing as host headers in Windows IIS, allowing the admin to have multiple websites on one webserver with one IP-address.

1. Create a folder for the new virtual host.
# sudo mkdir /var/www/

2. Change owner on the virtual host folder. www-data is the same as IUSR under Windows.
# sudo chown -R www-data /var/www/

3. Edit the Apache configuration file.
# sudo vi /etc/apache2/sites-enabled/000-defualt

4. Add the following text at the end of the file.
<VirtualHost *>
DocumentRoot /var/www/

5. Restart Apache to use the new configuration.
# sudo /etc/init.d/apache2 restart

, ,

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.