A_J
A_J

Reputation: 1003

possible values of port numbers of Tomcat and required changes in server.xml

Which are the possible values of port numbers we can give for Tomcat in Eclipse ? I know that port numbers are ranging from 0-65535, as shown here, but is there any preferred range? Should it consist of 4 digits?

Also, when changing those port numbers in Eclipse, why don't we need to change the port number in Tomcat's server.xml file too?

Upvotes: 1

Views: 2233

Answers (1)

JorgeGRC
JorgeGRC

Reputation: 1052

You can use whatever number you like, just don't pick one too small to make sure it's not already in use by some service, like 21, 80, 22.. etc

For reference, see this list here. This list covers a lot of ports used by different services, but I bet you don't have them all running on your machine, so it won't be a problem if you don't plan using that specific service.. If you want to avoid this kind of issues, there's a really big range to pick a number that is not listed.

Also, when changing those port numbers in Eclipse, why don't we need to change the port number in Tomcat's server.xml file too?

If you want to change the tomcat listening port you will need to change it on the server.xml.. you can find a good tutorial on how to do it here.

You always have to change your server.xml content in order to change this tomcat port, but you might be doing it using the user interface Eclipse offers, like in this other tutorial, but in the end, it's just the same, Eclipse modifies the server.xml for you.

Upvotes: 2

Related Questions