Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HowTo: Installing Apache1, tomcat 5, mod_jk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
raptor
Apprentice
Apprentice


Joined: 20 Sep 2002
Posts: 171

PostPosted: Mon Jun 27, 2005 5:53 pm    Post subject: HowTo: Installing Apache1, tomcat 5, mod_jk Reply with quote

To save you headaches and several days reading over the Internet (especialy if u are newscommer) :

For your reference I'm currently with these versions :
net-www/apache (1.3.33)
www-servers/tomcat (5.0.27-r6) - dont use 5.0.28 it seems to be buggy
www-apache/mod_jk (1.2.13) - from all reading over the internet it seems u dont have to use mod_jk2 (discontinued), but mod_jk

1. Install these three modules
2. In tomcat configuration /etc/tomcat5/tomcat-users.xml add user & role : admin & manager

Code:

 <role rolename="manager" description="manager"/>
 <role rolename="admin"/>
 <user username="manager" password="manager" fullName="" roles="manager"/>
 <user username="admin" password="admin" roles="admin"/>


3. Start and check if it is working :
Code:

/etc/init.d/tomcat5 start


open :
http://127.0.0.1:8080
Take a tour in Admin and Manager sections (use passwords u specified in [2])

5. Now to make mod_jk work. Modify apache.conf add at the end :
Code:

Include  modules.d/88_mod_jk.conf


6. In /etc/apache/modules.d/88_mod_jk.conf, modify
Code:

LoadModule jk_module    modules/mod_jk.so

to:
Code:

LoadModule jk_module    modules/modules/mod_jk.so


In /etc/conf.d/apache in APACHE_OPTS add "-D JK". example :
Code:

APACHE_OPTS="-D PERL -D JK"



4. check if apache is working
Code:

/etc/init.d/apache start


http://127.0.0.1/

5. To check that u can access tomcat via apache. Create a simple test.jsp file in

$CATALINA_BASE/webapps/ROOT/test.jsp
i.e.
/opt/tomcat5/webapps/ROOT/test.jsp
Code:

<HTML>
<BODY>
Hey, Hello!  The time is now <%= new java.util.Date() %>
</BODY>
</HTML>


Now open :
http://127.0.0.1:8080/test.jsp <---- to see if tomcat5 is still working :")
http://127.0.0.1/test.jsp <-------- to see that apache<-->mod_jk<-->tomcat5 connection is working

I hope it worked for you.
PS. If u have account in bugs.gentoo.org, pls add these correction for mod_jk and tomcat, so that it works out of the box.
...oops and it seems gentoo team has named mod_jk config file to /etc/jk-workers-proprietes instead of workers.proprietes as u will find it over the Internet..
As I look at the apache2 configs left on my box it seems that the installation of mod_jk is tailored to apache2 that is why it doesnt work out-of the box with apache1.x. Could someone confirm this.


Last edited by raptor on Mon Jun 27, 2005 6:14 pm; edited 2 times in total
Back to top
View user's profile Send private message
emicron
n00b
n00b


Joined: 11 Apr 2005
Posts: 5
Location: Bulgaria

PostPosted: Mon Jun 27, 2005 6:13 pm    Post subject: Cool you are so Javeless :)) Reply with quote

Thanks .. that's really good... Now i'm gonna spend more time with Java programming.
Back to top
View user's profile Send private message
d33d0
n00b
n00b


Joined: 22 Apr 2003
Posts: 24
Location: Hamburg / Germany

PostPosted: Tue Jul 19, 2005 12:20 pm    Post subject: apache2 Reply with quote

Thank you, raptor!

My Apache2 was still running with mod_jk2 (directly from apache.org) and I just "upgraded" to mod_jk. And it worked out-of-the box with apache2 as you expected!

Does anybody know, why mod_jk is still masked!?
Back to top
View user's profile Send private message
whatalotta
Tux's lil' helper
Tux's lil' helper


Joined: 23 Nov 2003
Posts: 114
Location: Union City, CA

PostPosted: Wed Sep 14, 2005 4:13 am    Post subject: Reply with quote

Thank you Raptor. I only had to change the following:

Line 9 in /etc/apache/modules.d/88_mod_jk.con to:

Code:
/etc/apache/jk-workers.properties


I appreciate the guide. Very concise and worked.

Derick
Back to top
View user's profile Send private message
redoverlord
n00b
n00b


Joined: 30 Aug 2005
Posts: 5

PostPosted: Tue Oct 25, 2005 4:23 pm    Post subject: Reply with quote

Thanks a lot

jsp files works fine, but none of my webapps works (exaple: cofax)

any ideas?
Back to top
View user's profile Send private message
redoverlord
n00b
n00b


Joined: 30 Aug 2005
Posts: 5

PostPosted: Wed Nov 16, 2005 11:39 am    Post subject: Reply with quote

silly me.

I forgot to do jkmount for the vhosts


Redoverlord
http://www.sunbowtech.com
java and tomcat
Back to top
View user's profile Send private message
opensas
Guru
Guru


Joined: 24 Nov 2004
Posts: 408
Location: Buenos Aires - Argentina

PostPosted: Fri Nov 18, 2005 7:17 am    Post subject: Reply with quote

Can anybody tell me what shuld I do to set up tomcat 5.0.27-r6, with mod_jk 1.2.13 but with apache 2.0.54-r31

I followed this guide but when I go to http://localhost/index.jsp I get the following error
Code:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache Server at localhost Port 80


If I access thru localhost:8080 verything works fine, so I guess the problem is not Tomcat but the mod_jk connector.

this is my conf file
Code:

tux ~ # cat /etc/conf.d/apache2 | grep APACHE2_OPTS
# and other features of apache using the APACHE2_OPTS line. Every module should
APACHE2_OPTS="-D DEFAULT_VHOST -D JK -D PHP5"


this is what I get in the log file

Code:

tux apache2 # cat mod_jk.log
[Fri Nov 18 04:27:26 2005] [8836:52064] [debug] map_uri_to_worker::jk_uri_worker_map.c (442): Attempting to map URI '/index.jsp' from 1 maps
[Fri Nov 18 04:27:26 2005] [8836:52064] [debug] map_uri_to_worker::jk_uri_worker_map.c (454): Attempting to map context URI '/*.jsp'
[Fri Nov 18 04:27:26 2005] [8836:52064] [debug] map_uri_to_worker::jk_uri_worker_map.c (468): Found a wildchar match ajp13 -> /*.jsp
[Fri Nov 18 04:27:26 2005] [8836:52064] [debug] jk_handler::mod_jk.c (1814): Into handler jakarta-servlet worker=ajp13 r->proxyreq=0
[Fri Nov 18 04:27:26 2005] [8836:52064] [debug] wc_get_worker_for_name::jk_worker.c (111): did not find a worker ajp13
[Fri Nov 18 04:27:26 2005] [8836:52064] [info]  jk_handler::mod_jk.c (1985): Could not find a worker for worker name=ajp13


Saludos

Sas[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum