Changing default HTTP Port 80 in Tomcat


The default HTTP port is 8080 and it is configured in the HTTP connector. Open the TOMCAT-HOME/conf/server.xml file and search for the following.
 
       <connector port="8080" protocol="HTTP/1.1" 
                  connectiontimeout="20000" 
                  redirectport="8443"/>  
Now let's say you want to change the port to 80, which is the standard HTTP port. You can do this by changing the value of port attribute as show below.
 
       <connector port="80" protocol="HTTP/1.1" 
                  connectiontimeout="20000" 
                  redirectport="8443"/>  

java.net.BindException: Address already in use:8080

Some time you may encounter this error when trying to start tomcat server. This is because the port 8080 is already being used by some other application. The solution is to change the tomcat port from 8080 to some thing else as explained above.

No comments:

Post a Comment