One WAMP Two Sites: How?
I'm doing my experimenting in WAMP, which of course contains the site that I am working on in a folder called WWW.
If I want to start putting together a second site, how do I do that? Make another folder called WWW2 ? Will whatever functions that WAMP has to operate on the website files be able to find them in WWW2?
Or do I rename the first site's folder WWW1 and make a new folder for WWW? And progressively have a series of WWWx folders for a series of websites, from which I rename off the number to activate one or the other?
I could try it but I'm afraid of blowing up 500 pages that I've worked on for years.
Thank you kindly.
Originally Posted by Mr pseudonym
You typically create a new folder for each website under the www folder. Examples of two sites:
Above you have two site folders, abc and def. You could then structure folders inside abc and def:
You then need to ensure that Wamp is configured to use named hosts. If this is configured then you need to edit the httpd.cof to ensure that your virtualhosts include is active (is not commented out), like:
// Site abc.com
// Site def.com
If the vhosts configuration files is enabled then navigate to and open it.
# Virtual hosts
You then create two virtual hosts like this:
Then you need to restart Wamp.
allow from all
allow from all
Finally you need to alter your host file windows/system32/etc/hosts
If you need to find out more, there are hundreds (if not thousands) of tutorials on creating multiple site under WAMP or setting virtual hosts. Google is you friend :)
Here is a good link on how. http://cesaric.com/?p=255
I have mine setup like this http://christianvarga.com/blog/2012/05/vhosts-and-mamp/ very similar to what ServerStorm suggested.
I did not want to move all my websites into the www folder. So I create a virtual site like the above link shows. Basically you just point wamp at wherever your site currently lives. This way you don't have to move anything.
SS has just completed this with a very stubborn member in another thread but his information is spot on!
As for the directory, using any directory on your computer (test server) became the standard with Apache 2.x (it HAD to be in the htdocs folder in Apache 1.x ... if I remember correctly). Personally, I keep all my virtual hosts (and other web-related files) on a separate partition (so I can keep it separated from other nonsense - easier to backup all my websites that way).