发布网友 发布时间:2022-04-24 17:56
共1个回答
热心网友 时间:2023-10-29 01:59
下载tomcat
将tomcat解压缩到/usr/local/tomcat/下面
tar -zxvf apache-tomcat-7.0.67.tar.gz
进入/usr/local/tomcat/apache-tomcat-7.0.67/bin下,检查JAVA_HOME环境变量是否生效存在
[root@bogon bin]# echo $JAVA_HOME
/usr/java/jdk1.8.0_65
确定JAVA_HOME正常出来后,就直接启动tomcat了。
[root@bogon bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-7.0.67
Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-7.0.67
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-7.0.67/temp
Using JRE_HOME: /usr/java/jdk1.8.0_65
Using CLASSPATH: /usr/local/tomcat/apache-tomcat-7.0.67/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-7.0.67/bin/tomcat-juli.jar
Tomcat started.
查看tomcat运行时日志:
进入/usr/local/tomcat/apache-tomcat-7.0.67/logs下面执行
[root@bogon logs]# tail -f catalina.out
一月 08, 2016 6:29:56 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory /usr/local/tomcat/apache-tomcat-7.0.67/webapps/manager
一月 08, 2016 6:29:56 下午 org.apache.catalina.startup.HostConfig deployDirectory
如果形成自动化安装脚本:
cd /usr
mkdir -p local/tomcat
mv apache-tomcat-7.0.67.tar.gz local/tomcat
cd local/tomcat
tar -zxvf apache-tomcat-7.0.67.tar.gz
source /etc/profile
cd apache-tomcat-7.0.67/bin
./startup.sh
7
有关tomcat端口、字符集、软连接等配置,和windows下一样的。
端口,URI编码配置: