Tomcat's default port is 8080(default port for most browsers is 80). Sometimes you may encounter port conflicts when two applications try to share the same port. If this happens with Tomcat, you will have to change the Tomcat's default port to a different one depending on the availability of that port. If a port is causing an error in a web application, you will often see a "Page can not be displayed" error message(but bear in mind that there can be other reasons that cause the browser to display this message). In this short post I will show you how to change the default port of Tomcat using its configuration files.
- Open the Tomcat home directory(in my case, this is named apache-tomcat6.0.20).
- Go to its bin folder.
- Open the server.xml file using Notepad(right click>Edit).
- Replace all occurrences of 8080 with a number larger than 1024(although it is not mandatory to select a port higher than 1024 if you are using Windows as your OS, it is a good practice to get anything higher than 1024. There are reasons for this but I'm not going to discuss about them here since it is beyond the scope of this article)
- Finally, restart Tomcat and test it for some URLs.
You may also like to have a look at the post about
how to download and install Apache Tomcat6.0.20
So that's how you change Tomcat's port manually. It wasn't that difficult was it?
0 comments:
Post a Comment