Sun Java System Web Server 6.1 SP12 Administrator's Guide

Starting and Stopping the Server

Once the server is installed, it runs constantly, listening for and accepting HTTP requests.

The status of the server appears in the Server On/Off page. You can start and stop the server using one of the following methods:

After you shut down the server, it might take a few seconds for the server to complete its shut-down process and for its status to change to “Off.”

If your machine crashes or is taken offline, the server stops and some of the requests being serviced can be lost.


Note –

If you have a security module installed on your server, enter the appropriate passwords before starting or stopping the server.



Note –

On a UNIX platform, some Sun Java System Web Server installations may require access to a large amount of memory and/or file descriptors than allowed by default. If you are unable to start the server, check the resource limits imposed by your operating system using the ulimit command. The operating system’s ulimit man page should provide more information.


Setting the Termination Timeout

When the server is turned off, it cannot accept new connections. It then waits for all outstanding connections to complete. The time the server waits before timing out is configurable in the magnus.conf file, which can be found in server_root/https-server_name/config/. By default it is set to 30 seconds. To change the value, add the following line to magnus.conf:

TerminateTimeout seconds

where seconds represents the number of seconds the server waits before timing out.

The advantages to configuring this value is that the server will wait longer for connections to complete. However, because servers often have connections open from nonresponsive clients, increasing the termination timeout may increase the time it takes for the server to shut down.

Restarting the Server (UNIX/Linux)

To restart the server use one of the following methods:

Because the installation scripts cannot edit the /etc/rc.local and /etc/inittab files, you must edit these files with a text editor. If you do not know how to edit these files, consult your system administrator or system documentation.

Typically, you cannot start an SSL-enabled server with either of these files because the server requires a password before starting. Although you can start an SSL-enabled server automatically if you keep the password in plain text in a file, this practice is not recommended.


Caution – Caution –

Leaving the SSL-enabled server’s password in plain text in the server’s start script is a large security risk. Anyone who can access the file has access to the SSL-enabled server’s password. Consider the security risks before storing the SSL-enabled server’s password in plain text.


The server’s start script, key pair file, and the key password should all be owned by root (or, if a non-root user installed the server, that user account), with only the owner having read and write access to these files.

Starting SSL-enabled Servers Automatically

If security risks are not a concern for you,

ProcedureTo start your SSL-enabled server automatically

  1. Using a text editor open the start file located in the server_root/https-server_id.

  2. Locate the -start line in the script and insert the following:

    echo "password"|

    where password is the SSL password you have chosen.

    For example, if the SSL password is netscape, the edited line might look like this:

    -start)

    echo "netscape"|./$PRODUCT_BIN -d $PRODUCT_SUBDIR/config $@

Restarting the Server with the Inittab (UNIX/Linux)

To restart the server using inittab, include the following text on one line in the /etc/inittab file:

http:23:respawn:server_root/type-identifier/start -start -i

where server_root is the directory where you installed the server, and type-identifier is the server’s directory.

The -i option prevents the server from putting itself in a background process.

Remove this line before you stop the server.

Restarting With the System RC Scripts (UNIX/Linux)

If you use the /etc/rc.local, or your system’s equivalent, place the following line in the /etc/rc.local:

server_root/type-identifier/start

Replace the server_root with the name of the directory in which you installed the server.

Restarting the Server Manually (UNIX/Linux)

To restart the server from the command line, log in as root if the server runs on ports with numbers lower than 1024; Alternatively, log in as root or with the server’s user account. At the command-line prompt, type the following line and press Enter:

server_root/type-identifier/start

where server_root is the directory where you installed the server.

You can use the optional parameter -i at the end of the line. The -i option runs the server in inittab mode, so that if the server process is ever killed or crashed, the inittab will restart the server. This option also prevents the server from putting itself in a background process.


Note –

If the server is already running, the start command fails. You must stop the server first, then use the start command. If the server fail to start, you should kill the process before trying to restart it.


Stopping the Server Manually (UNIX/Linux)

If you used the etc/inittab file to restart the server you must remove the line starting the server from /etc/inittab and type kill -1 1 before you try to stop the server. Otherwise, the server restarts automatically after it is stopped.

To stop the server manually, log in as root or use the server’s user account (if that is how you started the server), and then type the following at the command line:

server_root/type-identifier/stop

Restarting the Server (Windows)

Restart the server using the Services Control Panel in one of the following ways:

ProcedureTo restart the server

  1. From the Control Panel double-click the Services icon.

  2. Scroll through the list of services and select the service for your server.

  3. Select Automatic to start the server each time the computer starts or reboots.

  4. Click OK.


    Note –

    You can also use the Services dialog box to change the Server's account. For more information about changing the Server's account, see Changing the User Account (UNIX/Linux).


    By default, the web server prompts the administrator for the key database password before starting up. If you want to be able to restart an unattended web server, you need to save the password in a password.conf file. Only do this if your system is adequately protected so that this file and the key databases are not compromised.

Using the Automatic Restart Utility (Windows)

The server is automatically restarted by a server-monitoring utility if the server crashes. On systems that have debugging tools installed, a dialog box with debugging information appears if the server crashes. To help debug server plug-in API programs (for example, NSAPI programs), disable the auto-start feature by setting a high timeout value. Also turn off the debugging dialog boxes by using the Registry Editor.

Changing the Time Interval (Windows)

To change the time interval for the server between startup and automatic restart, perform the following steps:

  1. Start the Registry Editor.

  2. Select your server’s key (in the left side of the Registry Editor window, located in HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Enterprise\6.0).

  3. Choose Add Value from the Edit menu. The Add Key dialog box appears.

  4. In Value Name, type MortalityTimeSecs.

  5. Select REG_DWORD from the Data Type drop-down list.

  6. Click OK. The DWORD Editor dialog box appears.

  7. Type the time interval (in seconds) between startup and automatic restart.

    The interval can be in binary, decimal, or hexadecimal format.

  8. Click the numerical format for the value you entered in the previous step (binary, decimal, or hexadecimal).

  9. Click OK.

    The MortalityTimeSecs value appears in hexadecimal format at the right side of the Registry Editor window.

Turning Off the Debugging Dialog Box (Windows)

If you installed an application (such as a compiler) that has modified system debugging settings and the server crashes, you might see a system-generated application error dialog box. The server will not restart until you click OK.

ProcedureTo turn off the debugging dialog box

  1. Start the Registry Editor.

  2. Select the AeDebug key, located in the left side of the Registry window in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion.

  3. Double-click the Auto value in the right side of the window.

    The String Editor dialog box appears.

  4. Change the string value to 1.