how to configure xampp to accommodate more websites

Problems with the Windows version of XAMPP, questions, comments, and anything related.

how to configure xampp to accommodate more websites

Postby yatong » 26. December 2011 13:32

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 ?

Posts: 1
Joined: 26. December 2011 13:13
Operating System: windows 7 ultimate

Re: how to configure xampp to accommodate more websites

Postby JonB » 26. December 2011 16:37

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.

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.

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
User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 79 guests