使用版本:
[xxxx soft]$ ll
total 158568
-rw------- 1 migu_ddms migu_ddms 8858187 Aug 21 09:52 apache-tomcat-7.0.64.tar.gz
-rw------- 1 migu_ddms migu_ddms 153512879 Aug 21 09:47 jdk-7u79-linux-x64.tar.gz
[xxxx soft]$
安装JDK
[xxxx ~]$ tar -zxvf jdk-7u79-linux-x64.tar.gz
[xxxxx jdk1.7.0_79]$ pwd
/xxx/xxxxx/jdk1.7.0_79
[xxxx jdk1.7.0_79]$
[xxxx jdk1.7.0_79]$ ll
total 19796
drwx------ 2 xxx xxx 4096 Apr 11 2015 bin
-r-------- 1 xxx xxx 3339 Apr 11 2015 COPYRIGHT
drwx------ 4 xxx xxx 4096 Apr 11 2015 db
drwx------ 3 xxx xxx 4096 Apr 11 2015 include
drwx------ 5 xxx xxx 4096 Apr 11 2015 jre
drwx------ 5 xxx xxx 4096 Apr 11 2015 lib
-r-------- 1 xxx xxx 40 Apr 11 2015 LICENSE
drwx------ 4 xxx xxx 4096 Apr 11 2015 man
-r-------- 1 xxx xxx 114 Apr 11 2015 README.html
-rw------- 1 xxx xxx 499 Apr 11 2015 release
-rw------- 1 xxx xxx 19940807 Apr 11 2015 src.zip
-rw------- 1 xx xxx 110114 Mar 17 2015 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r-------- 1 xxx xxx 173571 Apr 11 2015 THIRDPARTYLICENSEREADME.txt
[xxx jdk1.7.0_79]$
设置环境变量
[xxxxx ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export JAVA_HOME=/xxx/jdk1.7.0_79
export JRE_HOME=/xxx/jdk1.7.0_79/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH
[xxxx ~]$
安装apache
[xxxxx ~]$ tar -zxvf apache-tomcat-7.0.64.tar.gz
修改默认端口,端口这里修改为8081
[xxxxx conf]$
[xxxxx conf]$ pwd
/xxxx/xxx/apache-tomcat-1/conf
[xxx conf]$ cat server.xml | grep 8081
<Connector port="8081" protocol="HTTP/1.1"
[xxxx conf]$ cat server.xml | grep -A 5 8081
<Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
[xxxx conf]$
修改启动内存大小:
[xxx bin]$ ll catalina.sh
-rwx------ 1 xxx xxx 21016 Aug 21 10:21 catalina.sh
[xxxxx bin]$ pwd
/xxx/xxx/apache-tomcat-1/bin
[xxxx bin]$
JAVA_OPTS="-Xmn2048m -Xms4096m -Xmx4096m -XX:PermSize=128M -XX:MaxPermSize=256m -Djava.awt.headless=true"
启动: /xxx/xxx/apache-tomcat-1/bin/startup.sh
验证: ps -ef | grep java 和日志打印