How to make a virtual host on apache and how to make virtual hosts for drupal multisite

Posted by: 
Dominique De Cooman

Go to windows host file (C:WindowsSystem32driversetchosts) and add :
Or on linux go to /etc/hosts and add name_of_your_host

Go to the httpd.conf file in appache and add :

NameVirtualHost *:80
<VirtualHost *:80>
  ServerName name_of_your_host
  DocumentRoot "C:wampwwwname_of_your_host"  //or whatever the path to your host is

If you want a drupal multisite for example

<VirtualHost *:80>
  ServerName site_1
  DocumentRoot "C:wampwwwmain_folder"
<VirtualHost *:80>
  ServerName site_2
  DocumentRoot "C:wampwwwmain_folder"

On linux restart appache with command: apachectl restart
On windows restart with the icon

Add new comment

Who are you?

By knowing who you are you will be directed to a page where we have displayed all our drupal services relevant to your professional identity.