Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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 8 '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 machinename/site1 or machinename/site2 –  lysdexic Nov 9 '10 at 6: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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.