LinuxQuestions.org
Review your favorite Linux distribution.
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 08-26-2011, 02:14 AM   #1
bittus
Member
 
Registered: Aug 2006
Posts: 151

Rep: Reputation: 15
Intergating apache and tomcat with jk_mod.so


I am trying to integrate Apache 2.2.8 and Tomcat 6.0.33

The steps that I have done.
  1. Downloaded and compiled mod_jk
  2. Edited the worker.properties file like :

    worker.list=worker1
    worker.worker1.type=ajp13
    worker.worker1.host=localhost
    worker.worker1.port=8009
  3. Edited the httpd.conf
    LoadModule jk_module /usr/local/apache2/modules/mod_jk.so
    JkWorkersFile /etc/httpd/conf/workers.properties
    JkShmFile /var/log/httpd/mod_jk.shm
    JkLogFile /var/log/httpd/mod_jk.log
    JkLogLevel info
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
    JkMount /examples/* worker1

As per the configuration, if I try http://localhost/examples, I should be getting the tomcat apllication. Instead, I get a message "File does not exist: /var/www/html/ABC/examples" in the httpd error_log.

Anyone, any clue on this

Last edited by bittus; 08-26-2011 at 02:37 AM.
 
Old 08-26-2011, 05:35 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Quote:
As per the configuration, if I try http://localhost/examples, I should be getting the tomcat apllication. Instead, I get a message "File does not exist: /var/www/html/ABC/examples" in the httpd error_log.
Shouldn't that be /var/www/html/examples
 
Old 08-26-2011, 12:21 PM   #3
bittus
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Shouldn't that be /var/www/html/examples
@bathory /var/www/html/ABC is my doucument root.
 
Old 08-26-2011, 01:15 PM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
What is your distro?
I guess from the docroot path, that it's RHEL based. If that's the case I would suspect a selinux permissions problem.

Regards
 
Old 08-28-2011, 02:08 AM   #5
bittus
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
What is your distro?
I guess from the docroot path, that it's RHEL based. If that's the case I would suspect a selinux permissions problem.

Regards
@bathory
Your are right. It's RHEL based.
Do you have any idea of the required SElinux context ?
 
Old 08-28-2011, 04:17 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,

I'm not a rhel fan, so I know little about selinux. Anyway you should try to disable it temporarily and see if that's the case. Run
Code:
setenforce 0
and check.
If it's selinux, relabel the docroot as in the example here.

Regards
 
1 members found this post helpful.
Old 08-31-2011, 01:37 AM   #7
bittus
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Hi,

I'm not a rhel fan, so I know little about selinux. Anyway you should try to disable it temporarily and see if that's the case. Run
Code:
setenforce 0
and check.
If it's selinux, relabel the docroot as in the example here.

Regards
@bathory,
Thanks for the feedback and sorry for the late update.
I was wondering how I missed, SElinux is disabled on the server. So that should not be the issue

I will brief my requirement again.
Now, in order to reach the tomcat service we should type in http://192.168.1.102:4455/examples/m...1034&room=chat
I would like to access the service by just typing in http://www.mydomain.com/tc/examples/...1034&room=chat

Any suggestions are welcome.

I would also like to know, if mod_rewrite will help !!!
 
Old 08-31-2011, 03:59 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,

You can use mod_proxy or mod_proxy ajp for this.
Take a look at this howto for details.

Regards
 
1 members found this post helpful.
Old 09-02-2011, 02:43 AM   #9
bittus
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
Hi,

You can use mod_proxy or mod_proxy ajp for this.
Take a look at this howto for details.

Regards
@bathory
Thats a well explained tutorial. And that worked for me finally
Thanks a lot.
 
  


Reply

Tags
apache, mod_jk, tomcat


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Session replication using apache+mod_jk+tomcat(5.5.28-veriosn of tomcat) sreejithp Linux - Server 1 12-24-2010 07:46 AM
apache-tomcat and jakarta-tomcat shifter Programming 1 07-28-2007 11:36 PM
Apache 2.2.0 and Apache-Tomcat 5.5.17, how can i connect them? Ukitake Fedora 1 06-04-2006 09:25 AM
Why use Apache with Tomcat rather than just Tomcat itself? davee Linux - Software 1 08-21-2003 10:47 PM


All times are GMT -5. The time now is 12:33 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration