Centos6快速安装文档 resin3.1.13

软件下载地址:

http://caucho.com/products/resin/download/gpl#download

#系统环境
[root@www conf]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[root@www conf]# uname -r
2.6.32-358.el6.x86_64
[root@www conf]# uname -m
x86_64

一、安装jdk

#上传jdk安装包
[root@www tools]# rz -y
jdk-6u34-fcs-bin-b04-linux-amd64-19_jul_2012.bin

#检查
[root@www 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/

#切换目录
[root@www tools]# cd /application/

#做个软链接
[root@www application]# ln -s jdk1.6.0_34/ jdk

#检查
[root@www application]# ls -l /application/jdk
lrwxrwxrwx. 1 root root 12 Feb 25 23:05 /application/jdk -> jdk1.6.0_34/

#查看jdk版本
[root@www 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版本
[root@www 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
[root@www tools]# mkdir -p /app/logs/resinlog
[root@www tools]#
[root@www tools]# cd /application/resin/conf
[root@www 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格式的配置文件
[root@www 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='' watchdog-port="">
<http address="*" port=""/>
<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进程
[root@www conf]# killall java
java: no process killed

#启动resin
[root@www conf]# /application/resin/bin/httpd.sh -server oldboy start
Resin/3.1.13 started -server 'oldboy' for watchdog at 127.0.0.1:6921

#检查端口(必须有三个端口)
[root@www 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

#检查服务启动
[root@www conf]# ps -ef|grep java

#访问resin

http://192.168.1.139:8080/ (ip指的是你网卡的ip)

#如果访问不成功,注意关闭本机防火墙

[root@www conf]# /etc/init.d/iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]

#配置站点目录
[root@www ~]# ll /application/resin/webapps/ROOT/
total 8
-rw-r--r--. 1 root root 1507 Nov 9 2012 index.jsp
drwxr-xr-x. 5 root root 4096 Feb 26 00:35 WEB-INF

[root@www ~]# echo '<99+1=<%=99+1>' >/application/resin/webapps/ROOT/test.jsp
[root@www ~]# cat /application/resin/webapps/ROOT/test.jsp
<99+1=<%=99+1>
[root@www ~]# curl http://192.168.1.139/test.jsp

#配置启动方式

#系统自带的启动脚本(有兴趣的自己了解下)
[root@www ~]# cp /application/resin/contrib/init.resin.in /etc/init.d/resind

#自己写一个启动脚本,放在启动目录

[root@www init.d]#cd /etc/init.d/

#resind启动脚本

[root@www init.d]#vi resind
#!/bin/sh
#authon:nulige by QQ:155236879
#Linux startup scripts for Resin
#chkconfig:345 85 15
#descriptsion:Resin is a Java Web server
#
#To install, configure this file as needed and copy init.resin
#to /etc/rc.d/init.d as resin. Then use "# /sbin/chkconfig resin reset"
#
. /etc/init.d/functions
StartPath='/application/resin/bin/httpd.sh'
ResinLog=/app/logs/resinlog
[ ! -d $ResinLog ] && mkdir -p &ResinLog resind() {
#如果是多进程增加下面的配置段:oldboy后面空格再接标签名即可
for id in oldboy
do
$StartPath -server $id $1 >> $ResinLog/resin_startup.log
if [ $? -eq 0 ]
then
action "$1 $id resin..."/bin/true
else
action "$1 $id resin..."/bin/false
fi
done } case "$1" in
start)
resind $1
echo '------checking-------'
sleep 15
netstat -lnt|egrep "80|69"
echo '------check over------'
;; stop)
resind $1
;; restart)
resind stop
resind start
;; *)
echo "Usage: $0{start|stop|restart}"
exit 1
esac exit 0

#dos2unix处理一下
[root@www init.d]# dos2unix /etc/init.d/resind
dos2unix: converting file /etc/init.d/resind to UNIX format ...

#给脚本加个执行权限
[root@www init.d]# chmod +x resind
[root@www init.d]# ls -l resind
-rwxr-xr-x. 1 root root 859 Feb 26 02:20 resind

#杀java
[root@www init.d]# killall java
[root@www init.d]# killall java
java: no process killed

#用脚本启动
[root@www init.d]# /etc/init.d/resind start

start oldboy resin.../bin/true [ OK ]
------checking-------
tcp 0 0 :::8080 :::* LISTEN 4025/java
tcp 0 0 ::ffff:192.168.30.131:6911 :::* LISTEN 4025/java
tcp 0 0 ::ffff:127.0.0.1:6921 :::* LISTEN 3997/java

------check over------

#添加开机自启动
[root@www init.d]# chkconfig --add resind
[root@www init.d]# chkconfig resind on
[root@www init.d]# chkconfig --list resind
resind 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Resin install document的更多相关文章

  1. nginx配合modsecurity实现WAF功能

    一.准备工作 系统:centos 7.2 64位.nginx1.10.2, modsecurity2.9.1 owasp3.0 1.nginx:http://nginx.org/download/ng ...

  2. openstack-L版安装

    参照官方install document: http://docs.openstack.org/liberty/install-guide-rdo/ 实验环境:centos7.2 桥接: 192.16 ...

  3. vs2010 MSDN文档安装方法

    vs2010的MSDN是不能独立安装,必须安装VS2010后才能安装. 安装方法: 1.vs2010的ISO光盘文件中,里面会有个ProductDocumentation文件夹,其实这个就是安装MSD ...

  4. QGIS编译教程

    注意更新时间:Thursday November 02, 2017 1. Introduction 简介 This document is the original installation guid ...

  5. vscode前端开发软件配搭好用的插件

    使用方法,可以在官网中搜索需要的插件或者在VsCode的“”扩展“”中搜索需要的插件添加方法使用Ctrl+P, 输入 ext install xxxx ,搜索要安装的插件,点击安装按钮即可(各取所需插 ...

  6. vscode常好用的插件以及几个快捷操作

    使用方法,可以在官网中搜索需要的插件或者在VsCode的“”扩展“”中搜索需要的插件添加方法使用Ctrl+P, 输入 ext install xxxx ,搜索要安装的插件,点击安装按钮即可(各取所需插 ...

  7. resin 64 & Java install

    [root@vohst voh]# uname -rnvohst 3.10.0-123.el7.x86_64 resin-pro-4.0.41.tar.gz Unrecognized option: ...

  8. Official online document, install svn server in centOS

    http://www.krizna.com/centos/install-svn-server-on-centos-6/

  9. resin 安装配置

    resin (下载免费版 4) 前提:已经安装了Java运行环境,resin的安装需要jdk的支持   一.安装 1.cd /usr/local/src wget http://www.caucho. ...

随机推荐

  1. 三 Python解释器

    当我们编写Python代码时,我们得到的是一个包含Python代码的以.py为扩展名的文本文件.要运行代码,就需要Python解释器去执行.py文件. 由于整个Python语言从规范到解释器都是开源的 ...

  2. poj2956 Repeatless Numbers(枚举|BFS)

    题目链接 http://poj.org/problem?id=2956 题意 如果一个数中的每一位都是不同的,那么这个数叫做无重复数,如11是有重复数,12是无重复数.输入正整数n(1<=n&l ...

  3. Python并发编程-进程池及异步方式

    进程池的基本概念 为什么有进程池的概念 效率问题 每次开启进程,都需要开启属于这个进程的内存空间 寄存器,堆栈 进程过多,操作系统的调度 进程池 python中的 先创建一个属于进程的池子 这个池子指 ...

  4. hihocoder #1580 : Matrix (DP)

    #1580 : Matrix 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Once upon a time, there was a little dog YK. On ...

  5. poj2531(深搜剪枝)

    题意就是把节点分成A.B两组,节点间距C给了,要求解分组的方法,使得∑Cij (i∈A,j∈B)最大. 首先把所有节点都放在一组,然后采用深度优先搜索的方法,对每一个节点都做判断是否应该移到另一组去, ...

  6. Xamarin.Forms教程开发Xamarin.Forms应用程序需要的工具

    开发Xamarin.Forms应用程序需要的工具 Xamarin.Forms教程开发Xamarin.Forms应用程序需要的工具,2014年5月8日在发布的Xamrin 3中引进了Xamarin.Fo ...

  7. java8新特性——四大内置核心函数式接口

    在前面几篇简单介绍了一些Lambda表达式得好处与语法,我们知道使用Lambda表达式是需要使用函数式接口得,那么,岂不是在我们开发过程中需要定义许多函数式接口,其实不然,java8其实已经为我们定义 ...

  8. 【BZOJ 2753】 2753: [SCOI2012]滑雪与时间胶囊 (分层最小树形图,MST)

    2753: [SCOI2012]滑雪与时间胶囊 Time Limit: 50 Sec  Memory Limit: 128 MBSubmit: 2457  Solved: 859 Descriptio ...

  9. codevs 1044 拦截导弹 1999年NOIP全国联赛提高组

    1044 拦截导弹 1999年NOIP全国联赛提高组  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 题解       题目描述 Description 某国为 ...

  10. POJ 2406 Power Strings 简单KMP模板 strcmp

    http://poj.org/problem?id=2406 只是模板,但是有趣的是一个strcmp的字符串比较函数,学习到了... https://baike.baidu.com/item/strc ...