Multiple Sites
Posted by: Antonimo (---.tbcn.telia.com)
Date: June 02, 2009 03:16PM

Hi,

I am new to WampServer and I haven't found any documentation. Perhaps somebody would be so kind as to help me out here.

I have edited my HOSTS file to point a particular domain to 127.0.0.1 and when I enter the domain into my browser, I successfully reach the files that are within Wamp's www directory.

I would like to emulate several websites - Is it possible to have more than one website?

Options: ReplyQuote
Re: Multiple Sites
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: June 02, 2009 03:22PM

yes using the vhosts in apache.

enable it in the httpd.conf about 10 lines from bottom

#include extra/vhosts.conf

to

include extra/vhosts.conf




then open vhosts.conf in the extra folder and add a paragraph as in the exmaple for each site.



Im Currently in the process of making a small application to do this.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Multiple Sites
Posted by: yfastud (Moderator)
Date: June 02, 2009 03:26PM


Options: ReplyQuote
Re: Multiple Sites
Posted by: Antonimo (---.tbcn.telia.com)
Date: June 02, 2009 04:18PM

Many thanks for your replies.

I attempted to follow the instructions for setting up the virtual hosts and I have done something wrong. When I try to go to the websites, they cannot be found, but when I comment out the line - Include conf/extra/httpd-vhosts.conf - in httpd-conf and re-start the services I am able to reach the WampServer configuration page.

This is what I have in httpd-vhosts.conf:

<VirtualHost *:80>
ServerName www.domainone.co.uk
ServerAlias domainone.co.uk domainone
DocumentRoot C:/wamp/www/domainone
ErrorLog C:/wamp/www/domainone/logs/error.log
CustomLog C:/wamp/www/domainone/logs/access.log common
</VirtualHost>


<VirtualHost *:80>
ServerName www.domaintwo.co.uk
ServerAlias domaintwo.co.uk domaintwo
DocumentRoot C:/wamp/www/domaintwo
ErrorLog C:/wamp/www/domaintwo/logs/error.log
CustomLog C:/wamp/www/domaintwo/logs/access.log common
</VirtualHost>

domainone and domaintwo folders have been created within www, as well as the logs directories.

What have I done wrong?

Options: ReplyQuote
Re: Multiple Sites
Posted by: Antonimo (---.tbcn.telia.com)
Date: June 02, 2009 04:25PM

OK - This did work:

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/domainone"
ServerName domainone.co.uk.localhost
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

Options: ReplyQuote
Re: Multiple Sites
Posted by: Antonimo (---.tbcn.telia.com)
Date: June 02, 2009 04:29PM

but the second entry did not:

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/domaintwo"
ServerName domaintwo.co.uk.localhost
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

I am only connecting to the domain that is listed first.

Options: ReplyQuote
Re: Multiple Sites
Posted by: Antonimo (---.tbcn.telia.com)
Date: June 02, 2009 04:44PM

I think I have worked this out.


<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/domainone"
ServerName www.domainone.co.uk
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/domaintwo"
ServerName www.domaintwo.co.uk
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/domaintwo"
ServerName domaintwo.co.uk
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

Thanks for pointing me in the right direction from the start

Options: ReplyQuote


Sorry, only registered users may post in this forum.