CentOS7,安裝Tomcat8.5、JDK1.8,並設置開機啟動(Linux CentOS Tomcat、JDK+Tomcat、Tomcat開機自啟動)
阿新 • • 發佈:2019-01-27
span con 分享 xxxxxxxx add one center sta 添加
1、下載JDK1.8、Tomcat8
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
http://tomcat.apache.org/download-80.cgi
2、解壓文件 tar -zxvf xxxxxxxxxxxxx.gz
jdk放到 /usr/local/javajdk tomcat放到 /usr/local/tomcat
3、設置jdk環境變量
4、啟動tomcat
5、設置開機自啟動
如果要開機自啟動tomcat,配置如下:
(完)
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
http://tomcat.apache.org/download-80.cgi
2、解壓文件 tar -zxvf xxxxxxxxxxxxx.gz
jdk放到 /usr/local/javajdk tomcat放到 /usr/local/tomcat
3、設置jdk環境變量
vi /etc/profile
#在底部添加
JAVA_HOME=/usr/local/javajdk
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
export PATH JAVA_HOME CLASSPATH
source /etc/profile
4、啟動tomcat
/usr/local/tomcat/bin/startup.sh
#/usr/local/tomcat/bin/shutdown.sh
firewall-cmd --zone=public --add-port=8080/tcp --permanent
sudo firewall-cmd --reload
5、設置開機自啟動
如果要開機自啟動tomcat,配置如下:
chmod +x /etc/rc.d/rc.local
vi /etc/rc.d/rc.local
export JAVA_HOME=/usr/local/javajdk
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
/usr/local/tomcat/bin/startup.sh
(完)
CentOS7,安裝Tomcat8.5、JDK1.8,並設置開機啟動(Linux CentOS Tomcat、JDK+Tomcat、Tomcat開機自啟動)