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.
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:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
If the vhosts configuration files is enabled then navigate to and open it.
You then create two virtual hosts like this:
<VirtualHost *:80>
DocumentRoot /var/www/abc
ServerName www.abc.com
ServerAlias abc.com
<Directory "/var/www/abc">
allow from all
Options -Indexes
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/def
ServerName www.def.com
ServerAlias def.com
<Directory "/var/www/def">
allow from all
Options -Indexes
</Directory>
</VirtualHost>
Then you need to restart Wamp.
Finally you need to alter your host file windows/system32/etc/hosts
127.0.0.1 abc.com
127.0.0.1 def.com
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
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).