Linux下源码包安装Tomcat7配置

在安装tomcat7前,需要安装java6以上的版本 java下载地址 Download a Java SE Runtime Environment (JRE), release version 6.0 or later, from http://www.oracle.com/technetwork/java/javase/downloads/index.html 我下载的是tar.gz的源码包,解压开来就能用 tar zxvf jre-7u5-linux-i586.tar.gz -C ../software/ cd ../software cp -rp jre1.7.0_05/ /usr/local/ vi /etc/profile 加入如下3条 JAVA_HOME=/usr/local/jre1.7.0_05/ CLASSPATH=$CLASSPATH:$JAVA_HOME/lib PATH=$JAVA_HOME/bin:$PATH . /etc/profile 测试java是否安装成功 chown -R root\: /usr/local/jre1.7.0_05/ java -version java version "1.7.0_05" Java(TM) SE Runtime Environment (build 1.7.0_05-b05) Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode) 运行上面命令可能会出现如下错误,google了下,是selinux的问题导致的。 error :/usr/lib/libjvm.so: cannot restore segment prot after reloc: Permission denied . use the command: chcon -t textrel_shlib_t /usr/lib/libjvm.so 这是官方的提示 简单的做法是 setenforce 0 ok,java安装完毕 安装tomcat7 下载地址:http://tomcat.apache.com/ cd /usr/local/src/tarbag tar zxvf apache-tomcat-7.0.28.tar.gz -C ../software/ cd ../software cp -rp apache-tomcat-7.0.28/ /usr/local/ cd /usr/local/apache-tomcat-7.0.28/ 设置环境变量 vi /etc/profile 加入如下两条 CATALINA_HOME=/usr/local/apache-tomcat-7.0.28/ PATH=$JAVA_HOME/bin:/usr/local/apache-tomcat-7.0.28/bin/:$PATH . /etc/profile 启动服务 /usr/local/apache-tomcat-7.0.28/bin/catalina.sh start 或者 /usr/local/apache-tomcat-7.0.28/bin/startup.sh netstat -lnt 发现了80开头的端口 Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:759 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN tcp 0 0 :::8009 :::* LISTEN tcp 0 0 :::8080 :::* LISTEN tcp 0 0 :::22 :::* LISTEN curl http://192.168.1.205:8080 输出如下即告成功    
Home Documentation Configuration Examples Wiki Mailing Lists Find Help
。。。。。。 关闭服务 /usr/local/apache-tomcat-7.0.28/bin/catalina.sh stop 或者 /usr/local/apache-tomcat-7.0.28/bin/shutdown.sh

你可能感兴趣的:(linux,安装,配置,tomcat7,jre,java7,source)