• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Tomcat7- How to configure one VHost-> port 8443(SSL) and another VHost--> port 8080(non SSL)

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have installed Tomcat 7 and java 1.6 on my Ubuntu 12.04 x64 VPS.
I am trying to set up a tomcat 7 server in this way-


domain1.com--> is a vhost with its own deployment directory.
domain2.com--> is a vhost with its own deployment directory.

Now, I have created and installed an SSL Certificate corresponding to domain1.com. I have also installed APR connector for Tomcat and added the config entry for SSL @ port 8443 --> tomcat's server.xml.

I have also left the connector for port 8080 as it is(unchanged).

Now, when I try to access http://<IP_ADDRESS>:8080/manager/html/
it works. And the host manager app also works at the IP address and port=8080. Now I have added 2 VHOSTS--> domain1.com and domain2.com. This also happens successfully.

However the following :
gives a error --

"Webpage is not available-- Error 102 (net::ERR_CONNECTION_REFUSED): The server refused the connection."



While gives error-

HTTP Status 404 - /manager/html

type Status report

message /manager/html

description The requested resource (/manager/html) is not available.

Apache Tomcat/7.0.26

 
Saloon Keeper
Posts: 23280
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Ana Tech",

We don't have many rules on the JavaRanch, but one that we are quite serious about is that people use their real names. No "handles", aliases, or company names. If you're not sure about this, see
http://www.javaranch.com/name.jsp .
 
Arvind Ik Chari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

I was not aware of that- I have filled in the name change request form.

Sincerely,
Arvind.
 
Tim Holloway
Saloon Keeper
Posts: 23280
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.

Tomcat's architecture is such that ports are assigned at a very high level in the server. So you really cannot assign a specific port to a specific app or virtual host.

There's a recent thread in this forum where someone did want, in fact to reserve a special port number to an administrative app and we discussed this sort of thing in detail. You might want to search for that thread and read it.

You can use a front-end routing/proxy program such as Apache HTTPD to route traffic to a selected virtual host/application based on its URL format (including whether it's http or https), but Tomcat can't be set up to listen selectively.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this link. I think it explains exactly how to accomplish this, either using a Tomcat port or without through mod_jk and Apache2 vhost.

http://kahimyang.info/kauswagan/howto_blogs/1464-2_ways_to_setup_ssl_on_tomcat_7
 
reply
    Bookmark Topic Watch Topic
  • New Topic