Port 80 is the conventional (default) port for the HTTP protocol. In other words, any URL in the form "http://www.server.com" is effectively just a shorthand for "http://www.server.com:80".
Any program that wants to can listen on port 80, although in some OS's, it will have to have special privileges since there's an old convention that ports below 4096 are "protected". Most often you'll find the Apache HTTP server there, although any webserver can live there. IIS is also serving port 80. And, of course, you may not have any webserver installed and listening to port 80 at all.
80 is just a number. I could just as easily configure a mail server to listen on port 80, except that it would be really confusing.
An IDE is no substitute for an Intelligent Developer.
Joined: May 16, 2006
Thanks Misha, Tim again. Do you guys work in tandem?
Anyways...Misha I took a look at server.xml. I believe this line does the trick
<Connector port="8080" .....
I can change it to some other port number.
About port 80, I am still not sure. Can I change the above line to say ><Connector port="80" .....?
Also if I understood you correctly Tim, that means most of the web servers in use are configured for port 80, so that users need not type in the port number.
For example, the web server hosting javaranch.com would be set on port 80 and hence we can get away by requesting www.javaranch.com instead of www.javaranch.com:<some port number other than 80>
Am I right?
You're on track! Yes, JavaRanch does respond to http on port 80. And yes, you can - and people often do -set Tomcat's http port to 80 just like you said. The only requirement is that no other application can have opened port 80 for listening first, since no more than one program can own a given port number. The netstat command can be used to check for ports in use.
Tomcat actually uses about 5 different ports, more or less, including the http port (8080), https port (8443), the AJP (Tomcat connector) port and a control port. And I think I've forgotten 1 or 2. However, it's up to you which ports to relocate (if any). Tomcat doesn't care, as long as what comes in is consistent with the protocol that that particular port is intended to handle.