LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 03-31-2008, 04:07 AM   #1
nomis
LQ Newbie
 
Registered: Mar 2008
Posts: 7

Rep: Reputation: 0
it is neccessary to install both server tomcat5 and apache2 for running JSP with SSL


hi
i m new in OpenSource i have two questions

1. Can any one tell me if i m running my JSP page using Tomcat5 as web server and want to configure SSL on Tomcat5 is that necessary to install Apache2.

2. i properly generate keystore

keytool -genkey -alias tomcat -keyalg RSA \
-keystore <your_keystore_filename>

then generate CSR

keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr \
-keystore <your_keystore_filename>

ok the detail i enter while generate CSR is

YourName : localhost

rest of the option of generating CSR i m not mention here and send to certificate authority. Certificate authority send me 5 files
which i properly install by using following command

keytool -import -trustcacerts -alias root -file AddTrustExternalCARoot.crt -keystore mykeystore.key
keytool -import -trustcacerts -alias addtrust -file UTNAddTrustServerCA.crt -keystore mykeystore.key
keytool -import -trustcacerts -alias ComodoUTNServerCA -file ComodoUTNServerCA.crt -keystore mykeystore
keytool -import -trustcacerts -alias EssentialSSLCA -file EssentialSSLCA.crt -keystore mykeystore
keytool -import -trustcacerts -alias tomcat -file localhost.crt -keystore mykeystore

if there is any mistake in above please correct me. Then amendments in my server.xml which reside tomcat55/bin/conf/


<-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector
port="443" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true";
clientAuth="false" sslProtocol="TLS" keystorefile-"$JAVA_HOME/bin/mykeystore.key" keypass="123456"/>
-->

after that i restart my tomcat and try to access https://locahost:8443/ i got following error

Unable to connect

Firefox can't establish a connection to the server at localhost:8443.

* The site could be temporarily unavailable or too busy. Try again in a few
moments.

* If you are unable to load any pages, check your computer's network
connection.

* If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web

Appreciation in advance
 
Old 04-01-2008, 02:09 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
1. Nope, you can use just tomcat
2.
Remove the comment tags ( <!-- ... -->) around the Connector element, restart tomcat and try again. I.e. you should have:
Code:
<-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->

<Connector
port="443" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true";
clientAuth="false" sslProtocol="TLS" keystorefile-"$JAVA_HOME/bin/mykeystore.key" keypass="123456"/>

Last edited by bathory; 04-02-2008 at 01:41 AM.
 
Old 04-01-2008, 11:32 PM   #3
nomis
LQ Newbie
 
Registered: Mar 2008
Posts: 7

Original Poster
Rep: Reputation: 0
i already did but still its no working when i trying to access any https website its not allow me to access it any clue ??
 
Old 04-02-2008, 02:07 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Does tomcat running? Is port 8443 listening? What are the logs saying?
Replace @JAVA_HOME in the Connector definition with the actual full path to java:
Code:
<Connector
port="443" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true";
clientAuth="false" sslProtocol="TLS" keystorefile-"/path/to/java/bin/mykeystore.key" keypass="123456"/>
and see what happens

Regards
 
Old 04-04-2008, 04:42 AM   #5
nomis
LQ Newbie
 
Registered: Mar 2008
Posts: 7

Original Poster
Rep: Reputation: 0
i did but still showing same error

Firefox can't establish a connection to the server at localhost:8443.
 
Old 04-04-2008, 05:55 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Is tomcat running?
Code:
ps -ef|grep tomcat
Is it listening on port 8443?
Code:
 netstat -tanpl|grep 8443
If not take a look at tomcat logs, specially catalina.out and localhost-date-xyz.log to see if you find the reason.
 
Old 04-05-2008, 02:18 AM   #7
nomis
LQ Newbie
 
Registered: Mar 2008
Posts: 7

Original Poster
Rep: Reputation: 0
i get following error

INFO: Starting Coyote HTTP/1.1 on http-8080
Apr 5, 2008 8:08:13 AM org.apache.coyote.http11.Http11BaseProtocol start
SEVERE: Error starting endpoint
java.io.FileNotFoundException: /usr/share/tomcat55/.keystore (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:284)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:227)
at org.apache.tomcat.util.net.jsse.JSSE14SocketFactory.getKeyManagers(JSSE14SocketFactory.java:142)
at org.apache.tomcat.util.net.jsse.JSSE14SocketFactory.init(JSSE14SocketFactory.java:111)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:89)
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:293)
at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:313)
at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.java:151)
at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:76)
at org.apache.catalina.connector.Connector.start(Connector.java:1090)
at org.apache.catalina.core.StandardService.start(StandardService.java:457)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Apr 5, 2008 8:08:13 AM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.io.FileNotFoundException: /usr/share/tomcat55/.keystore (No such file or directory)
at org.apache.catalina.connector.Connector.start(Connector.java:1097)
at org.apache.catalina.core.StandardService.start(StandardService.java:457)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Apr 5, 2008 8:08:13 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 987 ms
"catalina.2008-04-05.log" 92L, 6844C
 
Old 04-05-2008, 02:21 AM   #8
nomis
LQ Newbie
 
Registered: Mar 2008
Posts: 7

Original Poster
Rep: Reputation: 0
i store my mykeystore.key in /usr/lib/jvm/java/bin/mykeystore.key is that n e problem if i m store in $JAVA_HOME
 
Old 04-05-2008, 02:51 AM   #9
nomis
LQ Newbie
 
Registered: Mar 2008
Posts: 7

Original Poster
Rep: Reputation: 0
i am already mention in my sever.xml file where is keystore file and store password. Here is my server.xml file details

<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<Connector port="443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystorefile="/usr/lib/jvm/java/bin/mykeystore.key" keypass="123456" />
 
Old 04-07-2008, 01:43 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
Apr 5, 2008 8:08:13 AM org.apache.coyote.http11.Http11BaseProtocol start
SEVERE: Error starting endpoint
java.io.FileNotFoundException: /usr/share/tomcat55/.keystore (No such file or directory)
Are you sure you're using the correct tomcat installation (i.e the correct server.xml)? Why is tomcat looking for the keystore under /usr/share/tomcat55?
 
Old 04-15-2008, 11:44 PM   #11
nomis
LQ Newbie
 
Registered: Mar 2008
Posts: 7

Original Poster
Rep: Reputation: 0
hey guyz i resolve my problem but thanks for all members who share there experiences.
actually when we generating keystore so by default tomcat5.5 save ".keystore" file in "usr/share/tomcat55/.keystore".
so save your keystore file at tomcat by default location, i hope its help other
thanks
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP? nicolasdiogo SUSE / openSUSE 2 04-05-2007 09:06 AM
tomcat5 -jsp compile error gv_rajasekhar Programming 1 09-20-2006 05:51 AM
LXer: Setting up an SSL server with Apache2 LXer Syndicated Linux News 0 02-12-2006 09:31 PM
how to connect apache2.0.52 and tomcat5.5.12 manjulbhatt Linux - Enterprise 1 02-04-2006 01:52 AM
SuSE 9.2 - apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP? nicolasdiogo Linux - Networking 2 03-20-2005 08:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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