Setting Up VirtualHost in Apache (Debian-based OS)

920 views

Published on

A simple guide in creating a virtual host in debian-based systems.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
920
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Setting Up VirtualHost in Apache (Debian-based OS)

  1. 1. Setting Up VirtualHost in Apache(Debian-based OS)Gerald Z. VillorenteKite Systems Inc.
  2. 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)
  3. 3. Enabling needed modules$ sudo a2enmod rewrite$ sudo a2enmod vhost_alias
  4. 4. Creating Vhost$ sudo (gedit | geany | vim) /etc/apache2/sites-available/myproject<VirtualHost *:80>ServerName dev.myproject.comDocumentRoot /home/gerald/www/myproject</VirtualHost>
  5. 5. Adding ServerName in Hosts file$ sudo (gedit | geany | vim) /etc/hosts127.0.0.1 dev.myproject.com# Where “dev.myproject.com” is the value of ServeName in the vhost file you createdor192.168.100.15 dev.myproject.com
  6. 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 restartLets test it! (While in terminal)$ firefox http://dev.myproject.comor$ chrome http://dev.myproject.com
  7. 7. Questions?

×