Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Using the same port on Apache and Tomcat

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there
I am using the newest Apache (2.2.10) and the newest Tomcat (6.0.18) on a Windows 2003 server. My question now is, if it is possible to have the Tomcat and the Apache running on the same Port (e.g. 80)? I already found a tutorial explaining about how it could be done, but it is for a much older version of Tomcat and Apache (http://www.dynamicobjects.com/d2r/archives/002574.html). Does it still work the same way, or do I have to do something differently?
Thanks already in advance!

Mantz
 
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, it cannot be done. Servers require exclusive access to the port they bind to.
What you see in the tutorial you linked is setting up the Tomcat connector in both Apache and Tomcat. Apache is running on port 80 (the URL the tutorial is http://localhost/test.jsp). That request gets passed to the connector, then to Tomcat listening on 8009.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The up-to-date instructions on how to make Apache httpd and Tomcat play nice can be found at http://tomcat.apache.org/connectors-doc/ and http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html

While technically both servers aren't listening to the same port (for the reason Joe mentioned), from the outside it looks like they do. So if httpd runs on port 80, then the user will never see a port number, whether the content comes from httpd or Tomcat.
 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic