LinuxQuestions.org
Help answer threads with 0 replies.
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 04-01-2010, 01:23 AM   #1
buffe
LQ Newbie
 
Registered: Mar 2010
Posts: 3

Rep: Reputation: 0
passing HTTPS connections in apache to tomcat


hi,
I have configured apache using mod_jk to front tomcat. Then I configured tomcat and my application to use https. but after that I cannot access it through https without adding port 8080 in the URL. I think I need to add some configurations to apache to cope with this situation, but I still couldn't find the proper config though I tried many. I would be grateful if someone can help me with this.

Thanks
 
Old 04-01-2010, 01:01 PM   #2
roreilly
Member
 
Registered: Aug 2006
Location: Canada
Distribution: Debian, Slackware
Posts: 106

Rep: Reputation: 28
it sounds like you're running tomcat via ssl, you should run apache w/ ssl.

enable ssl. in ports.conf, make sure that Listen 443 is enabled.

I also use mod-rewrite to have all http://your.host.name automatically redirect up to https://your.host.name.

Hope this helps.
 
Old 04-02-2010, 08:30 PM   #3
roreilly
Member
 
Registered: Aug 2006
Location: Canada
Distribution: Debian, Slackware
Posts: 106

Rep: Reputation: 28
hey buffe,

If you're still stuck, ping me. I have a couple dozen servers set up with apache fronting tomcat,
so I think I can help you get through this.

R.
 
Old 04-05-2010, 04:52 AM   #4
buffe
LQ Newbie
 
Registered: Mar 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you very much roreilly,
Actually I could configure apache to use https, but it didn't fulfill my requirement. I want apache to use https only for the pages that redirects to https by the application running on tomcat. and use http for others. that means apache should be able to serve both http and https and those which should be accessed through https shoould be decided by tomcat side(actually the application on tomcat, eg:use https only for login page). I configured virtual hosts for both port 80 and 443 and workers as well, but browser says I'm in a loop. I would be grateful if you could help me with this.

Thank you.
 
Old 04-06-2010, 07:13 AM   #5
roreilly
Member
 
Registered: Aug 2006
Location: Canada
Distribution: Debian, Slackware
Posts: 106

Rep: Reputation: 28
I believe that the loop is caused by trying to have tomcat make the decisions about what ports to serve.

In my case, we enforce ssl across the board. The load cost of ssl isn't high enough for us to worry about doing it otherwise.

However, in your instance, as I understand, you want ssl for logins only.

In this case, here is how I would lay it out:

tomcat should listen only on the ajp13 port. (8009 by defaut)

apache should listen on 80 & 443.

use mod_rewrite to handle the ssl redirects in this manner:
note, this is not syntactically correct:

vhost:80
rewrite ^"login page" > https://my.domain.com
do not rewrite any other requests.


vhost:443:

match != login pages > http://my.domain.com


I believe something like that is what you need. Trying to have tomcat do the decision making of https/http is probably going to give you far too much grief.

I'm afraid my mod_rewrite skills are not strong enough to be very helpful, but if you like I can get you started on the basic matching to redirect up to https.
 
  


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
How to switch on https in apache-tomcat-6.0.14 wrennybeno Linux - Software 1 12-23-2009 06:47 AM
Some https connections time out. Likosin Linux - Networking 0 04-26-2005 07:48 PM
Squid problem with https connections thermoponch Linux - Networking 0 11-03-2004 04:41 AM
Problem with https connections - iptables Suse9.0 mschna Linux - Networking 2 02-12-2004 01:54 AM
password rejected on https connections JCQ78 Linux - Networking 1 09-07-2003 05:36 PM

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

All times are GMT -5. The time now is 07:39 AM.

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