Installing Resin on UnixLinux


Installing Resin on Windows

Installing Resin on Windows begins with the installation of Java (which we just covered). Run all of the appropriate tests to verify that Java has been cleanly installed and is operational. The installation instructions that follow are based on Java 1.4.0_01 and Resin-EE 3.0.2. We set JAVA_HOME as a system-wide environment variable.

Start the Resin server installation by downloading the latest version compressed as a Zip file from www.caucho.com/download/. On this page, under the heading Latest Version, you'll see two versions: resin-3.0.2.zip and resinee-3.0.2.zip. Choose resin-ee-3.0.2.zip as it will provide you with all of the features needed for the examples in this book. Either launch the download or save it in an appropriate location on your hard drive.

When the file is uncompressed, it will save all of its contents in a root directory called \resin-ee-3.0.2. You have the option of placing this directory anywhere on your system. In most cases, you'll want to place the directory at the root or drive level, such as c:\resin-ee-3.0.2. Once the file is uncompressed, Resin creates a complete directory structure like the one shown in Figure 2.2. Right now, the primary directory we are interested in is \bin—this is where the server executables are located. In a Windows environment, there are basically two ways to begin the execution of the server: manually and as a service.

click to expand
Figure 2.2: The Windows Resin installation directory hierarchy.

For the manual approach, begin by double-clicking on the HTTPD.exe icon in the <root directory>/resin-3.0.2/bin directory. Or you can start a command prompt and execute the server by typing the command httpd. After you double-click or run the command from the command prompt, two dialog windows will appear. The first is a command prompt within which the Resin server begins execution, as shown in Figure 2.3. The second window, shown in Figure 2.4, is a small control panel that allows you to halt the server easily.

click to expand
Figure 2.3: A command prompt within the Resin execution.

click to expand
Figure 2.4: The Resin launch control panel.

The server can be shut down by stopping the server process: simply click the Stop radio button, shown in Figure 2.4, and then click the Quit button. Figure 2.3 shows the initialization steps executed during the startup of the Resin Core server. Note the following:

  • The server will automatically compile and initialize applications found in the directory hierarchy where Resin was initially installed.

  • The server will begin listening on port 8080 of the host machine for HTTP requests.

  • The server will automatically start listening on port 6802 for srun requests.

As we see later in this chapter, you can change the ports used for request listening.

Windows Service Startup

The process we just described works well for server development needs and simple installations, but in a production setting (or whenever you don't want to deal with constantly starting the server manually), you can start Resin automatically by installing it as a Windows service under Windows NT, 2000, or XP.

To install Resin as a service, open a Windows command prompt and change to the /bin directory of the Resin installation. In this directory are two executables: httpd.exe (which we used earlier in our discussion) and a file called setup.exe, which includes several simple configuration options. In most cases, use the following command to start the service installation:

 httpd -install 

This command installs Resin into the service component of the operating system using the default configuration file (resin.conf) found in the /conf directory. The dialog box shown in Figure 2.5 confirms the installation was successful.

click to expand
Figure 2.5: The service installation confirmation dialog box.

Once installed as a service, the server can be started and stopped using the Services dialog box in Administration Tools or by using command prompt commands. When executed, the Services application looks like Figure 2.6.

click to expand
Figure 2.6: The Services application with the Resin server installed.

The service entry installed by the -install command-line flag used earlier is highlighted in Figure 2.6. When first installed, the service isn't actually started; it is just placed in the services system. Use this dialog box to start the service by right-clicking on the Resin Web Server entry and selecting the start option, as shown in Figure 2.7, or by pressing the black right arrow on the toolbar.

click to expand
Figure 2.7: The right-click menu for the Resin Web server.

The Status column will have a value of Started, as shown in Figure 2.8. The service can be stopped or restarted using the toolbar button, also shown in Figure 2.8.

click to expand
Figure 2.8: Running the Resin Web server.

The service can also be started and stopped using commands entered in a command prompt window. The commands to start and stop the service are:

 net start resin net stop resin 

At any time, you can remove the Resin Web Server service from the system by issuing the following command in the /bin directory of the Resin installation:

 httpd -remove 

Note that there appears to be a bug in some versions of the JDK and the related JVM. In these versions, the JVM will stop executing when the administrator logs out of the Windows machine. To keep this from occurring, install the service with the command

 httpd -install -Xrs -conf/myconf.conf 

The X command-line flag passes the options rs to the JDK used when starting the Resin server and keeps the JDK VM from stopping when the administrator logs out.

Another bug has been reported in Windows 2000 that might occur when you install the service using the command-line option. For example, the following command starts the service and forces the server to use a specific configuration file:

 httpd -install -conf conf/myconf.conf 

In some cases, the system refuses to register the new service. In this instance, you can add command-line options to the Resin Web Server entry in the Service application by bringing up the right-click menu, selecting Properties, and adding the command-line option in the Path To Executable edit box.




Mastering Resin
Mastering Resin
ISBN: 0471431036
EAN: 2147483647
Year: 2002
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net