您的位置:首页 > 运维架构 > Tomcat

tomcat installation and configuration guide

2013-05-10 12:52 477 查看
Tomcat installation guide

1. download tomcat from http://tomcat.apache.org/download-70.cgi , please download stable version.

2. uncompress the downloaded installation file to /usr.

3. go to the conf directory and modify the connector port in web.xml if necessary.

4. change tomcat-users.xml if want to access by browser

example:

<tomcat-users>

<user username="both" password="tomcat" roles="tomcat,role1,manager-gui"/>

</tomcat-users>

5. config the Environment Variable as follows:

a. vi /etc/profile

b. CATALINA_BASE = /usr/apache-tomcat-*.*.*

CATALINA_HOME = /usr/apache-tomcat-*.*.*

c. export CATALINA_BASE

export CATALINA_HOME

d. source /etc/profile

6. use ./startup.sh to run.

configure more than one tomcat on one server by following steps:

1. uncompress the installation file to a new directory, for example, /usr/tomcatServer2

2. add two new environment variables :

a. vi /etc/profile

b. CATALINA_BASE2 = /usr/tomcatServer2

CATALINA_HOME2 = /usr/tomcatServer2

c. export CATALINA_BASE2

export CATALINA_HOME2

d. source /etc/profile

3. edit tomcatServer2/bin/catalina.sh, change all CATALINA_BASE and CATALINA_HOME into CATALINA_BASE2 and CATALINA_HOME2 respectively

4. edit tomcatServer2/conf/server.xml, change all the port number from 8*** to 9***

example:

<Connector port="9080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="9443" URIEncoding='UTF-8'/>

=====================

<Connector port="9009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" redirectPort="9443" URIEncoding='UTF-8'/>

5. cd to /usr/tomcatServer2/bin, then use command "sh startup.sh" to run tomcat.

reference:
http://www.cnblogs.com/itolssy/archive/2008/08/27/1278041.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: