Several websites and virtual host-localhost
am 19.06.2007 09:03:39 von lbakker1001
Hello, I've installed XAMPP and Apache. And I've made c:\websites
\website-1 and c:\websites\website-2. In both maps I want to make some
html-docs, and test them local. What do I have to put in httpd.conf?
Virtual host I've read, but how? What will be the url of c:\websites
\website-1 for example? Please help.
Thanks in advance,
Leo, absolutely newby
Re: Several websites and virtual host-localhost
am 19.06.2007 11:04:48 von shimmyshack
On Jun 19, 8:03 am, lbakker1...@zonnet.nl wrote:
> Hello, I've installed XAMPP and Apache. And I've made c:\websites
> \website-1 and c:\websites\website-2. In both maps I want to make some
> html-docs, and test them local. What do I have to put in httpd.conf?
> Virtual host I've read, but how? What will be the url of c:\websites
> \website-1 for example? Please help.
>
> Thanks in advance,
> Leo, absolutely newby
some instructions are to be found in the httpd-vhosts.conf file of
xampp.
this is all testing locally right?
adjust the hosts file on your machine, adding
127.0.0.1 www.hostA.com
127.0.0.1 www.hostB.com
each local machine that you wish to be able to see these servers must
have the lines added to the hosts file
then in httpd-vhosts.conf have
the star represents all ips apache is listening on
NameVirtualHost *:80
DocumentRoot c:/websites/website-unknown
ServerName www.hostA.com
DocumentRoot c:/websites/website-1
ServerName www.hostB.com
DocumentRoot c:/websites/website-2
put index.htm in each document root, and fill each site with contents
the website-unkown is so that when someone tried to retrieve a website
that is not on your system, they get directed to the first vhost, and
see a nice index.htm in the website-unknown section saying "sorry
couldnt find it!"
If you already have a server running that will not be accessible when
you have vhosts so you will need to add that at the end:
ServerName localhost
DocumentRoot c:/websites/path/to/document/root/i/already/use