|
Resin Web Server on Unix or Windows
|

Resin provides a standalone web server. In our benchmarks, it actually
serves static pages faster than Apache! The standalone web server
is ideal for evaluation or experimentation and is a good choice as the
web server for many sites.
To start the Resin web server, type:
Starting on Unix
unix> resin1.2/bin/httpd.sh Resin 1.2.s010113 -- Sat Jan 13 11:17:18 PST 2001 http listening to *:8080 srun listening to localhost:6802
|
Starting on Win32
c:\win32> resin1.2\bin\httpd Resin 1.2.s010113 -- Sat Jan 13 11:17:18 PST 2001 http listening to *:8080 srun listening to localhost:6802
|
Resin will print every port its listening to. In the above example,
Resin is listening to port 8080 using HTTP and 6802 using its servlet
runner protocol. (The servlet runner protocol only matters if you're
using Resin with another web server, like Apache.)
The following snippet shows the <http> and <srun>
configuration for the above example.
<caucho.com> <http-server> <http port='8080'/> <srun host='localhost' port='6802'/>
... </http-server> </caucho.com>
|
The default port is 8080, so use http://localhost:8080 in your browser.
Go to the demos and make sure they work.
Now, add a file resin1.2/doc/test.jsp containing the following:
You should see the page '2 + 2 = 4'.
A better way to run the servlet engine in a production environment is
to use the start and stop scripts. These run Resin as a unix daemon
and add extra reliability to the server. If Resin should ever exit,
it will automatically be restarted. When developing, however, running Resin
in the foreground is often more convenient.
To start the web server, use
unix> resin1.2/bin/httpd.sh start
|
To stop it, use
unix> resin1.2/bin/httpd.sh stop
|
wrapper.pl
Resin uses a perl script, resin1.2/bin/wrapper.pl, to control the Java
process. (bin/httpd.sh is a tiny shell script that calls wrapper.pl.) You
can modify bin/httpd.sh or bin/wrapper.pl for your configuration.
wrapper.pl automatically restarts Resin when it determines the Java process
has died. If you need to stop Resin with kill, you'll need to kill
the wrapper.pl process to make sure it doesn't restart Resin. ("httpd.sh stop"
works by killing the wrapper.pl process.)
Starting as a user
Many configurations launch Resin from the init as another user. Here's an
example:
root# su ferg -c "/home/resin/start"
|
The start script might look like:
#!/bin/sh
JAVA_HOME=/usr/java RESIN_HOME=/home/resin
export JAVA_HOME export RESIN_HOME
cd $RESIN_HOME
bin/httpd.sh -verbose start
|
On some Unixes, the ./configure; make process will build a bin/resin
executable. You can use that executable to launch Resin, just like
using httpd.sh:
unix> resin1.2/bin/resin -conf conf/test.conf start
|
The bin/resin executable will let you run Resin standalone as another
user than root. To use the user-name and group-name directives, you
must use bin/resin.
The Resin Web Server can be installed as an NT service.
To install the service, use
c:\> resin1.2\bin\httpd -install
|
To remove the service, use
c:\> resin1.2\bin\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, NT 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's -install saves the command-line arguments and starts the service
with those arguments. You can look at them in the control panel, under
the executable string.
With multiple servers, you can use -install-as foo to specify
the service name.
c:\> resin1.2\bin\httpd -install-as foo c:\> net start foo
|
| Argument |
Meaning |
Default
|
| -verbose |
Show the Java environment before starting Resin. |
off
|
| -conf xxx
|
Selects the Resin configuration file |
conf/resin.conf
|
| -java_home xxx
|
Sets the JDK (also recognizes the environment variable JAVA_HOME.) |
A heuristic search
|
| -resin_home xxx
|
Sets the Resin home directory (also recognizes the environment variable RESIN_HOME.) |
The parent directory of wrapper.pl
|
| -classpath xxx
|
Adds to the system classpath. |
$CLASSPATH
|
| -pid xxx
|
(Unix) With start or stop, sets the file
to save the process id. |
resin.pid
|
| -stdout xxx
|
Sets the file to save stdout messages. |
log/stdout.log.
|
| -stderr xxx
|
Sets the file to save stdout messages. |
log/stderr.log.
|
| -Dmy.foo=value
|
Sets a Java system property. |
n/a
|
| -Xxxx
|
Passes the -Xxxx command to the JDK. |
n/a
|
| -Jxxx
|
Passes xxx as a JDK argument. |
n/a
|
| -nojit |
Disables the Just-In-Time compiler. Useful for debugging. |
enabled
|
| start |
(Unix) Starts Resin as a daemon, saving the pid in the pid file. |
n/a
|
| stop |
(Unix) Stops Resin as a daemon, using the pid in the pid file. |
n/a
|
| restart |
(Unix) Restarts Resin as a daemon, using the pid in the pid file. |
n/a
|
| -install |
(NT) install Resin as a service (but doesn't automatically start.) |
n/a
|
| -install-as xxx
|
(NT) install Resin as a named service (but doesn't automatically start.) |
n/a
|
| -remove |
(NT) install Resin as a service (but doesn't automatically start.) |
n/a
|
| -remove-as xxx
|
(NT) remove Resin as a named service (but doesn't automatically start.) |
n/a
|
You can use the -verbose flag to see the arguments the startup
scripts/executables pass to the JDK. The main Java executable is
com.caucho.server.http.HttpServer and starting Resin looks like
the following, once you've properly configured the classpath:
unix> java -Dresin.home=/usr/resin \ com.caucho.server.http.HttpServer \ -conf conf/resin.conf
|
Copyright © 1998-2001 Caucho Technology. All rights reserved.
Copyright © 1998-2001 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark,
and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.
|
 |
|