Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes How to configure tomcat  - 8080 for HTTP & 8181 for HTTPS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to configure tomcat  - 8080 for HTTP & 8181 for HTTPS" Watch "How to configure tomcat  - 8080 for HTTP & 8181 for HTTPS" New topic
Author

How to configure tomcat - 8080 for HTTP & 8181 for HTTPS

Robert Jack
Ranch Hand

Joined: Apr 13, 2010
Posts: 46
Hi,

I deploy sample.war in my tomcat6.0.

I want to access

http://localhost:8080/sample/

https://localhost:8181/sample/

Is possible? if possible, how can i change my configuration?

This is my ../tomcat/conf/server.xml



Help me.
Thanks in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

Port 8080 is the default setting for HTTP with Tomcat. For HTTPS, the default setting is 8443, corresponding to the HTTPS default port of 443. So to use 8181 instead, just change the "8443"s in the Tomcat server.xml to "8181"s.

Of course you also have to setup the keystore in the usual way before you can do HTTPS at all, but that's a different matter.


Customer surveys are for companies who didn't pay proper attention to begin with.
Robert Jack
Ranch Hand

Joined: Apr 13, 2010
Posts: 46
Now modified my tomcat/conf/server.xml.
i got the following message in my browser when i try https://localhost:8181/
'Unable to connect
Firefox can't establish a connection to the server at localhost:8181.
"

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
Have you restarted Tomcat after making this change and doing everything else outlined in http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html ?


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to configure tomcat - 8080 for HTTP & 8181 for HTTPS
 
Similar Threads
Unable to start JBoss 5
Unsupported response content type "text/html", must be: "text/xml".
accessing jsp project from LAN
port
Multiple instance of Tomcat