Centos6快速安装文档 resin3.1.13
#系统环境
[[email protected] conf]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[[email protected] conf]# uname -r
2.6.32-358.el6.x86_64
[[email protected] conf]# uname -m
x86_64
一、安装jdk
#上传jdk安装包
[[email protected] tools]# rz -y
jdk-6u34-fcs-bin-b04-linux-amd64-19_jul_2012.bin
#检查
[[email protected] tools]# ll
jdk-6u34-fcs-bin-b04-linux-amd64-19_jul_2012.bin
#授权x权限
chmod +x jdk-6u34-fcs-bin-b04-linux-amd64-19_jul_2012.bin
#安装jdk
./jdk-6u34-fcs-bin-b04-linux-amd64-19_jul_2012.bin
省略部分...中间有一步要按回车键,然后等待几秒,即可完成。
Done.
#########################################################
#查看安装好的文件
ls -l jdk1.6.0_34/
#创建目录
mkdir -p /application
#把文件移到/application目录下
mv jdk1.6.0_34/ /application/
#切换目录
[[email protected] tools]# cd /application/
#做个软链接
[[email protected] application]# ln -s jdk1.6.0_34/ jdk
#检查
[[email protected] application]# ls -l /application/jdk
lrwxrwxrwx. 1 root root 12 Feb 25 23:05 /application/jdk -> jdk1.6.0_34/
#查看jdk版本
[[email protected] application]# /application/jdk/bin/java -version
java version "1.6.0_34"
Java(TM) SE Runtime Environment (build 1.6.0_34-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.9-b04, mixed mode)
#配置JAVA环境变量
echo ‘#java env start config by oldboy 2011-8-24‘ >>/etc/profile echo ‘export JAVA_HOME=/application/jdk‘ >>/etc/profile echo ‘export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib‘ >>/etc/profile echo ‘export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin‘ >>/etc/profile echo ‘export RESON_HOME=/application/resin‘ >>/etc/profile echo ‘#java env end config by nulige 2017-2-25‘ >>/etc/profile
#检查
tail -6 /etc/profile
#使环境变量生效
source /etc/profile
#检查是否成功
echo $JAVA_HOME echo $RESIN_HOME echo $CLASSPATH echo $PATH
#查看java版本
[[email protected] application]#java -version
java version "1.6.0_34"
Java(TM) SE Runtime Environment (build 1.6.0_34-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.9-b04, mixed mode)
二、安装resin
软件名称:resin-3.1.13.tar.gz
#开始安装
cd /home/nulige/tools/ ll tar xf resin-3.1.13.tar.gz mv resin-3.1.13 /application/ ln -s /application/resin-3.1.13/ /application/resin ls -l /application/resin/
###################不和apache配置生成模块则,则无需编译#####################
三、配置resin
[[email protected] tools]# mkdir -p /app/logs/resinlog
[[email protected] tools]#
[[email protected] tools]# cd /application/resin/conf
[[email protected] conf]# ls -l
total 48
-rw-r--r--. 1 root root 12216 Nov 9 2012 app-default.xml
-rw-r--r--. 1 root root 3007 Nov 9 2012 development.conf
-rw-r--r--. 1 root root 270 Nov 9 2012 fine.conf
-rw-r--r--. 1 root root 641 Nov 9 2012 minimal.conf
-rw-r--r--. 1 root root 9970 Nov 9 2012 resin.conf
-rw-r--r--. 1 root root 9970 Nov 9 2012 resin.conf.orig
#都是xml格式的配置文件
[[email protected] conf]# vi resin.conf
从88行开始删除到146行,(快整跳到88行,用快捷键:88gg) 再用快捷键:59dd (删除59行内容)
#再添加下面代码到删除的地方,并注意:server id= xxx,是指启动时指定的标签,地址就是本机网卡地址,端口不用改。
<http address="*" port="8080"/> #如果做web服务用,就把端口修改成80。
添加代码如下:
<!-- resin Configure by old-boy 6:58 2011-8-25 --> <server id=‘oldboy‘ address=‘10.0.0.8‘ port=‘6911‘ watchdog-port="6921"> <http address="*" port="8080"/> <jvm-arg>-Xmx256m</jvm-arg> <jvm-arg>-Xss1m</jvm-arg> <jvm-arg>-Xdebug</jvm-arg> <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg> <memory-free-min>1M</memory-free-min> <thread-max>256</thread-max> <socket-timeout>65s</socket-timeout> <keepalive-max>128</keepalive-max> <keepalive-timeout>15s</keepalive-timeout> </server>
四、启动resin并检查
#杀下java进程
[[email protected] conf]# killall java
java: no process killed
#启动resin
[[email protected] conf]# /application/resin/bin/httpd.sh -server oldboy start
Resin/3.1.13 started -server ‘oldboy‘ for watchdog at 127.0.0.1:6921
#检查端口(必须有三个端口)
[[email protected] conf]# netstat -lntup|egrep "6911|6921|8080"
tcp 0 0 :::8080 :::* LISTEN 2373/java
tcp 0 0 ::ffff:192.168.1.139:6911 :::* LISTEN 2373/java
tcp 0 0 ::ffff:127.0.0.1:6921 :::* LISTEN 2345/java
#检查服务启动
[[email protected] conf]# ps -ef|grep java
#访问resin
http://192.168.1.139:8080/ (ip指的是你网卡的ip)
#如果访问不成功,注意关闭本机防火墙
[[email protected] conf]# /etc/init.d/iptables stop iptables: Flushing firewall rules: [ OK ] iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Unloading modules: [ OK ]