File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Running Tomcat without port number" Watch "Running Tomcat without port number" New topic
Author

Running Tomcat without port number

Nicky narayan
Greenhorn

Joined: Jul 01, 2009
Posts: 27
Hi,
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.


Nicky
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
Greenhorn

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

Joined: Jan 10, 2002
Posts: 61315
    
  66

Yes.


[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
Sheriff

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
 
GeeCON Prague 2014
 
subject: Running Tomcat without port number