LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-07-2004, 02:09 AM   #1
royb
LQ Newbie
 
Registered: Dec 2001
Location: Sydney, Australia
Distribution: Fedora
Posts: 14

Rep: Reputation: 0
Connecting Apache2 with Tomcat5 using mod_jk


I am having a problem getting apache2 to talk to tomcat5.0.19 using mod_jk.

I have apache2 working properly.

I have tomcat working properly

i have mod_jk compiled and loaded

i have the following connector defined in server.xml
<Connector redirectPort="8443" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" port="8009">
</Connector>

i have following defined in httpd.conf

jkMount /jsp-examples/* ajp13

If i goto url http://abc:8080/jsp-examples i get the examples page

If i go tp url http:/abc/jsp-examples i get internal server error and mod_jk.log shows
[jk_ajp_common.c (955)]: Error connecting to the Tomcat process.
[jk_ajp_common.c (1309)]: sending request to tomcat failed in send loop. err=1
[jk_connect.c (233)]: jk_open_socket, connect() failed errno = 101
[jk_ajp_common.c (676)]: Error connecting to tomcat. Tomcat is probably not started or is listenning on the wrong port. Failed errno = 101

i have the workers.properties configured to use port 8009.

Is there something els i need to add to the server.xml file.

Thanks for any help anyone can give.

RoyB
 
Old 03-07-2004, 01:58 PM   #2
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 72
Make certain that Tomcat is actually on 8009, I wouldn't imagine that they've changed that, but who knows... I'm only used to Tomcat 4.x and Apache 1.3, but most of the juggling is the same.

What's your workers.properties file look like?

Also, I'll see if we can get this one moved to software, its more fitting there, probably more eyeballs.

Cheers,

Finegan
 
Old 03-07-2004, 02:10 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
As above, moving to Software.
 
Old 03-07-2004, 03:21 PM   #4
royb
LQ Newbie
 
Registered: Dec 2001
Location: Sydney, Australia
Distribution: Fedora
Posts: 14

Original Poster
Rep: Reputation: 0
workers.properties is simple

workers list = ajp13

worker.ajp13.type=ajp13
worker.ajp13.port=8009
worker.alp13.host=localhost.

Tomcat is working ok as i can use the applications wwhen specifying the port 8080. But when i try to use the mod_jk connectionm on port 8009 this is where the problem starts. Is there something else required in the tomcat config server.xml to activate the port. It currently only has the one connector entry.

Thanks
 
Old 03-07-2004, 03:41 PM   #5
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 72
Nope, 8009 is in there by default unless Tomcat 5.x does something weird, lets make certain 8009 is open, nmap localhost and see what's open, netstat -a will say the same, but nmap will at least tell you if you can get a connection over localhost so if there are some annoying firewall rules in there, it should bring them to light.

Cheers,

Finegan
 
Old 03-08-2004, 03:52 AM   #6
royb
LQ Newbie
 
Registered: Dec 2001
Location: Sydney, Australia
Distribution: Fedora
Posts: 14

Original Poster
Rep: Reputation: 0
I have it working

I am using suse8.1, nmap not found. Used netsat -a shows *:8009 is LISTEN state.

Tried telnet localhost 8009

received response of connect to address ::1: Connection refused, so i tried telnet 127.0.0.1 8009 and was able to establish connection.

Changed workers.properties so that worker.ajp13.host = 127.0.0.1 and we are away. System seems to be performing normaly.

I do not understand why localhost did not work, but i am happy i have it functioning. Thanks for your help and patience.

RoyB
 
Old 03-09-2004, 06:26 PM   #7
finegan
LQ Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 72
SuSE!!! take a look at /etc/hosts, its got a gooferized version of the localhost naming schema in there, it should look like:

Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
66.163.253.201          clockwatching.net melchoir
You'll probably want to change it or non-SuSe prepped apps will barf in the same way, I can't believe I didn't think about that before. Sorry mate.

Cheers,

Finegan
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP? nicolasdiogo SUSE / openSUSE 2 04-05-2007 09:06 AM
Installing Tomcat5 Randvegeta Linux - Software 1 05-07-2005 05:32 AM
connecting Apache 1.3.x and Tomcat 5.5: mod_jk [GOD]Anck Slackware 0 03-22-2005 09:27 AM
SuSE 9.2 - apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP? nicolasdiogo Linux - Networking 2 03-20-2005 08:06 AM
Problem in Apache2 + Tomcat5 Dexter2004 Linux - Networking 1 08-06-2004 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration