Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two apache servers running on windows 7. The one that comes bundled with XAMPP(running on port 80) and the one that comes with Zend(running on port 81). I would like to setup virtual hosts on the port 81. How would I go about this ? This is what I have put in the httpd-vhosts. In my

<VirtualHost *:81>
DocumentRoot "C:\Program Files (x86)\Zend\Apache2\htdocs"
ServerName localhost

<VirtualHost *:81>
DocumentRoot "C:/Program Files (x86)/Zend/Apache2/htdocs/youje"
ServerName youjenzi.localhost

For the hosts file I have added the following line youjenzi.localhost

The above entries above are redirecting me to XAMPP on port 80.

share|improve this question

migrated from Mar 28 '13 at 4:04

This question came from our site for system and network administrators.

Your virtualhost config is not correct. You do not put the servername in the <Virtualhost> tag. All VirtualHost blocks for hosts on the same IP/port combination should start with the same tag. In this case <VirtualHost *:81> – Krist van Besien Mar 27 '13 at 14:47
Thx Krist. Have made the changes to the vhost config and restarted Apache.It worked – user1180807 Mar 27 '13 at 15:06

HTTP and HTTPS only work without port numbers on port 80 and port 443 respectively. If you have apache running on a non standard port, you will need to add the port to the address you type into your browser, ie; http://youjenzi.localhost:81.

DNS will not send you to a specific port, proxies and firewalls (and other things) can do so.

share|improve this answer
Thanks NickW. Am getting the message "The requested URL / was not found on this server." – user1180807 Mar 27 '13 at 15:01

On the XAMPP server listening at tcp:80, place this:

ProxyRequests On
ProxyPreserveHost On
ProxyPass / http://localhost:81
ProxyPassReverse / http://localhost:81

Then you don't need to specify any ports in your address bar to explicitly end up reaching the Zend bundled apache.

That means you'll have a Reverse Proxy configuration on XAMPP (Not that you've had asked for, but 2 cents and another concept learnd)

share|improve this answer

I'm not sure how you'd configure apache, but you can add another IP address to your computer (or add an alias for your local host to your hosts file for the other application) and have both virtual servers run on the same port. I'm guessing it would look like:

<VirtualHost *:80>
DocumentRoot "C:/Program Files (x86)/Zend/Apache2/htdocs/youje"
ServerName youjenzi2.localhost

and the host file would look like: youjenzi.localhost youjenzi2.localhost
share|improve this answer
Thx Snowburnt. Have resolved the issue. The problem was with my vhosts block. Have edited the code to reflect what correct code. How do I show that the problem is solved – user1180807 Mar 27 '13 at 15:10
If they fixed it, add an answer yourself with what you did, then select it as the correct answer. – NickW Mar 27 '13 at 15:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .