# Apache + Tomcat

## Black666

Hi!

I installed apache and tomcat with emerge and so far they are both working.

The only problem: How do I "connect" them together?

Any links, hints would be appreciated..

----------

## mglauche

I think there is a small config file in the tomcat tree that you have to include into apache. (something about redirect on port 8007 or 8008)

----------

## Auka

Hi,

I had this running on a RedHat box in a productive environment for almost a year now but configuring Apche + Tomcat (mod_webapp) if you don't exactly know what to do can really be a pain in the a...

So as already said, our need "mod_webapp" for Apache which provides a module connecting to a Webapp Connector of Tomcat. (usually Port 8007/8008, ajp13 or apj14 Connector as defined in your server.xml).

Unfortuantely there is no webapp module in the Portage tree AFAIK and you have to compile the module on your own.

You can get the sources from here: http://jakarta.apache.org/builds/jakarta-tomcat-connectors/webapp/

a) for version 4.04 (which is the same version as the portage build).

b) latest release/snapshot

c) or from CVS

For me the module compiles and loads but Segfaults whenever I try to connect to it over Apache. No matter if I use a, b or c. But your milage may vary...

It should normally work. At least it did work with the same config once on my RedHat box. Go with the documentation in the readme etc. and it should probably work.  :Wink: 

If you don't want to transparebntly use tomct "embedded" into Apache, you should consider to simply connect/embed the JSP or Servlet Pages by accessing them directly through Port 8080. Which is also said to be faster. 

Another "problem" is that usually every RPM you get either from the Tomcat webpage or shiped with your distribution uses an initscript, changing to an unprivileged user (tomcat4)  when running tomcat as server. Only source-packages and the Gentoo Package unfortunately don't seem to do this and leave you with a tomcat running as root - which is a quite bad idea.

----------

