|
To demonstrate how to use the basic Resin server on Unix, we used a Mandrake 8.2 Linux installation. Resin requires you to install Java v1.2 or later on the machine where the server will execute. Our test environment used Sun Java Soft version 1.4.0 build92 SDK.
Start the process of installing Resin by downloading the most current Resin server from www.resin.com in the download area. If you are working on a headless Unix machine, you can also obtain the file from ftp.caucho.com in the /pub/resin directory. The downloaded file will have a name like
resin-3.0.x.tar.gz
where x is the latest revision of the code. Extract the files from the installation file using the command
tar -vzxf resin-3.0.2.tar.gz
This tar command uncompresses and untars the files located in the installation file. Alternately, you can use gunzip and tar in this sequence:
gunzip resin-3.0.2.tar.gz tar -xf resin-3.0.2.tar
Once you extract the files, Resin places the directory structure shown in Figure 2.9 on the local drive. After installing the system, it is important to configure it:
/configure make
Figure 2.9: The Linux Resin installation directory hierarchy.
The result is a system optimized for UNIX.
Under Unix, the Resin server is executed using the shell script httpd.sh located in the /bin directory. You can launch the server using the shell script shown here:
The second way to execute the server—and more than likely the one you want to use in a development setting—is the shell script. You can launch the server using the shell script shown here:
$ ./resin-3.0.2/bin/httpd.sh
The first time the server is launched, you see the output shown in Figure 2.10 in the terminal window.
Figure 2.10: Launching the Unix Resin server.
Note that the server isn't automatically launched into a background process. To make it execute in the background, use this command:
$ ./resin-3.0.2/bin/httpd.sh start
In the output shown in Figure 2.10, the server begins by checking all of the code in the example and tutorial directories to determine if compiled classes exist. If the classes aren't found for the corresponding source files or the source files have been changed since the last time the server executed, the system compiles the source. Once the files have been initialized, the server begins listening on port 8080 for requests. The system also listens on port 6802 for srun requests.
You can stop the server using the shell script as well. For example:
$./resin-3.0.2/bin/httpd.sh stop
The server can be restarted with this command:
$./resin-3.0.2/bin/httpd.sh restart
|