0

Sorry for a question which has probably been brought up many times but I'm yet to find a example that can help me out.

At home I have a WAMP server with two folders in the /wamp/www/, so /wamp/www/site1 and /wamp/www/site2. I've found example of how to put them into the http.conf file but I'm not sure where they should go and the best ways of doing it.

I'm also, eventually, hoping that I can store the files in a directory outside of the www folder, for example on another disk.

Can anybody help or suggest a sample .conf file, or resources?

tombull89
  • 2,958
  • 8
  • 39
  • 52

1 Answers1

1

If you are using the wamp package from wampserver.com. Then in your httpd.conf file, you will need to make sure to uncomment the line that says:

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

make sure it looks like that.

Then go to the extra folder and edit the httpd-vhosts.conf file and add entries like this:

# Use name-based virtual hosting.
#
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "C:\wamp\www\site1"
ServerName site1.domain.com

</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:\wamp\www\site2"
ServerName site2.domain.com
</VirtualHost>

As for storing the www files in another directory, you will find that in the httpd.conf file:

DocumentRoot "c:/wamp/www/"

Hope that helps.

lysdexic
  • 366
  • 1
  • 4
  • 11
  • Thanks for the assistance, made some progress but still having difficulty. I've not had any luck in setting up the reidrection, as it were. I've got site1.webserver and site2.webserver but when I try to type it into the address bar of another computer on my LAN it says the page cannot be displayed. Am I missing something or does it not work like this? – tombull89 Nov 08 '10 at 20:58
  • I must have missed the part about this being on your home server. Are these sites going to be ran as subdomains for a .com? Then you will also need to create host A records on the dns server that contols your domain name. With virtual hosts you can either specify site1.domain.com and site2.domain.com to point to the same machine. You can also have domain1.com and domain2.com point to the same machine. If this is just a home server for development and testing, then you can reach the different sites on the lan with http://machinename/site1 or http://machinename/site2 – lysdexic Nov 09 '10 at 06:29
  • Just got back into looking at this after I lost the VM with the settings it. Worked a treat, thanks very much. – tombull89 Jan 25 '11 at 19:07