Problem setting up Apache, tomcat, SSL.(146) Connection refused.

Hi Experts,

I have successfully setting up my apache2 web server, which is running jsp (tomcat5.0, jk2 connector).
Now, I need to set up my SSL at
What I have done is:
1) Create a local key pair using the following command:
openssl genrsa -dec3 -out 1024
2) Create a self-signed certificate
openssl req -new -key domainname.key -x509 -out sslname.crt

3) Edit my httpd.conf
a) Enable my SSL
<IfDefine SSL>
LoadModule ssl_module modules/

b) Configure my site
<IfDefine SSL>
DocumentRoot    /www/tomcat5.0/webapps/sitename
DirectoryIndex  index.jsp
Errorlog        logs/sitename-error_log
TransferLog     logs/sitename-access_log
SSLEngine       on
SSLCertificateFile      /usr/local/ssl/bin/ssslname.crt
SSLCertificateKeyFile   /usr/local/ssl/bin/
SetEnvIf User-Agent     ".*MSIE.*" nokeepalive ssl-unclean-shutdown

4) Reboot Apache

However, when I try to connect to
The error message was (146) Connection refused.

My questions are:
1) Are my above configuration correct?
2) Do I have to do any setting in my tomcat server.xml?
If yes, what are the setting
3) Do I need to do any setting for the JK2 connector?
If yes, what are the setting.

Thank you very much

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Add this line to your httpd.conf file:

Listen 443
totoronAuthor Commented:
Thanks. I have added the above line.

However I still encounter some problem.
I could see my web site at
But I couldn't see any SSL secure sign at the bottom of my IE.

And I couldn't view it with

Any solutions?

      <IfDefine SSL>
      LoadModule ssl_module modules/

just write:

      LoadModule ssl_module modules/

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Or if you need <IfDefine SSL>

then call apache with option: -D SSL

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
And some error log would be great why isn't works...
totoronAuthor Commented:
Thanks. It works. if I specified it with -D SSL.
By the way. Is it possible to make that I just need the login page to enable the https ?
while the rest of the pages I don't need https
There are many solution, but if you need only one page to be server through ssl, then i thin best solution is check inside file.

PHP example:

Put this code at begining of your php file:

      if ( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on' ) {
         header ('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);

totoronAuthor Commented:
thanks a million
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.