Changing the default port numbers
config-substitutions.properties file lets you specify a totally new set of ports and define an automatic port offset for when you run multiple servers (or instances of the same server). Other than that, you can define different variables and their substitution values in this file, which will be used when processing the corresponding config.xml. These substitution values can be overridden by environment variables and system properties by prefixing the property name with
For example, an entry such as
hostName=localhost can be overridden by an environment variable or system property
Although this section is focusing on changing these settings by updating a properties file, there is an alternative way by using the Geronimo administrative console which is explained in more detail under the Configuring the Web Container section. However, if you have port conflicts at start up time the Geronimo administrative console will not be available, so we have to focus on configuring the
config-substitutions.properties file by choosing a new PortOffset value (the default is 0).
The following example shows the
config-substitutions.properties file for the Tomcat distribution of Geronimo. The file provided with the Jetty distribution is nearly identical. Changes to the file should be made when the server is stopped.
There are a number of reasons why you might want to use other port numbers than those provided by default. Most common startup problems are in fact associated with port conflicts. You can use monitoring utilities like Active Ports that will quickly tell you what application or process is using what port so you can customize Geronimo's ports accordingly. On Unix-like platforms, you can always use something like
netstat -nao | grep -i list to get the ports in use along with what application is holding that port. Alternatively, you can use
netstat -nab on a Windows platform.