Apache Server configuration support - Several websites and virtual host-localhost

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > June 2007 > Several websites and virtual host-localhost





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Several websites and virtual host-localhost
lbakker1001@zonnet.nl

2007-06-19, 7:24 am

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

shimmyshack

2007-06-19, 7:24 am

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
<VirtualHost *:80>
DocumentRoot c:/websites/website-unknown
</VirtualHost>
<VirtualHost *:80>
ServerName www.hostA.com
DocumentRoot c:/websites/website-1
</VirtualHost>
<VirtualHost *:80>
ServerName www.hostB.com
DocumentRoot c:/websites/website-2
</VirtualHost>

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:

<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/websites/path/to/document/root/i/already/use
</VirtualHost>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com