rpm -qa |grep java
yum -y xxx
2.安装JDK1.7
从Oracle网站下载JDK rpm包,拷贝到centos上,并在centos上安装
yum install xx.rpm
3.下载tomcat7,并解压到/var/lib/下,把apache-tomcat-x改成tomcat7
4.新建tomcat7用户
useradd -d /usr/share/tomcat7 tomcat7
5.设置目录权限
chown -R tomcat7:tomcat7 /var/lib/tomcat7
chmod a+x /var/lib/tomcat7/bin/*.sh
5.设置自启动脚本
1)生成jsvc程序
在/var/lib/tomcat7/bin目录下,解压commons-daemon-native.tar.gz,
cd commons-daemon-versrion-native-src/unix/
#/usr/java/jdk1.7 是JDK安装路径
./configure --with-java=/usr/java/jdk1.7
make
将生成的jsvc拷贝到/var/lib/tomcat7/bin下面
2)设置自启动
ln -s /var/lib/tomcat7/bin/daemon.sh /etc/init.d/tomcat7