Go to /etc/apache2/apache2.conf
Open it with your favorite text editor and at the very end add:
NameVirtualHost 192.168.1.102
DocumentRoot /var/www/website1
ServerName website1.com
ServerAlias www.website1.com
DocumentRoot /var/www/website2
ServerName website2.com
ServerAlias www.website2.com
Ok now lets analyze what we just did.
DocumentRoot /var/www/ben/website1 This is where I keep the material for my first website.
ServerName website1.com
ServerAlias www.website1.com
This will allow website1.com AND www.website1.com to work on the webserver, otherwise website1.com might return a site not found (401) error.
Close my virtual site.
You can have as many of these as you like as long as you don't exceed RAM, bandwidth, etc...
No comments:
Post a Comment