• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running Tomcat without port number

 
Nicky narayan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could change default port 8080 to 80
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic