LinuxQuestions.org
Visit Jeremy's Blog.
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 06-11-2012, 02:43 AM   #1
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Rep: Reputation: Disabled
Problem to run Servelet with mod_jk


Hi,

I am using tomact on centos.

I have installed apache and apache tomcat both on my server.

I want to run my tomcat and apache both on port 80
that's why i implemented mod_jk connector.
I want to run all my jsp and servlet file from the examples folder only.
for that i have use Jkmount point as /examples/* my_workers_property_name

when i run .war file it does not work.
what more settings i have to do.
 
Old 06-11-2012, 06:49 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Quote:
when i run .war file it does not work.
what more settings i have to do.
You must first deploy the war file in tomcat under /examples (e.g. using a context like /examples/mywar) and then use apache and mod_jk to access it.

Regards
 
Old 06-11-2012, 07:00 AM   #3
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Original Poster
Rep: Reputation: Disabled
HI,

Thanks for the reply.

I have put my as file in /examples/test/meshcms.war
but still i cant access it.
 
Old 06-11-2012, 07:02 AM   #4
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Original Poster
Rep: Reputation: Disabled
Hi,

Should i have to add any server mapping detail in web.xml or server.xml file regarding my .war file
 
Old 06-11-2012, 08:06 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by adam_1784 View Post
HI,

Thanks for the reply.

I have put my as file in /examples/test/meshcms.war
but still i cant access it.
Can you access your application directly through tomcat, like http://tomcat:8080/meshcms
If not, you need to deploy it.
Quote:
Should i have to add any server mapping detail in web.xml or server.xml file regarding my .war file
I guess you have. Or you can stick your war file under /webapps in which case it will be autodeployed. Of course you need to change the JkMount path in apache

Regards
 
Old 06-11-2012, 08:22 AM   #6
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Original Poster
Rep: Reputation: Disabled
Hi,

I cant change my jkmount point /examples/* to /*
I am running php script also on my root directory so if i change jkmount point to just /* my php script will stop working.
I cant access like http://myip:8080/examples/meshcms
because of jkmount point.
But if I change it to /* it works.
But i have to save my .war file in /webapps directory not in /examples directory.
I can then access like http://myip:8080/meshcms or like http://myip/meshcms
but then i cant access my php script on root directory.

Last edited by adam_1784; 06-11-2012 at 08:39 AM.
 
Old 06-11-2012, 09:21 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
But i have to save my .war file in /webapps directory not in /examples directory.
I can then access like http://myip:8080/meshcms or like http://myip/meshcms
but then i cant access my php script on root directory.
In this case you can use JkUnMount:
Code:
JkMount /* my-worker
JkUnmount /*.php my-worker
 
Old 06-11-2012, 09:33 AM   #8
adam_1784
Member
 
Registered: Dec 2011
Posts: 41

Original Poster
Rep: Reputation: Disabled
HI,

JkMount /* my-worker
JkUnmount /*.php my-worker
This doesn't solve my problem.

I want my .php script to work without any error.
I just want to run servlet file on my jkmount point.
 
Old 06-11-2012, 11:35 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
JkMount /* my-worker
JkUnmount /*.php my-worker
This doesn't solve my problem.

I want my .php script to work without any error.
How comes? You can access both http://myip/script.php and http://myip/meshcms Did you try it and got errors?

Quote:
I just want to run servlet file on my jkmount point.
Then read tomcat documentation to see how to deploy a war file under a specific context (/examples in your case)
 
  


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
[SOLVED] Can mod_jk and mod_proxy run together in the Apache ? ratotopi Linux - Software 5 02-13-2012 02:01 PM
servelet mapping in jetty server bluetooth Linux - Newbie 0 05-04-2011 05:01 AM
mod_jk configuration problem Raakh Linux - Newbie 1 06-17-2009 11:12 AM
FC3 - problem to compile mod_jk jdc32 Linux - Software 4 02-25-2005 04:04 AM
how can i run my helloworld servlet in apache-tomcat-mod_jk? doublefailure Linux - Software 1 04-28-2003 08:33 AM

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

All times are GMT -5. The time now is 06:36 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