这篇文章主要介绍“怎么用单台服务器部署多个tomcat”,在日常操作中,相信很多人在怎么用单台服务器部署多个tomcat问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么用单台服务器部署多个tomcat”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
修改tomcat配置文件,配置文件位置:tomcat根目录/conf/server.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- >>>>>>>>>>>>>>>>>>>>这里需要修改3-1(tomcat的shutdown端口)<<<<<<<<<<<<<<<<<<<<<< --> <!-- <Server port="8005" shutdown="SHUTDOWN"> --> <Server port="8006" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service name="Catalina"> <!-- >>>>>>>>>>>>>>>>>>>>这里需要修改3-2(http访问端口)<<<<<<<<<<<<<<<<<<<<<< --> <!-- <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="60000" redirectPort="8443" /> --> <Connector port="8081" protocol="HTTP/1.1" connectionTimeout="60000" redirectPort="8443" /> <!-- >>>>>>>>>>>>>>>>>>>>这里需要修改3-3(JVM启动端口)<<<<<<<<<<<<<<<<<<<<<< --> <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> --> <Connector port="8010" protocol="AJP/1.3" redirectPort="8443" /> <Engine name="Catalina" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server>
到此,关于“怎么用单台服务器部署多个tomcat”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。