How to integrate Tomcat with Apache

bacon333

Senior member
Mar 12, 2003
524
0
0
I want to run both php and jsp files on apache. How do I incorporate jsp without having to install the tomcat server? Is there a plugin?
 

bacon333

Senior member
Mar 12, 2003
524
0
0
it doesn't affect each other but it feels redundant to have two web servers. If i want to use jsp files i have to specify something like port 8081 or something. What if I want to run both jsp and php files on the same server?
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: bacon333
it doesn't affect each other but it feels redundant to have two web servers. If i want to use jsp files i have to specify something like port 8081 or something. What if I want to run both jsp and php files on the same server?

You can integrate tomcat into Apache. I did it once, but I'm not sure how. :p

I followed the directions on the site and some lucky googlin'.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
You can't run jsps without installing tomcat but you can use apache as a front for tomcat.

There's at least two ways to do it. The simplest, I think, would be to use apache as a proxy using mod_proxy. That's very simple because it's a very loose connection between the two. I've never used it so I don't know if it's seamless but it's definitely going to be what I try next time I integrate the two (I'll need to sometime soon).

The more difficult way is mod_jk which is what ugh linked. I haven't tried that way in a while and that documentation looks much more organized than what I used but when I did it, but it was quite difficult. There is also the problem that you always have to start the servers in a certain order for it to work. Not a problem at startup, but if one of them goes down then you might have to restart the other. I don't remember which is which but if tomcat going down required apache to be restarted you might have a real problem. Basically jk is a custom protocol for forwarding http requests (as I understand it, anyway).