Why do you have to use port 8080 to use tomcat?

Why do you have to use port 8080 to use tomcat?
Ans: The default port for http servers is 80. Tomcat defaults to using port 8080 instead to avoid an installation of tomcat automatically being seen as a public web server. Instead, tomcat be can setup and tested first using port 8080 and switched to port 80 when ready for normal use. In fact, tomcat is widely used as a development tool, so many users won’t want it to be a standard web server anyway – they will use it to develop web applications that are then installed on a production server elsewhere. On Unix systems there is also the issue that ports below 1024 are protected and can only be made available with root permission, so ordinary users would not be able to immediately use tomcat if it defaulted to port 80.
You can change tomcat’s default port by editing the conf/server.xml file. Look for the following Connector definition near the top of the file:
<!– Define a non-SSL HTTP/1.1 Connector on port 8080 –>
<Connector className=”org.apache.catalina.connector.http.HttpConnector”
port=”8080″ minProcessors=”5″ maxProcessors=”75″
enableLookups=”true” redirectPort=”8443″
acceptCount=”10″ debug=”0″ connectionTimeout=”60000″/>
To change the port number, change the 8080 to whatever port is needed. Note, that on Unix you will not be able to use a number below 1024 (unless you have root permissions on the machine you are using).

Leave a Comment