多个tomcat同时在一台机器上运行的端口配置方法

多个tomcat同时在一台机器上运行的端口配置方法:

  • 配置Server port

在tomcat\conf下的server.xml中找到server:

<Server port =” 8005″shutdown=”SHUTDOWN”>

将端口8005改为与其他tomcat server port不同的端口。

  • 配置连接端口

<Connector port=”8080″ protocol=”HTTP/1.1″

connectionTimeout=”20000″

redirectPort=”8443″ URIEncoding=”UTF-8″/>

修改port和redirectPort与其他tomcat相应端口不同。port将是系统访问的端口,例如服务器ip为10.217.224.132,port配置8080,则访问地址以http://10.217.224.132:8080开头。

  • 配置Connector

<Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ />

该部分port及redirectPort与其他tomcat相应端口不能相同。并且redirectPort端口与上面Connector中的redirectPort端口必须一致。

端口号全部配置完成后,可双击所有tomcat\bin\startup.bat,看是否能够全部运行成功。

This entry was posted in Java. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s