How to Install Tomcat on Windows and Enable HTTPS / SSL

Tutorials, tips and tricks.

Moderator: moderators

Re: How to Install Tomcat on Windows and Enable HTTPS / SSL

Postby seanpkeown » Thu Feb 10, 2011 6:12 am

JanoLapin wrote:Have you a solution for use Tomcat 7 with Subsonic ?


To be honest at the time i wrote this tutorial i didn't try too hard to get subsonic running in tomcat 7 since version 7 wasn't stable yet. Supposedly it just became stable this past month. I read that tomcat 7 now came with a way to detect CSRF (Cross-site request forgery) but at the time i didn't know if the problem was being caused from the way that Sindre wrote subsonic or from a bug from tomcat 7.

I was planning to test subsonic in Tomcat 7 to see if the problems were fixed but from your post it's not looking good.

I swear that i read somewhere that Sindre was in the process of testing subsonic in tomcat 7. I think it was in his mile long todo list on sourceforge.

Hope this helps,
~ Sean K
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby goode » Tue Feb 15, 2011 7:47 pm

follow the directions to a tee, however, cant get it to work.....period.
goode
 
Posts: 7
Joined: Tue Oct 05, 2010 5:35 pm

Postby seanpkeown » Tue Feb 15, 2011 11:49 pm

goode wrote:follow the directions to a tee, however, cant get it to work.....period.


Just by installing tomcat a webpage should appear by browsing to http://localhost:8080 or http://127.0.0.1:8080 from your windows machine. Are you able to see this webpage?

If not open the tomcat service in the taskbar and make sure that the tomcat service is running. You can also click Start>Run and type services.msc and look for a service called tomcat6 and make sure that it's running.

Also try turning off windows firewall by going to Start>Run and type firewall.cpl.

If this doesn't help then uninstall tomcat and then install a fresh copy and browse to http://127.0.0.1:8080 and let me know what you find. < if your installing this on vista or windows 7 then try installing by right clicking on the .exe and run it as administrator just incase.


~ Sean K
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby goode » Wed Feb 16, 2011 3:18 pm

Yes, i can see the apache tomcat webpage @ http://localhost:8080

before, i used to be able to click on the links (i.e. status link & tomcat manager link)

now when i click on it, its broken.


yes this is a windows 7 machine if that helps any


and windows firewall is turned off


edit: when i use http://127.0.0.1:8080 as opposed to the localhost:8080 .... i can log in and links are not broken.

i can see subsonic in the applications manager page
goode
 
Posts: 7
Joined: Tue Oct 05, 2010 5:35 pm

Postby seanpkeown » Wed Feb 16, 2011 11:55 pm

Ok now make sure that the subsonic.war file is located under C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps If it is then browse to http://127.0.0.1:8080/subsonic if that doesn't work then try rebooting the tomcat service or your computer then try browsing to the site again.

~ Sean K
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby goode » Thu Feb 17, 2011 5:24 am

did all that


doesnt the subsonic.war need to be renamed to subsonic?
goode
 
Posts: 7
Joined: Tue Oct 05, 2010 5:35 pm

Postby seanpkeown » Fri Feb 18, 2011 2:32 am

goode wrote:did all that


doesnt the subsonic.war need to be renamed to subsonic?



No, the file has to have the .war extension or tomcat won't know what to do with it.

~ Sean K
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby madeintheuk » Mon Feb 28, 2011 7:57 pm

I have everything understood except for creating the SSL certificate.

For step 3.) You have a link, does that mean i must follow the steps in the link and then follow the steps below or is the link just the source of information that you have outlined below and i should disregard it completely

Also can I use other SSL certificate websites? or must i self sign it myself. There are such websites like StartSSL.com that will produce your own certificate but i don't understand if i can use them or not. Does the certificates produced from those websites mean they are certified by StartSSL.com or is it still signed by me?

This encrpytion will enable me and my mates to be at ease with the prying eyes. Atleast for now so any and all help will be greatly appreciated.
madeintheuk
 
Posts: 2
Joined: Mon Feb 28, 2011 6:35 pm

Postby fejao » Thu Mar 24, 2011 12:49 am

Before anything....THANKS

I was running the subsonic over a VPN and it was a pain to have to log it twice to get all done, because I had to log over the VPN to get the SSL tunnel them log over subsonic.

I had to change a couple of things in your tutorial, like the folder addresses because you make the installation of the Tomcat by yourself and I did using the repositories.

My doubt was only at the and where you have to edit the file to get enable the tomcat to work only with the SSL.

The file that you have to edit is the web.xml not the server.xml

Once I google it I found the answer and now everything works like a charm :D

For those that have not so many ideas how to make it all work do the same as I did, try it before in a VM and after thats everything is working do it in your server.

Our server is an old pentium III that get the whole library over a NAS that runs in a external HD.

I hope Sindre could put this feature as a default so those that that dont have much idea about security dont have problems, like your ISP getting idea that you are streaming/uploading .mp3 files, even if those files are yours(its always better to avoid them do deal with a problem).

Once again THANKS :D
User avatar
fejao
 
Posts: 10
Joined: Thu Mar 24, 2011 12:34 am

Can't get SSl to work with registered domain name on tomcat.

Postby twos49 » Tue May 10, 2011 3:02 pm

Please Help!!!!

subsonic website: (registered/paid) version 4.4
tomcat server: version 6.0.32

I have a registered domain name: "xxxxx".subsonic.org through the subsonic webapp. I'm trying to get that domain name to SSL but can't seem to get it to work.

When I enter in "xxxxx".subsonic.org it forwards to 'http://192.168.0.1:8443/subsonic' which displays nothing on the web page. However if I add the 's' in the address bar and make it 'https://192.168.0.1:8443/subsonic' it displays the correct login screen. Somehow I think my registered domain name didn't get assigned to correct protocol. Is my assumtion correct. Or am I missing something. I have followed the instuctions except that I added the security constraint snippet to the subsonic web.xml instead of the tomcat web.xml. If I do add it to the tomcat web.xml I don't any web page displayed. Could someone help please??

Thanks for your time.
twos49
 
Posts: 3
Joined: Sat Apr 30, 2011 12:53 pm

Re: Can't get SSl to work with registered domain name on tom

Postby GJ51 » Wed Oct 10, 2012 7:20 am

twos49 wrote:Please Help!!!!

subsonic website: (registered/paid) version 4.4
tomcat server: version 6.0.32

I have a registered domain name: "xxxxx".subsonic.org through the subsonic webapp. I'm trying to get that domain name to SSL but can't seem to get it to work.

When I enter in "xxxxx".subsonic.org it forwards to 'http://192.168.0.1:8443/subsonic' which displays nothing on the web page. However if I add the 's' in the address bar and make it 'https://192.168.0.1:8443/subsonic' it displays the correct login screen. Somehow I think my registered domain name didn't get assigned to correct protocol. Is my assumtion correct. Or am I missing something. I have followed the instuctions except that I added the security constraint snippet to the subsonic web.xml instead of the tomcat web.xml. If I do add it to the tomcat web.xml I don't any web page displayed. Could someone help please??

Thanks for your time.


I'm having the same problem. I have Apache Tomcat 6.0.35 running the WAR install of 4.7 running just fine on Windows Server08R2 64-bit. I can access the site from either the http address or the https address using the ip#:port#

If I add the code to force the site to use SSL, it will work until Subsonic updates subsonic.org and transmits the SSL port number to subsonic.org. After that happens, trying to connect to http://severname.subsonic.org returns http://ipaddress:sslport# so that you have to go to the address bar and add the "s" to connect to the site.

If I go back to the web.xml file and comment out the security code, I can go back into the http address of the site, resave the vanity url and everything works again until I try to reinitiate SSL.

If I log onto the site through the SSL port and go to Network/Settings and hit Save I get the following error:

Access your server over the Internet using an easy-to-remember address.

http://servername.subsonic.org

Status: servername.subsonic.org is registered, but could not connect to it. (ClientProtocolException)

I know there are others out there who have this working.

Please share the secret.

Thanks
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: How to Install Tomcat on Windows and Enable HTTPS / SSL

Postby bushman4 » Wed Oct 10, 2012 11:56 am

Have you told Subsonic what ports you are using for both SSL and non-ssl traffic in the Java Options in Tomcat?

I have in my Java Options:

Code: Select all
-Dsubsonic.port=8080
-Dsubsonic.httpsport=8443
-Dsubsonic.contextpath=/


Subsonic registers the correct address for me.

Glenn
Glenn Sullivan
Subsonic 5.2.1 (Standalone on Apache/Tomcat 6)
WHS 2003, Dual Core Athlon, 4 Gb RAM, 12 TB
50 regular Subsonic Users

Library as of 2016-03-21:
4,034 artists
16,595 albums
182,904 songs
4582.16 GB
21,558 hours
User avatar
bushman4
 
Posts: 867
Joined: Thu Dec 02, 2010 1:47 pm
Location: Massachusetts, USA

Re: How to Install Tomcat on Windows and Enable HTTPS / SSL

Postby GJ51 » Wed Oct 10, 2012 4:08 pm

No. I figured there had to be somewhere to tell Subsonic where the ports were, but I didn't know where to enter them.

Thanks.

EDIT: Success! - Thanks again Glenn.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: How to Install Tomcat on Windows and Enable HTTPS / SSL

Postby bushman4 » Wed Oct 10, 2012 5:04 pm

No problem. Sorry I couldn't come up with it when you PM'ed me a few weeks ago... must have been off my game!

Cheers,

Glenn
Glenn Sullivan
Subsonic 5.2.1 (Standalone on Apache/Tomcat 6)
WHS 2003, Dual Core Athlon, 4 Gb RAM, 12 TB
50 regular Subsonic Users

Library as of 2016-03-21:
4,034 artists
16,595 albums
182,904 songs
4582.16 GB
21,558 hours
User avatar
bushman4
 
Posts: 867
Joined: Thu Dec 02, 2010 1:47 pm
Location: Massachusetts, USA

Re: How to Install Tomcat on Windows and Enable HTTPS / SSL

Postby GJ51 » Fri Jun 06, 2014 7:11 pm

bushman4 wrote:Have you told Subsonic what ports you are using for both SSL and non-ssl traffic in the Java Options in Tomcat?

I have in my Java Options:

Code: Select all
-Dsubsonic.port=8080
-Dsubsonic.httpsport=8443
-Dsubsonic.contextpath=/


Subsonic registers the correct address for me.

Glenn


Anybody remember how/where to add/edit these Java Options for the war version on Windows?

Thanks

EDIT: Thanks to a kind contributor I received a PM that describes using the "Configure Tomcat" to edit the options.

There is a "configure tomcat" program that has a tab for "java" with "java options" as box.

I was able to find it on Win Server 2012 by just typing in "Tomcat" at the start screen.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests