Forum Moderators: phranque

Message Too Old, No Replies

Multiple Apache instances

Do I really need them?

         

mastercho25

5:24 pm on Jan 9, 2008 (gmt 0)

10+ Year Member



I have multiple instances of Apache running so that I can maintain (start/stop/restart) the would-be virtual servers independently of each other. And so that if a backend app server fargs Apache up, it doesn't affect the other sites.

Is there a way to accomplish this with only one instance of Apache running?

gergoe

4:25 pm on Jan 10, 2008 (gmt 0)

10+ Year Member



If you are afraid that third party application or module affects other web applications (and this happened already), then no, there's no other way. With me it happened often on apache 1.3.x that the mod_jk module freeze apache (because the java vm running the tomcat consumed all the available memory (due to a memory leak in javac), and mod_jk did not handle this situation, it held the apache thread by waiting for a response). This I could solve by upgrading all involved 'parties' (Apache to 2.0.x, Tomcat to 6.x, mod_jk to the latest version), now it runs without a problem. In general, the way around similar problems is to use mod_proxy to forward requests from your front-end apache box to application server(s). For example if you have ten php websites, and two java applications running, you could run one Apache instance with the php websites, and make the two java ones forwarded by mod_proxy to the tomcat. If Tomcat fails, the rest of the websites keep running.

But for the restarting only, you don't need that, Apache can be restarted in such a manner that it does *not* stop responding to requests, check out the graceful restart in the Apache manual.

But if you describe your situation or problem more detailed, we can probably give you better hints (if this wasn't good enough :-)