Several websites and virtual host-localhost

This is a discussion on Several websites and virtual host-localhost within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello, I've installed XAMPP and Apache. And I've made c:\websites \website-1 and c:\websites\website-2. ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-19-2007
lbakker1001@zonnet.nl
 
Posts: n/a
Default Several websites and virtual host-localhost

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

  #2 (permalink)  
Old 06-19-2007
shimmyshack
 
Posts: n/a
Default Re: Several websites and virtual host-localhost

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>

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0