What is c:\wamp\vhosts directory for?
Posted by: Beefcake (---.hlrn.qwest.net)
Date: January 18, 2014 08:19AM

I am used to setting up virtual hosts in httpd.conf. The following line in that file indicates to me that I can also set up virtual hosts in extra/httpd-vhosts.conf:

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

Further down in the file, there is this:

IncludeOptional "c:/wamp/vhosts/*"

Okay, so there's three places to specify virtual hosts. Confusing, but fine. But the c:\wamp\vhosts directory is empty except for one file, readme.txt. Also, readme.txt is blank.

So, what is this directory for, and how do I use it? Or should I stick to using httpd.conf?

Options: ReplyQuote
Re: What is c:\wamp\vhosts directory for?
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: January 19, 2014 02:18PM

Hi Beefcake,

In WAMPServer versions before 2.4 ( i.e. < 2.4 ) vhosts were supposed to be setup in the conf/extra/httpd-vhosts.conf
and the comment removed from this line
#Include conf/extra/httpd-vhosts.conf
in httpd.conf

Also in <2.4 versions you could use the wamp\vhost folder to generate links to your vhosts on the WAMP Homepage similiar to the links generated when you placed folders inside the \wamp\www\ folder.
You just had to create a file in the vhosts folder like myvhost1.conf and the homepage would turn that into a link on the homepage.


As of WAMPServer 2.4 the wamp\hosts folder has been re-purposed.

You can now place you vhosts definitions in seperate files within this folder and apache will read them all.
So for example

wamp\vhosts\site1
wamp\vhosts\site2
wamp\vhosts\site3

where each file contains a specific vhost domain definition.
This way it makes it easier to add/remove specific definitions by just copying vhost definitions in and out of this folder.

This is more like how UNIX/LINUX systems do it, and in fact makes it nice and easy to activate and deactivate test sites with just a copy into this folder or delete from this folder.

Hope this helps

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: What is c:\wamp\vhosts directory for?
Posted by: mmasmoudi (197.0.145.---)
Date: December 28, 2014 06:10PM

Hello,
i wanna know how i can add a new domain definition on this vhosts directory ? how i should proceed.
Thnks in advance

Options: ReplyQuote
Re: What is c:\wamp\vhosts directory for?
Posted by: Otomatic (Moderator)
Date: December 28, 2014 06:15PM

Hi,

Use VirtualHost

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.