Host multiple low traffic websites on one Linux machine with one IP address is an low cost option for web hosting industry. It is very easy to do with Ubuntu 10.04, name Lucid, which is free from Ubuntu.com.
After you install Ubuntu 10.04 LAMP server on your computer, following these steps to setup name based virtual hosts. I use www.sample1.com and www.sample2.org for illustration below
- Create file sample1.com under “/etc/apache2/sites-available” with following lines
CustomLog /var/www/sample1.com/access.log combined
- Create file sample2.org under “/etc/apache2/sites-available” with following lines
CustomLog /var/www/sample2.org/access.log combined
- Create necessary directories sample1.com and sample2.org under /var/www/ and their sub-directories public_html and logs
- Enable both sites with
- Reload appach2 with /etc/init.d/apache2 reload
- If you put different index.html under /public_html of each website, you should see if when you visit the site.
To remove a site from Apache, use command: a2dissite sample1.com