In this article, I would like to give a tutorial to Add New Virtual Host XAMPP or LAMPP on Linux.
In this case, I assume you already install xampp on your linux. Then lets start to Add New Virtual Host XAMPP or LAMPP on Linux immediately.
- Open your terminal and log as SU
- Type in your terminal "gedit /opt/lampp/etc/httpd.conf" to open httpd.conf in your text editor
- delete "#" in front of "Include etc/extra/httpd-vhosts.conf" line
- add lines :
#some path of your new host
#the name of your new host
#alias of your new host
- add line :
#127.0.0.1 Your new host name
Now you have two virtual hosts in your computer. You can access it through url http://localhost and http://localhost2. In this case, the two virtual host has its own document root. The default http://localhost has document root in /opt/lampp/htdocs, while the http://localhost2 has document root in /home/[YourCompName]/localhost2.
Have a nice try on Add New Virtual Host XAMPP or LAMPP on Linux...