Server Fault is a question and answer site for system and network administrators. 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 know the following is impossible, but there should be a workaround.

As I'm now having problems with my very-clickable application,

(visits) (page views) (hits)    (data)

enter image description here

(~100 000 php page views every day) I decided to try HipHop-PHP, an opensource application from Facebook.

It should be able to transfer my application to c++ code and compile it. It should act as a webserver, like apache. The biggest problem is that I do not need/want a compiled application on the other websites. Why is it a problem? It runs on port 80, as my apache2 does and it is just not possible.

Is there a way to run 2 webservers on one virtual server?

share|improve this question
up vote 7 down vote accepted

Another option would be to have HPHP listen on a high port and have Apache reverse-proxy requests for the domain using HPHP to that high port.

share|improve this answer
So I'd have to use apache2 as the gate between apache and HPHP? – genesis Oct 10 '11 at 20:50
Indeed - you'd set up a <VirtualHost> for the site that needs to be fed to HPHP, set ProxyPass / (set to whichever non-80 port you use), and set the appropriate ServerName. – Shane Madden Oct 10 '11 at 20:53
You can have virtual directories defined in your apache configuration which would be simply internally reverse-proxied to a server of your choice. See the docs for more information. – the-wabbit Oct 10 '11 at 20:54
@ShaneMadden: Okay, so if I understand correctly, user would see no difference but user which access on port 80 uses ProxyPass so all requests from port 80 are directed to 8080? – genesis Oct 10 '11 at 20:55
@genesis-φ Not all requests to port 80, just those matching the ServerName in the <VirtualHost> that's configured to do the proxying. – Shane Madden Oct 10 '11 at 20:57

You can create multiple virtual domains, but if you're thinking of having more than one web server on one IP running on port 80, no. You'd have to have multiple IP's on the virtual server.

If you can get multiple IP's, then yes, you'd bind your web servers to the IP address assigned on port 80 and you can do that on one virtual machine.

share|improve this answer
And is it possible to run first one on 8080 and the others on 80 ? Will user's browser know where to "ask" ? – genesis Oct 10 '11 at 20:47
@genesis-φ Port numbers != 80 will need to be included in the URL, unless you're employing some kind of URL rewriting, with .htaccess for example. Or see Shane's answer on reverse proxying. – squillman Oct 10 '11 at 20:49
You can do reverse proxying or putting them on other ports, but if you're primarily trying to fit multiple sites on the one server, personally I'd try to use either virtual domains or, if you have multiple IP's available, it's easier to manage if you use multiple IP's. Otherwise like Squillman said, yes, you can put them on other ports, but you must direct them as or something like that. – Bart Silverstrim Oct 10 '11 at 20:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.