(安装开发组件yum -y groupinstall "Development Tools" "Development Libraries")
安装JDK
--------------------------------------------------------
chmod +X jdk-6u30-linux
./jdk-6u30-
mkdir /usr/java -pv
mv jdk1.6 /usr/java/
声明JDK环境变量
vim /etc/profile
JAVA_HOME=/usr/java/jdk1.6.0_33
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME
重读 /etc/profile. !$
echo $PATH
java -version
-----------------------安装tomcat-------------------------
hwclock -s 同步下时间戳
tar xf apache-tomcat-6.0.35.tar.gz -C /usr/local
为了方便给apache-tomcat 创建链接
ln -sv apache-tomcat tomcat
声明tomcat的变量
export CATALINA_HOME=/usr/local/tomcat
echo $CATALINA_HOME
启动tomcat
bin/catalina.sh start
netstat -tnlp
访问本地地址看有没有tomcat的页面 是只三脚猫~~
yum -y install apr-devel yum -y install openssl-devel
tomcat/bin/tomcat-native.tar.gz 安装apr(稳定性)
rpm -qa |grep apr rpm -qa |grep openssl
在bin目录下解压 tar xf tomcat-native.tar.gz
cd tomcat-native-1.1.22-src/jni/native/
./configure --with-apr=/usr --with-ssl
make && make install
echo /usr/local/apr/lib/ > /etc/ld.so.conf.d/apr.conf
ldconfig -v |grep native 应该输出这个libtcnative-1.so.0 -> libtcnative-1.so.0.1.22
----------------------------------------------------------------------------------
给tomcat写个启动脚本
vi /etc/init.d/tomcat
#!/bin/sh
#Tomcat init script for Linux
#
#chkconfig: 2345 96 14
#descript:The Apache Tomcat servlet/JSP container
JAVA_OPTS='-Xms64m -Xmx128m'
JAVA_HOME=/usr/java/jdk1.6.0_33
CATALINA_HOME=/usr/local/tomcat
export JAVA_HOME CATALINA_HOME
exec $CATALINA_HOME/bin/catalina.sh $*
$*(传递给当前脚本的所有参数)
chmod +x !$
chkconfig --add tomcat
给tomcat配置管理用户
vi tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-status"/>
<user username="tomcat" password="wang0504" roles="manager-gui,manager-script,manager-status"/>
-------------------------------------------------------------------------------------------
再自己自行安装缺少的api tar xf mysql-connector-java