安装配置tomcat环境
安装配置tomcat环境
#所需要软件包
apache-tomcat-7.0.65.tar.gz
jdk-7u80-linux-x64.gz
#建立 个专用账户
usradd tomcat
#安装tomcat
tar xf apache-tomcat-7.0.65.tar.gz
mv apache-tomcat-7.0.65 /apps/tomcat-7.0.65
ln -s /apps/tomcat-7.0.65 /apps/tomcat
chown -R tomcat.tomcat /apps/tomcat-7.0.65 /apps/tomcat
#JDK安装及环境变量配置
tar xf jdk-7u80-linux-x64.gz
mv jdk-7u80-linux-x64 /apps/jdk-7u80
ln -s /apps/jdk-7u80 /apps/jdk
chown -R tomcat.tomcat /apps/jdk-7u80 /apps/jdk
echo 'export JAVA_HOME=/apps/jdk
export JRE_HOME=/apps/jdk/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH' >>/etc/profile
#tomcat启动停止
echo "runuser -l tomcat -c /apps/tomcat/bin/startup.sh" >>/etc/rc.local
#查看是否安装成功
ss -anp|grep java
#停止tomcat服务
/apps/tomcat/bin/shutdown.sh
#指定tomcat账户来启动服务
runuser -l tomcat -c /apps/tomcat/bin/startup.sh