Page 1 of 1

how to configure xampp to accommodate more websites

PostPosted: 26. December 2011 13:32
by yatong
Hello,
I would like to know how to configure (change ports) xampp to be able to accommodate more websites at the same time. My version of xampp is 1.7.7

I know the path as xampp/apache/confi/extra/httd-vhost

I can see the ports, apache:80,

How can I add more ports so that I can add more websites ?

Thanks

Re: how to configure xampp to accommodate more websites

PostPosted: 26. December 2011 16:37
by JonB
Ummm -

Although you 'could' add more ports, the purpose of Named Virtual Hosts is that you don't need additional ports to have multiple 'sites' powered by the same Apache server. They can all run over the same port 80. The rule of thumb for all webservers is that each 'host' must be unique in one aspect, IP address, Port number, or "Name". By using the NameVirtualHost directive, you are instructing Apache to read the 'Host HHTP Header' in preference to other methods to resolve which 'virtual host' to server in response to a request. If a matched host cannot be found in the configuration, the first virtual host will be served.

http://en.wikipedia.org/wiki/Virtual_hosting

The server can use the Host header field to determine which web site (or virtual host), as well as page, to show the user. The browser specifies the address by setting the Host HTTP header with the host specified by the user. The Host header is required in all HTTP/1.1 requests.


http://httpd.apache.org/docs/2.0/vhosts/examples.html

I hope this is helpful in clarifying how Virtual Hosts are used.

The default /xampp/apache/conf/extra/httpd-vhosts.conf has an example to follow. The first vhost <VirtualHost> will be a replacement for the original XAMPP server/host. You may then add additional vhosts as you require. You will probably also need 'hosts' file entries to enable DNS resolution for the new 'host names'.

Good Luck & Happy Holidays
8)