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. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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> |