发布网友 发布时间:2022-04-22 03:30
共2个回答
热心网友 时间:2022-04-08 02:58
(1)下载apache-tomcat-7.0.30.tar.gz
(2)解压:tar -zxvf apache-tomcat-7.0.30.tar.gz
(3)复制到/usr/local下并重命名为tomcat7:sudo cp -R apache-tomcat-7.0.30 /usr/local/tomcat
(4)进入tomcat7下的bin目录: cd /usr/local/tomcat7/bin
(5)启动Tomcat7:sudo ./startup.sh
显示:Using CATALINA_BASE: /usr/local/tomcat7
Using CATALINA_HOME: /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME: /usr/Java/jdk1.7.0_07
Using CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
(6)关闭Tomcat7:sudo ./shutdown.sh
显示:Using CATALINA_BASE: /usr/local/tomcat7
Using CATALINA_HOME: /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME: /usr/Java/jdk1.7.0_07
Using CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
(7)添加Tomcat环境变量:sudo vi /etc/profile,红色部分
#set environment variable
export JAVA_HOME=/usr/java/jdk1.7.0_07
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export TOMCAT_HOME=/usr/local/tomcat7
export CATALINA_HOME=/usr/local/tomcat7
export PATH=$PATH:$JAVA_HOME/bin
(8)使配置生效:sudo source /etc/profile。
(9)默认情况下,Tomcat并没提供具有管理权限的账号,所以需要添加具有这种权限的账号。角色manager-gui具有这种权限,但在系统用户控制文件tomcat-users.xml中并没有设置这两种角色和对应的用户,所以需要添加这种角色和用户,方法是打开tomcat-users.xml文件,添加如下内容:
<role rolename="manager-gui"/>
<user username="manager" password="manager" roles="manager-gui"/>
然后重启Tomcat服务器,文件修改生效。
热心网友 时间:2022-04-08 04:16
#!/<a
href="https://www.baidu.com/s?wd=bin&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YYuWcYn1csPjPhn1bLuW610ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHTdPHfdP10dPH04Pj6kP1nYr0"
target="_blank" class="-highlight">bin</a>/bash
#
# tomcat startup script for the Tomcat server
#
# chkconfig: 345 80 20
# description: start the tomcat deamon
#
# Source function library
. /etc/rc.d/init.d/functions