View Full Version : Apache & Tomcat integration on FC2Test3
rjc
8th May 2004, 03:16 PM
I'ved installed all the necessary httpd and tomcat packages and have looked over the necessary config files but still cannot get them to work properly.
Apache is not calling tomcat to compile the java code inside jsp pages...any ideas?
Rafael.
Bana
8th May 2004, 05:16 PM
Perhaps you need to compile support with Tomcat into Apache? Make sure tomcat has all the necessary permissions as well.
rjc
8th May 2004, 05:50 PM
How would I go about doing that? I've also installed the tomcat connector (mod_jk2) rpm and it looks like everything is setup right. Apache is configured to load modules in conf.d directory and the jk2.conf file is in there.
Any ideas? online tutorials?
Bana
8th May 2004, 06:11 PM
http://www.serverwatch.com/tutorials/article.php/2203891
http://www.moreservlets.com/Using-Tomcat-4.html
jeru
10th May 2004, 08:14 PM
I've never used prebuilt tomcat packages.... But I did compile and modify some other howto's into another updated howto that meets my personal needs. Maybe they will help you, I just put it together to help my brother in law figure out how get tomcat working.
http://mikepalmer.net/howto/tomcat/apache.html
ignore the JAF(activation.jar) and javamail(mail.jar) classpath's, unless you put them someplace... I just didn't write anything about em and left them in on accident. The howto's aren't extremely extensive, a lot of what I did was told him how to do things such as virtual hosting on the phone after he got it initialally working together.
But the reason why it wouldn't be serving up .jsp pages is because you need to put something like this in httpd.conf
-----------------------------
LoadModule jk2_module modules/mod_jk2.so
<Location "/*.jsp">
JkUriSet worker ajp13:localhost:8009
</Location>
------------------------------
and then have your 'workers2.properties' file in your apache/conf dir... It should look something like this.
-------------------------
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
[uri:/jsp-examples/*]
worker=ajp13:localhost:8009
[uri:/servlets-examples/*]
worker=ajp13:localhost:8009
[uri:/manager/*]
worker=ajp13:localhost:8009
[uri:/servlet/*]
worker=ajp13:localhost:8009
---------------------------
Feel free to ask questions and I'll try to help
rjc
11th May 2004, 02:02 PM
I really appreciate the help. I was able to get it to work after looking through some of the links that Bana gave. They led me down the right path. My error was that I was placing the jsp pages in the apache root directory instead of the tomcat root directory. Apparently, if a jsp file is specified, Apache looks to tomcat to serve it from it's directories. To avoid this conflict, I'ved set both root directories to point to the same location. So far, I haven't had any problems.
Again, thanks for the help.
rjc
11th May 2004, 02:06 PM
Jeru:
I forgot one more thing, the howto's seem pretty straightforward. Wish I would had them a week ago ;-) but luckily I got everything up in the nick of time. Classes started yesterday. :-)
coolest
13th December 2004, 04:15 PM
Please note that although that configuration works, it is not supported on Apache 2, and there are some security issues with it.
You need to look at the apache documentation for the correct configuration.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28758
http://issues.apache.org/bugzilla/show_bug.cgi?id=32660
Regards
Af
http://yazd.yasna.com
jeru
13th December 2004, 11:16 PM
Don't use mod_jk2 anymore. It has been depreciated and portions are being backported into mod_jk.
lack of interest by admins and thus turning to a lack in interest by developers. (No automagic configuration like with mod_jk.)
p.s. that 'security issue' is a regexp issue documented by yours truely long ago, but there are many other ways of doing it for it to have been considered a high priority bug such as a 'security issue' is classified. A word to the wise though for Apache or web services in general. If you know something can't process certian extensions/mime types such as the case in apache vs tomcat regaurding servlets. Why let them try? What happens if/when Tomcat goes down or it simply cannot be instanciated by the worker? ;) That and because you can go about it different ways is the reason this regexp bug was marked as "low priority".
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.