安裝resin4.0
1、下載
# wget http://www.caucho.com/download/resin-4.0.35.tar.gz
2、解壓
# sudo tar -vzxf resin-4.0.35.tar.gz
3、編譯
# cd resin-4.0.35
# sudo ./configure --enable-64bit --with-java-home=$JAVA_HOME
Resin Configuration Summary:
RESIN : 4.0.35
home : /usr/local/share/resin-4.0.35
root : /var/resin
conf : /etc/resin
log : /var/log/resin
plugins : common resin_os
init : /etc/init.d/resin
JAVA_HOME : /usr/lib/jvm/jdk1.7.0_13
JNI : 64-bit
include : -I/usr/lib/jvm/jdk1.7.0_13/include -I/usr/lib/jvm/jdk1.7.0_13/include/linux
CFLAGS :
cflags_shlib : -fpic
ld_shlib : gcc
ldflags_shlib : -shared -fPIC -m64
libs_shlib :
epoll() for keepalives
# make
# sudo make install
4、啟動resin
# sudo resinctl start
或者
# sudo java -jar lib/resin.jar start
或者
# sudo /etc/init.d/resin start
5、測試是否啟動成功
# curl http://localhost:8080
<html>
<head><title>Resin® Default Home Page</title></head>
<body>
<h1 style="background: #ccddff">Resin® Default Home Page</h1>
This is the default page for the Resin web server.
<p>Documentation is available at <a href="/resin-doc">/resin-doc</a>.
<p>Administration is available at <a href="/resin-admin">/resin-admin</a>.
</body>
</html>
6、停止resin
# sudo resinctl stop
或者
# sudo java -jar lib/resin.jar stop
或者
# sudo /etc/init.d/resin stop
7、修改防火牆策略,開啟8080等常用端口
# sudo vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #新增行
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT #新增行
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
重啟防火牆
# sudo /etc/init.d/iptables restart
iptables:清除防火牆規則: [確定]
iptables:將鏈設置為政策 ACCEPT:filter [確定]
iptables:正在卸載模塊: [確定]
iptables:應用防火牆規則: [確定]
8、添加resin到系統服務
檢查是否已經存在
# chkconfig --list resin
添加resin服務
# chkconfig --add resin
重啟看resin是否已經自啟動
# reboot
# service resin status
Resin/4.0.35 status for watchdog at 127.0.0.1:6600
watchdog:
watchdog-pid: 1189
server 'app-0' : ACTIVE
password: missing
watchdog-user: root
user: root
root: /var/resin
conf: /etc/resin/resin.xml
pid: 1231
uptime: 0 days 00h00
附1:解決CentOS5.8下設置JAVA_HOME RESIN配置無法識別和alternatives指令無效的問題
檢查環境變量是否含有/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/sbin
將以上添加至PATH
# sudo vi /etc/profile