Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 25th July 2005, 06:10 AM
Remdex Offline
Registered User
 
Join Date: Jul 2005
Location: Lithuania
Age: 29
Posts: 1
How-to integrate tomcat 5.5.9 with Apache using mod_jk ?

So I was looking for simalar tutorial in how-to sectiond but did not find and decided to write it myself.
Only I'm not sure about j2sdk is it need to update or not. If something does not work try to follow this tutorial first http://forums.fedoraforum.org/showthread.php?t=47591 [First] Anyway let's start
Also there you can follow third tutorial about instalation of tomcat5 if you do not like my


Start terminal and became root.Then type
Code:
yum install tomcat5-jasper-5.0.30-5jpp_6fc cryptix cryptix-ans1
P.s I can't remeber all dependencys what is needed for tomcat5, anywai you can see it by typing yum install tomcat5 and see what dependencys is needed. But then say no for the instaliation It's only useful to know what dependencys is needed First i tried yum install tomcat5 it installed ok but self server did not worked for my at all. And one more thing i do not quaranty that it will work for you. Like i spend all day doing crasy things to make it work And i wrote there everything i could remember what i did Anyway atleast you gona have idea how to make it work


First shutdown original apache server

Code:
/sbin/service httpd stop
Also we will need this directory later
Code:
mkdir /var/www/html/java

1.tomcat 5.5.9
Code:
wget http://mirrors.isc.org/pub/apache/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9.tar.gz
tar zxf jakarta-tomcat-5.5.9.tar.gz
after extract rename jakarta-tomcat-5.5.9 to tomcat5
and finaly move tomcat5 to /usr/share catalog (like i'm beginer i dont know what exactly commands i used so (^^)



Now we need to do a little tweaking to server.xml file, so in console type
Code:
gedit /usr/share/tomcat5/conf/server.xml
Under these lines
Code:
<Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
add this line :
Code:
<Context docBase="/var/www/html/java" path="/java"/>
we will be using this directory for storing simple hello.jsp script.


In general to test is tomcat5 working type
Code:
/usr/share/tomcat5/bin/startup.sh
then go to
http://localhost:8080/java
(you should see empty directory)

You can also try
http://localhost:8080/
(and you should see dafault tomcat web page)

Then you are sure that everything is working type :
Code:
 /usr/share/tomcat5/bin/shutdown.sh
2.Installation of mod_jk

Code:
yum install mod_jk
After that you have to execute ceople commands

Code:
cp /usr/share/doc/mod_jk-1.2.6/mod_jk.conf.sample /etc/httpd/conf.d/mod_jk.conf
Then :
Code:
gedit /etc/httpd/conf.d/mod_jk.conf
(now you have to change ceople things in it like we are using original version of tomcat.)

a) change
Code:
JkWorkersFile   /etc/httpd/conf/workers.properties
to
Code:
JkWorkersFile   /usr/share/tomcat5/conf/workers.properties
b)
Change these lines
Code:
Alias /examples "/usr/share/tomcat5/webapps/examples"
<Directory "/usr/share/tomcat5/webapps/examples">
    Options Indexes FollowSymLinks
</Directory>
to
Code:
Alias /jsp-examples "/usr/share/tomcat5/webapps/jsp-examples"
<Directory "/usr/share/tomcat5/webapps/jsp-examples">
    Options Indexes FollowSymLinks
</Directory>
This will be default jsp-examples page just for testing purposes.
Strange thing i noticed that then alias is different than in tomcat it does not work. So alias must match
tomcat server folder.

Next under
Code:
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
add this line
Code:
JkMount /var/www/html/java/* ajp13
Save and close the file.

Looks like thats all like i did not change anything else in it, others directorys wont work but if you want you can yourself experiment to make in work

finaly to test
Code:
touch /var/www/html/java/hello.jsp
gedit /var/www/html/java/hello.jsp
and paste in it this line
Code:
<%= new java.util.Date() %>
Save and close the file.


Finaly in console type

Code:
/usr/share/tomcat5/bin/startup.sh
/sbin/service httpd start
and finaly go to
http://localhost/java/hello.jsp
and you should see date

bye and enjoy
P.s And sory for my crappy english And by the way it's my first post in this forum
Reply With Quote
  #2  
Old 1st October 2005, 05:04 AM
cyaconi Offline
Registered User
 
Join Date: Aug 2005
Location: Santiago - Chile
Age: 37
Posts: 21
nice tutorial, thanks!!
but, I don't why, the test page doesn't work for me. It shows the 500 Internal Server Error, and the mod_jk.log says:
[sat oct 01 11:59:40 2005] [jk_ajp_common.c (1477)]: Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=ajp13 failed errno = 13

I'd check server.xml and it's listening on 8009, and telnet localhost 8009 works too...

what could be happenning???

Thank you!
Reply With Quote
  #3  
Old 30th March 2006, 06:12 PM
msimplay Offline
Registered User
 
Join Date: Jun 2004
Age: 30
Posts: 99
will this work for fedora core 5 ?
Reply With Quote
Reply

Tags
apache, howto, integrate, modjk, tomcat

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache/Tomcat mod_jk MarkE Servers & Networking 1 22nd February 2008 09:16 PM
Apache2, Tomcat, Mod_jk Integration Help bling683 Installation and Live Media 0 22nd February 2008 09:04 PM
Tomcat + Apache + mod_jk permission denied conquest Using Fedora 9 18th January 2006 03:07 PM
Tomcat/Apache/mod_jk on FC3 midian Servers & Networking 0 16th June 2005 10:26 PM


Current GMT-time: 02:19 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat