File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Should Tomcat listen on port 80? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Should Tomcat listen on port 80?" Watch "Should Tomcat listen on port 80?" New topic

Should Tomcat listen on port 80?

Hank Jordan

Joined: Oct 23, 2006
Posts: 11
Hello, all. I currently have Apache listening on port 80 and Tomcat on port 8080. Therefore, in order to access a JSP or servlet, the client must append :8080 to the web site address. This works well enough, but I would rather not have the port number in the URL. Is the correct way to handle this to shut down Apache and configure Tomcat to listen on port 80? Or is it possible to have Apache somehow forward requests for JSPs and servlets to Tomcat? In case it makes a difference, I am running Apache 1.3 and Tomcat 4.1 on Mac OS X 10.3.9. Thanks in advance!
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Only on server can bind to a given port at one time.
The standard way of doing this is to use to have Apache httpd pass requests to Tomcat via a connector.
Here is the page for connectors:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Stu Thompson
Ranch Hand

Joined: Jun 14, 2006
Posts: 136
Depending on what you need your http server to do, you could consider dumping apache httpd and using only tomcat. if your httpd is servering up only static content with no PHP or interesting http.conf tweaks, then this might be a serious option for you.

"This is not to say that design is unnecessary. But after a certain point, design is just speculation." --Philip Chu
Hank Jordan

Joined: Oct 23, 2006
Posts: 11
Thanks for your responses. Now that I understand the options, I looked around on the web, and I see that there are many factors involved in the decision whether to use Apache httpd and Tomcat together, or Tomcat stand-alone. For now I will go with using the two together because it seems to offer the greatest flexibility, and it seems like it would be relatively straightforward to switch to Tomcat stand-alone if that seems appropriate down the road. Thanks again for your help!
I agree. Here's the link:
subject: Should Tomcat listen on port 80?
It's not a secret anymore!