[resin@magic ~]$ ls
resin-3.1.8.zip
[resin@magic ~]$ unzip resin-3.1.8.zip
[resin@magic ~]$ cd resin-3.1.8/
[resin@magic resin-3.1.8]$ ./configure;make;make install
[resin@magic resin-3.1.8]$ echo $LANG
zh_CN.UTF-8
[resin@magic resin-3.1.8]$ export LANG=en_US.UTF-8
[resin@magic resin-3.1.8]$ echo $LANG
en_US.UTF-8
[resin@magic resin-3.1.8]$ vim conf/resin.conf
<web-app-default>
<character-encoding>UTF-8</character-encoding>
[resin@magic resin-3.1.8]$ java -jar lib/resin.jar
Mar 12, 2009 10:49:50 PM com.caucho.boot.WatchdogProcess run
INFO: WatchdogProcess[Watchdog[],1] starting Resin
[22:49:51.000] {watchdog-} WatchdogProcess[Watchdog[],1] starting Resin
Resin-3.1.8 (built Mon, 17 Nov 2008 12:15:21 PST)
Copyright(c) 1998-2008 Caucho Technology. All rights reserved.
Using Resin(R) Open Source under the GNU Public License (GPL).
See http://www.caucho.com for information on Resin Professional,
including caching, clustering, JNI acceleration, and OpenSSL integration.
Starting Resin on Thu, 12 Mar 2009 22:49:54 +0800 (CST)
[22:49:58.779] {main} 'select-manager' requires Resin Professional. See http://www.caucho.com for information and licensing.
[22:49:58.779] {main}
[22:49:58.780] {main} Linux 2.6.18-92.1.22.el5 i386
[22:49:58.780] {main} Java(TM) 2 Runtime Environment, Standard Edition 1.5.0_15-b04, UTF-8, en
[22:49:58.780] {main} Java HotSpot(TM) Client VM 1.5.0_15-b04, 32, mixed mode, Sun Microsystems Inc.
[22:49:58.781] {main} user.name: resin
[22:49:58.781] {main} resin.home = /home/resin/resin-3.1.8/
[22:49:58.782] {main} resin.root = /home/resin/resin-3.1.8/
[22:49:58.784] {main} resin.conf = /home/resin/resin-3.1.8/conf/resin.conf
[22:49:58.785] {main}
[22:49:59.752] {main} WebApp[http://localhost:8080] active
[22:50:00.241] {main} WebApp[http://localhost:8080/resin-admin] active
[22:50:00.243] {main} expanding /home/resin/resin-3.1.8/webapps/resin-doc.war to /home/resin/resin-3.1.8/webapps/resin-doc
[22:50:05.925] {main} WebApp[http://localhost:8080/resin-doc] active
[22:50:05.926] {main} Host[] active
[22:50:05.937] {main} hmux listening to magic.linux:6800
[22:50:05.963] {main} http listening to *:8080
[22:50:05.976] {main} Server[id=,cluster=app-tier] active
[22:50:05.986] {main} Resin started in 12405ms
[resin@magic resin-3.1.8]$ w3m http://127.0.0.1:8080
Resin® Default Home Page
This is the default page for the Resin web server.
Documentation is available here.
Administration is available here.
[resin@magic resin-3.1.8]$ vim contrib/init.resin
[resin@magic resin-3.1.8]$ exit
exit
[simonsun@magic ~]$ sudo cp /home/resin/resin-3.1.8/contrib/init.resin /etc/rc.d/init.d/resin
[simonsun@magic ~]$ sudo chmod +x /etc/rc.d/init.d/resin
[simonsun@magic ~]$ cd /etc/rc.d/init.d/
[simonsun@magic init.d]$ sudo /sbin/chkconfig --level 35 resin on
[simonsun@magic init.d]$ cat ./resin
#!/bin/sh
#
# Linux startup script. for Resin
# chkconfig: 345 85 15
# description: Resin is a Java Web server.
# processname: wrapper.pl
#
# 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"
#
JAVA_HOME=/usr/java/jdk1.5.0_15
RESIN_HOME=/home/resin/resin-3.1.8
export JAVA_HOME RESIN_HOME
export export LANG=en_US.UTF-8
JAVA=$JAVA_HOME/bin/java
#
# If you want to start the entire Resin process as a different user,
# set this to the user name. If you need to bind to a protected port,
# e.g. port 80, you can't use USER, but will need to use bin/resin.
#
USER=
#
# Set to the server id to start
#
#SERVER="-server app-a"
#
ARGS="-resin-home $RESIN_HOME $SERVER"
if test -r /lib/lsb/init-functions; then
. /lib/lsb/init-functions
else
log_daemon_msg () {
if [ -z "$1" ]; then
return 1
fi
if [ -z "$2" ]; then
echo -n "$1:"
return
fi
echo -n "$1: $2"
}
log_end_msg () {
[ -z "$1" ] && return 1
if [ $1 -eq 0 ]; then
echo " ."
else
echo " failed!"
fi
return $1
}
fi
case "$1" in
start)
echo -n "Starting resin"
if test -n "$USER"; then
su $USER -c "$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS start" 1>/dev/null 2>/dev/null
else
$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS start 1>/dev/null 2>/dev/null
fi
#log_end_msg $?
;;
stop)
echo -n "Stopping resin"
if test -n "$USER"; then
su $USER -c "$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS stop" 1>/dev/null 2>/dev/null
else
$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS stop 1>/dev/null 2>/dev/null
fi
echo " done."
#log_end_msg $?
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac