XAMPP Virtual Hosts in Ubuntu
Submitted by khairie on Sat, 08/15/2009 - 16:16
Related Terms :
Quick HOWTO to enable Virtual Hosts with XAMPP on Ubuntu (or any *nix distribution).
shell> sudo gedit /opt/lampp/etc/httpd.conf
Uncomment the line below (it should be towards the end of the file):
Include etc/extra/httpd-vhosts.conf
Save & Close the httpd.conf file.
shell> sudo gedit /opt/lampp/etc/extra/httpd-vhosts.conf
Make sure the line below is uncommented:
NameVirtualHost *:80
Add/Edit the following piece of code:
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /path/to/vhosts/folder/site.local
ServerName site.local
ErrorLog /path/to/vhosts/logs/site.local-error_log
CustomLog /path/to/vhosts/logs/site.local-access_log common
</VirtualHost>Save & Close the httpd-vhosts.conf file.
shell> sudo gedit /etc/hosts
Add the following line to the hosts file:
127.0.0.1 site.local
Save & Close the hosts file.
shell> sudo /opt/lampp/lampp restart
Open up web browser, and go to http://site.local to see if it's working.
Cheers.
References:
http://www.dimitritaghon.be/2008/07/xampp-and-virtual-hosts/
http://mintarticles.com/read/articles_about_software/multiple_virtual_ho...
Detailed Guide
Here is a detailed guide if anyone needs help setting this up in a Windows environment...
http://renownedmedia.com/blog/setting-up-vhosts-using-xampp-or-apache-in...