This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Running Tomcat without port number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Running Tomcat without port number" Watch "Running Tomcat without port number" New topic

Running Tomcat without port number

Nicky narayan

Joined: Jul 01, 2009
Posts: 27
Can we able to run Tomcat without Port number?
Actually i got this query in the interview.

Please tell me if any one knows the proper answer.

Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
It sounds like they asked you slightly different question. It could be something like "Can you access Tomcat without specifying a port number?". Is this correct?
Nicky narayan

Joined: Jul 01, 2009
Posts: 27
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63053


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
You could change default port 8080 to 80
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

There are two default ports for web traffic.

80 is used for non-secure (http://) connections.
443 is used for secure (https://) connections.

By default Tomcat is configured to run on ports 8080 and 8443.
There are a couple of reasons for this.
1.) Tomcat, in its early days was almost always run behind another web server like Apache HTTPD which would already be bound to ports 80 and 443
2.) On *nix machines only applications started by the root user can bind to ports under 1025 and application servers shouldn't be run as root

If you want to run Tomcat on the default ports on a windows box, simply edit server.xml.
Look for the <Connector ... /> entries and you will find the port attributes.

After editing, you'll need to restart Tomcat.

On *nix machines there is a little more to it.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Running Tomcat without port number
It's not a secret anymore!