Sunday, December 16, 2012

Apache2: Set up Multiple Sites

An example. Modify /etc/apache2/httpd.conf file:
<virtualhost 127.0.0.1>
DocumentRoot /var/www/foo
ServerName www.foo.com
</VirtualHost>

<virtualhost 127.0.0.2>
DocumentRoot /var/www/bar
ServerName www.bar.com
</VirtualHost>
Restart Apache2 with updated configuration file.
sudo /etc/init.d/apache2 restart

No comments:

Post a Comment