XML and XSLT
Resin Web Server
This document describes how to install and run Resin "standalone" (without Apache or IIS).
Resin provides a reliable, fast Web server which can also be used as a load balancer. In our benchmarks, it serves static pages faster than Apache. For most sites, Resin is ideal because of its performance, security and reliability.
Unix (including Linux and MacOS-X)
The following steps will start Resin for development:
unix> java -jar resin/lib/resin.jar Resin Professional 3.1.0 (built Fri, 08 Sep 2006 12:49:30 PDT) Copyright(c) 1998-2006 Caucho Technology. All rights reserved. 001111.license - 1 Resin server Hogwarts School Starting Resin on Tue, 12 Sep 2006 19:11:52 -0700 (PDT) [21:22:21.282] Proxy Cache disk-size=1024M memory-size=8M [21:22:21.477] Server[id=,cluster=app-tier] starting [21:22:21.477] [21:22:21.477] Mac OS X 10.4.7 ppc [21:22:21.477] Java 1.5.0_06-64, 32, mixed mode, sharing, MacRoman, en, "Apple Computer, Inc." [21:22:21.477] resin.home = /usr/local/share/resin [21:22:21.478] resin.root = /var/www [21:22:21.478] [21:22:21.492] Loaded Socket JNI library. [21:22:21.595] hmux listening to localhost:6800 [21:22:21.696] http listening to *:8080 [21:22:21.842] Host starting [21:22:22.089] WebApp starting
When deploying, it's a good idea to create a bit of structure to make Resin and website upgrades easier and more maintainable.
The start script might look like:
#!/bin/sh JAVA_HOME=/usr/java RESIN_HOME=/usr/local/share/resin RESIN_ROOT=/var/www java=$JAVA_HOME/bin/java export JAVA_HOME export RESIN_HOME export RESIN_ROOT $java -jar $RESIN_HOME/lib/resin.jar \ -resin-root $RESIN_ROOT \ -conf /etc/conf/resin.conf \ -server a \ $*
This script would be called as
More information on deploying on Unix is available on the Linux boot documentation.
C:\win32> resin-3.1.0\bin\httpd Resin 3.1.0-beta (built Thu Feb 13 18:21:13 PST 2003) Copyright(c) 1998-2002 Caucho Technology. All rights reserved. Starting Resin on Sat, 01 Mar 2003 19:11:52 -0500 (EST) [19:11:56.479] ServletServer starting [19:11:57.000] Host starting [19:11:58.312] Application[http://localhost:8380/doc] starting [19:12:11.872] Application[http://localhost:8380/quercus] starting ... [19:12:12.803]http listening to *:8380 [19:12:12.933]hmux listening to *:6802
Deploying as a Windows Service
The Resin Web Server can be installed as an Windows service.
To install the service, use
C:\> resin-3.1.x\httpd -install -conf conf/myconf.conf
To remove the service, use
C:\> resin-3.1.x\httpd -remove
You will either need to reboot the machine or start the service from the Control Panel/Services panel to start the server. On a machine reboot, Windows will automatically start the web server.
You can also start and stop the service from the command-line:
C:\> net start resin ... C:\> net stop resin
Resin'ssaves the command-line arguments and starts the service with those arguments. You can look view them in the control panel, under the executable string.
With multiple named servers, you can useto specify the service name.
C:\> resin-3.1.x\httpd -install-as ResinA \ -conf conf/myconf.conf \ -server a C:\> net start ResinA
Resin runs as multiple processes that begin with the following JVM command:
unix> java -jar /usr/local/share/resin/lib/resin.jar \ -conf /etc/resin/resin.conf \ start
JDK 1.5 includes a jps command which will show the pids of any java processes.
unix> jps 2098 Jps 2064 ResinWatchdogManager 2097 Resin
When running as a daemon (eg,
The first process that starts is the actual startup program,
The Watchdog Process
The ResinWatchdogManager is the parent process, providing automatic restarting Resin in cases of failure, and providing a single point of control for the <user-name> on unix., and of all Resin processes. It is responsible for launching Resin with the correct JVM arguments and environment options such as starting Resin as the specified user, e.g. for
ResinWatchdogManager watches Resin via a Socket connection. When the watchdog socket closes, Resin shuts itself down gracefully. The watchdog closes the socket on aor or if the watchdog itself is killed. If Resin exits for any reason, the watchdog will automatically start a new Resin process. This socket connection approach avoids the need for any signals or actual killing of Resin from the watchdog, and also makes it easy to stop all the Resins if necessary by just killing the watchdog.
The ResinWatchdogManager doesn't actually kill Resin or even check Resin's status, it just checks to see if Resin is alive or not. So if the JVM were to completely lock up, the watchdog would still think Resin was okay and would take no action.
If Resin detects a major error (like running out of memory) or if the resin.conf changes, it will exit and the watchdog would start a new Resin instance. Reasons a Resin instance might exit include:
Because the watchdog is always managing Resin processes, if you ever need to stop Resin with, you must kill the watchdog. Just killing the Resin process results in the watchdog restarting it automatically.
The watchdog will log to. The Resin standard out/err is . ResinWatchdogManager is responsible for creating both of these log files, so is not really under the control of the Resin instance. This makes it somewhat more reliable in case of JVM deadlocks, etc.