1、修改环境变量设置
[root@HTML5 tomcat-2]# vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_60
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export TOMCAT1_HOME=/usr/local/tomcat/tomcat-1
export TOMCAT2_HOME=/usr/local/tomcat/tomcat-2
export CATALINA1_BASE=/usr/local/tomcat/tomcat-1
export CATALINA1_HOME=/usr/local/tomcat/tomcat-1
export CATALINA_2_BASE=/usr/local/tomcat/tomcat-2
export CATALINA_2_HOME=/usr/local/tomcat/tomcat-2
然后重新加载下source /etc/profile
2.、修改第二个tomcat端口
写道
<Server port="9005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<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>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="9080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the BIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="9009" protocol="AJP/1.3" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<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>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="9080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the BIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="9009" protocol="AJP/1.3" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
红色字体部分端口修改
3、修改tomcat-2/bin/catalina.sh,加入以下两行:
export CATALINA_BASE=$CATALINA_2_BASE
export CATALINA_HOME=$CATALINA2_HOME
相关推荐
NULL 博文链接:https://7shao.iteye.com/blog/1569798
学习时偶尔写的tomcat部署文档笔记,分享出来让大家多一个参考。
linux系统下可以实现多个tomcat同时使用,部署多个软件
1 一套新环境tomcat中还未部署服务 只需调整上传war包脚本顺序 先上传war后 后续操作正常执行 2 迭代更新 功能稍作修改 原配置项无需修改 也只需调整上传war包脚本顺序 先获取原有配置 再上传更新war包 后续操作...
Linux下Tomcat的启动、关闭、杀死进程
Linux 创建用户命令 Linux JDK 1.7 的安装 对jdk配置环境变量 Linux下tomcat8.0的安装 Linux如何部署多个tomcat 权限分配
Linux下使用tomcat发布Web项目
有时候我们需要在同一台服务器上部署多个tomcat,本文都是本人实践所得,中间经历了一些问题但是如果您能认真按照文档操作,应该没有问题,本文以windows平台为例,Linux平台也差不多,我自己也试过,希望能帮助您...
Linux 多tomcat服务 统一安装 统一部署 工具 shell编写 1 引言 基于JAVA开发项目,随着服务的越来越多,配置文件更是眼花缭乱,每次不知道因为配置问题浪费多少时间,更不知道因为配置问题出过多少问题。多台...
linux服务器配置多台tomcat,通过修改指定的tomcat配置已达到同一台服务器上部署多个tomcat,小公司或自己搞着玩,很实用(文章说明地址:http://blog.csdn.net/hgg923/article/details/77131922)
Nginx + Tomcat 反向代理 如何在一台服务器部署多个站点,节省服务器开支,就在这篇文章了。 首先我们需要安装好Nginx、jdk、Tomcat,安装方法已经在 上一篇 说过了,本篇不再赘述。 下来看一下我们的需求,我这里有...
Linux 单个tomcat多实例部署shell脚本详解 步骤: 1. 下载tomcat,解压安装 2.将tomcat下的webapps,conf,temp等目录分别拷至根目录www下A,B,C目录下 3.新建如下脚本restart_tomcat.sh 4.使用restart_tomcat.sh A/B/C ...
tomcat部署war项目的一般操作,从打包,上传,启动项目,查看日志,备份war包,入门操作教程。
首先你得有一台可以玩的linux服务器,知道用户名和密码,然后你需要在windows电脑上安装两个可以连上linux服务器的工具,Xshell 5和Xftp 5,安装教程不多说,补图说明如何连上服务器: xshell连接界面如下,输入...
jdk安装 tomcat安装 多个tomcat设置 oracle安装 linux下常用的命令
网络与通信:数据传输、信号处理、网络协议、网络与通信硬件、网络安全网络与通信是一个非常广泛的领域,它涉及到计算机科学、电子工程、数学等多个学科的知识。 云计算与大数据:包括云计算平台、大数据分析、人工...
文章目录认识tomcat下载安装目录解读启动查看日志访问访问可能遇到的错误关闭tomcat部署项目简单部署8080端口单项目多端口配置多项目server文件需要更改的地方简述部署多个springboot项目遇到的坑配置无需war包名...
每个服务提供一个配置文件,方便管理与扩展。 bin : 提供总执行与单一执行脚本,脚本通过自动化获取配置,便于维护与扩展。 bak : 保留获取原配置文件,便于问题分析。 temp : 临时文件将及时删除无任何冗积。 tools...
linux环境下部署tomcat的教程文档(包含jdk的源码安装等),带有tomcat重启脚本; Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍...
Linux 中的tomcat远程调试代码 1,是要编辑catalina.sh文件。 而且要改成这 样: CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp :transport=dt_socket,server=y,suspend=n,address=...