Setting Up VirtualHost in Apache (Debian-based OS)
1. Setting Up VirtualHost in Apache
(Debian-based OS)
Gerald Z. Villorente
Kite Systems Inc.
2. Installation
$ sudo apt-get install apache2
- the APT will automatically select one of the four engines
● apache2-mpm-prefork
● apache2-mpm-worker
● apache2-mpm-event (not recommended)
● apache2-mpm-itk (not recommended)
5. Adding ServerName in Hosts file
$ sudo (gedit | geany | vim) /etc/hosts
127.0.0.1 dev.myproject.com
# Where “dev.myproject.com” is the value of ServeName in the vhost file you created
or
192.168.100.15 dev.myproject.com
6. Activating Vhost config file
$ sudo a2ensite myproject
# Where “myproject” is the filename of the file you created in /etc/apaches/sites-available
$ sudo /etc/init.d/apache2 restart
Lets test it! (While in terminal)
$ firefox http://dev.myproject.com
or
$ chrome http://dev.myproject.com