LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 02-03-2012, 08:03 AM   #16
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004

Quote:
Originally Posted by neosk_ View Post
Nope, does not work:

Code:
     ProxyRequests Off
     ProxyPass /time ajp://10.0.0.1:8009/
     ProxyPassReverse /time ajp://10.0.0.1:8009/
getting suicidal Was also thinking already to do some with some rewrite engine, but aaaah
This is not what I've posted 2 posts ago. I've posted this one:
Code:
ProxyRequests Off
ProxyPass /time ajp://localhost:8009/time
ProxyPassReverse /time ajp://localhost:8009/time
Note the difference in the tomcat URI. You have to include the context where you've deployed your app (/time).
Also note that you can replace the ajp protocol with http (and change the tomcat listening port accordingly)
Code:
ProxyRequests Off
ProxyPass /time http://localhost:8080/time
ProxyPassReverse /time http://localhost:8080/time
In any case restart apache and clear your browser cache before visiting http://time.domain.local/time to see what you get

Regards
 
1 members found this post helpful.
Old 02-03-2012, 08:33 AM   #17
neosk_
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: 0
Ow, Fixed the context to /time

Now I get the Tomcat 404 site when going to http://time.domain.local/time

I guess using '/' for a proxypass would mean time.domain.local would redirect correctly

Code:
     ProxyPass / ajp://10.0.0.1:8009/time
     ProxyPassReverse / ajp://10.0.0.1:8009/time
using
Code:
     ProxyPass /time http://10.0.0.1:8080/time
     ProxyPassReverse /time http://10.0.0.1:8080/time
and navigating to http://time.domain.local/time

throws me an error 500 with message in log:

Code:
[Fri Feb 03 15:33:15 2012] [warn] proxy: No protocol handler was valid for the URL /time. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
 
Old 02-03-2012, 08:37 AM   #18
neosk_
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: 0
PS: I also enabled already proxy_html_module
 
Old 02-03-2012, 08:55 AM   #19
neosk_
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: 0
Ok, in host-manager app for tomcat I had time.domain.local set-up
I removed this and now when I navigate to http://time.domain.local/time I get my app running
Now I need to move it only to http://time.domain.local and am happy!
 
Old 02-03-2012, 08:55 AM   #20
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Quote:
I guess using '/' for a proxypass would mean time.domain.local would redirect correctly
Well not really. You need to use a uri in apache to reverse proxy an application deployed in tomcat under some context
Of course you can use:
Code:
ProxyPass / ajp://10.0.0.1:8009/
ProxyPassReverse / ajp://10.0.0.1:8009/
but you said that you have some php files in your vhost docroot and I guess you don't want them top be parsed by tomcat...


Quote:
PS: I also enabled already proxy_html_module
Not sure if you need this, but it doesn't harm anyway. Perhaps you don't even need to enable mod_proxy_http accrding to this
 
1 members found this post helpful.
Old 02-03-2012, 08:58 AM   #21
neosk_
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Well not really. You need to use a uri in apache to reverse proxy an application deployed in tomcat under some context
Of course you can use:
Code:
ProxyPass / ajp://10.0.0.1:8009/
ProxyPassReverse / ajp://10.0.0.1:8009/
but you said that you have some php files in your vhost docroot and I guess you don't want them top be parsed by tomcat...



Not sure if you need this, but it doesn't harm anyway. Perhaps you don't even need to enable mod_proxy_http accrding to this
Yeah, no biggie with PHP scripts, I can move them to another vhost (mainly pgsql admin) so I can aswell move the app to http://time.domain.local

also, now I tested it with mod_jk - works aswell!

which means: adding virtual hosts in hosts-manager app of tomcat is BAD and leads to big problems Why is it even there ?
 
Old 02-03-2012, 09:03 AM   #22
neosk_
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by neosk_ View Post
also, now I tested it with mod_jk - works aswell!
oh - nah, was cache
 
Old 02-03-2012, 09:12 AM   #23
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Quote:
Originally Posted by neosk_ View Post
oh - nah, was cache
At least does it work with the reverse proxy setup? Looking for the mod_jk debug logs you posted, I've found some bug reports, so maybe it's a bug in debian mod_jk package.
So if it works with the reverse proxy then you could stay with it

Regards
 
1 members found this post helpful.
Old 02-03-2012, 09:17 AM   #24
neosk_
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
At least does it work with the reverse proxy setup? Looking for the mod_jk debug logs you posted, I've found some bug reports, so maybe it's a bug in debian mod_jk package.
So if it works with the reverse proxy then you could stay with it

Regards
yeah, works with reverse proxy, I stick with it
I just want to move it to top level

tried it with
Code:
     ProxyRequests Off
     ProxyPass / ajp://10.0.0.1:8009/time
     ProxyPassReverse / ajp://10.0.0.1:8009/time
but that does not work - for whatever idea :<

edit: I got 404 message

Code:
type Status report

message /timetime/

description The requested resource (/timetime/) is not available.

Last edited by neosk_; 02-03-2012 at 09:19 AM.
 
Old 02-03-2012, 10:47 AM   #25
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Try with the trailing slashes in the tomcat url
Code:
ProxyRequests Off
ProxyPass / ajp://10.0.0.1:8009/time/
ProxyPassReverse / ajp://10.0.0.1:8009/time/
Or see my post #20 above. In this case you need to deploy your app and the "/" context.
 
1 members found this post helpful.
Old 02-07-2012, 04:31 AM   #26
neosk_
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Try with the trailing slashes in the tomcat url
Code:
ProxyRequests Off
ProxyPass / ajp://10.0.0.1:8009/time/
ProxyPassReverse / ajp://10.0.0.1:8009/time/
Or see my post #20 above. In this case you need to deploy your app and the "/" context.
Trailing slashes worked
Apparently the devs have put a /time subdirectory into the project which gets aswell translated and then the project does not work, but that is another issue.

THANK YOU SO MUCH FOR YOUR HELP! Really appreciated
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 06:46 AM
When enabling Virtualhosting in Apache on Slackware Sargalus Linux - Software 6 03-04-2010 05:49 PM
apache-tomcat and jakarta-tomcat shifter Programming 1 07-28-2007 10:36 PM
Why use Apache with Tomcat rather than just Tomcat itself? davee Linux - Software 1 08-21-2003 09:47 PM


All times are GMT -5. The time now is 05:36 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
Open Source Consulting | Domain Registration