linux 非root使用者安裝 jdk 和 tomcat
阿新 • • 發佈:2019-01-09
四、部署 tomcat
1、將apache-tomcat-6.0.20.tar.gz上傳到伺服器上
2、解壓檔案,出現目錄 apache-tomcat-6.0.20
- [[email protected]_test ~]$ tar zxvf apache-tomcat-6.0.20.tar.gz
- [[email protected]_test ~]$ vi .bash_profile
- export CATALINA_BASE=/home/sgmm/apache-tomcat-6.0.20
-
export CATALINA_HOME=/home/sgmm/apache-tomcat-6.0.20
- # .bash_profile
- # Get the aliases and functions
- if [ -f ~/.bashrc ]; then
- . ~/.bashrc
- fi
- # User specific environment and startup programs
- JAVA_HOME=/home/sgmm/jdk1.6.0_13
- CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
-
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
- export PATH CLASSPATH JAVA_HOME
- export CATALINA_BASE=/home/sgmm/apache-tomcat-6.0.20
- export CATALINA_HOME=/home/sgmm/apache-tomcat-6.0.20
- [[email protected]_test ~]$ source ~/.bash_profile
- [[email protected]_test bin]$ ./startup.sh
- Using CATALINA_BASE: /home/sgmm/apache-tomcat-6.0.20
- Using CATALINA_HOME: /home/sgmm/apache-tomcat-6.0.20
- Using CATALINA_TMPDIR: /home/sgmm/apache-tomcat-6.0.20/temp
- Using JRE_HOME: /home/sgmm/jdk1.6.0_13
6、使用 ps -ef|grep tomcat 可以檢視tomcat程序,並使用 kill -9 程序號殺掉程序