PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 21, 2022

[FIXED] What is the meaning of the "WAMP/vhosts" folder in Wamp 2.5?

 September 21, 2022     vhosts, virtualhost, wamp, wampserver     No comments   

Issue

I was using WAMP 2.0 for a long long time, but today I decided upgrate it to the new release version (2.5).

I know that the "v-host" are te virtual hosts for Apache, but, on the older version of WAMP, we had to configure the VirtualHosts on /bin/apache/xxxx/config/extra/vhost.config (or something like that).

BUT, in the new WAMP version, there is a new FOLDER (not file) on (in my case) D:/WAMP/vhosts

So, what is this folder? Can I configure my virtualhosts here?

I'm using Windows.


Solution

The \wamp\vhost folder appeared in WAMPServer 2.3 and was intended to make WAMPServer work/look a little more like a UNIX install of Apache.

If you look in the httpd.conf file at the bottom you will see a new IncludeOptional parameter. The IncludeOptional command was new in Apache 2.3.6 I believe.

#IncludeOptional "d:/wamp/vhosts/*"

You can uncomment that line and it will read any number of files from the \wamp\vhost folder at Apache startup. In this form it will actually read ALL the files from the \wamp\vhosts folder so be careful what you put in there. It would probably be better to change that line to

#IncludeOptional "d:/wamp/vhosts/*.conf"

and then it would only read .conf files.

So you could keep another folder with all your vhosts def files in and only copy the ones you actually wanted to use today into the \wamp\vhosts folder. If you understand how to use SYMLINKS on Windows ( actually available since XP, but almost nobody actually knew about them ) you could even create SYMLINKS in this folder from actual files that existed in lets say \wamp\all_my_vhosts again so you could easily turn vhosts on and off as you wanted to use them.

This way you do not need to uncomment the #Include conf/extra/httpd-vhosts.conf statement and have a /extra/httpd-vhosts.conf file containing all your Virtual Host definitions in one big blob.

There is not reason I know of why you cannot use the original /extra/httpd-vhosts.conf method for all your ALWAYS ON vhosts and including using the /wamp/vhosts/* for your just playing or current projects.

I actually rather liked this mechanism for its easy flexibility.

I have a feeling that it has not actually gained much traction and may or may not be kept as part of the standard release of WAMPServer. However, its legal Apache, so if you like the idea go ahead and use it. You may just need to remember that you are using it and manually move it to the next release of WAMPServer that you install, if it actually gets removed.



Answered By - RiggsFolly
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing