• 高端电子商务软件领导品牌
  • 服务热线:400-776-9999

Tomcat安装配置(Linux)

日期: 2015-09-04 17:48:24 作者: SHOP++ 点击数:  

一、系统环境

Ubuntu 14.04 64位

JDK 7u80 64位

Tomcat 7.0.64


二、安装配置

1、新建目录

sudo mkdir /usr/shopxx

sudo mkdir /usr/shopxx/soft


2、下载apache-tomcat-7.0.64.tar.gz、apr-1.5.2.tar.gz至/usr/shopxx/soft

sudo wget -P /usr/shopxx/soft http://storage.shopxx.net/file/apache-tomcat-7.0.64.tar.gz

sudo wget -P /usr/shopxx/soft http://storage.shopxx.net/file/apr-1.5.2.tar.gz


3、解压/usr/shopxx/soft/apache-tomcat-7.0.64.tar.gz至/usr/shopxx

sudo tar -zxvf /usr/shopxx/soft/apache-tomcat-7.0.64.tar.gz -C /usr/shopxx


4、重命名/usr/shopxx/apache-tomcat-7.0.64为/usr/shopxx/tomcat7.0

sudo mv /usr/shopxx/apache-tomcat-7.0.64 /usr/shopxx/tomcat7.0


5、创建用户组tomcat

sudo groupadd tomcat


6、创建用户tomcat

sudo useradd -s /usr/sbin/nologin -r -g tomcat tomcat


7、修改/usr/shopxx/tomcat7.0所有者为tomcat

sudo chown -R tomcat:tomcat /usr/shopxx/tomcat7.0


8、更新软件源

sudo apt-get update


9、安装libssl-dev

sudo apt-get install libssl-dev


10、安装JSVC

sudo tar -zxvf /usr/shopxx/tomcat7.0/bin/commons-daemon-native.tar.gz -C /usr/shopxx/tomcat7.0

cd /usr/shopxx/tomcat7.0/commons-daemon-1.0.15-native-src/unix

sudo ./configure --with-java=/usr/shopxx/jdk1.7

sudo make

sudo cp /usr/shopxx/tomcat7.0/commons-daemon-1.0.15-native-src/unix/jsvc /usr/shopxx/tomcat7.0/bin/jsvc

cd /usr/shopxx

sudo rm -rf /usr/shopxx/tomcat7.0/commons-daemon-1.0.15-native-src


11、安装APR

sudo tar -zxvf /usr/shopxx/soft/apr-1.5.2.tar.gz -C /usr/shopxx/tomcat7.0

cd /usr/shopxx/tomcat7.0/apr-1.5.2

sudo ./configure --prefix=/usr/shopxx/tomcat7.0/apr

sudo make

sudo make install

cd /usr/shopxx

sudo rm -rf /usr/shopxx/tomcat7.0/apr-1.5.2


12、安装Native

sudo tar -zxvf /usr/shopxx/tomcat7.0/bin/tomcat-native.tar.gz -C /usr/shopxx/tomcat7.0

cd /usr/shopxx/tomcat7.0/tomcat-native-1.1.33-src/jni/native

sudo ./configure --prefix=/usr/shopxx/tomcat7.0/native --with-apr=/usr/shopxx/tomcat7.0/apr --with-java-home=/usr/shopxx/jdk1.7 --with-ssl=yes

sudo make

sudo make install

cd /usr/shopxx

sudo rm -rf /usr/shopxx/tomcat7.0/tomcat-native-1.1.33-src


13、新建配置文件/usr/shopxx/tomcat7.0/bin/setenv.sh,添加如下内容

# JDK路径

JAVA_HOME=/usr/shopxx/jdk1.7

# Tomcat启动用户

TOMCAT_USER=tomcat