Sun WebServer 2.1 Installation Guide

Chapter 2 Configuring Sun WebServer

The Sun WebServer GUI is a browser-based, secure, graphical administration tool for administering Sun WebServer instances and sites. You must be running an administration server to run the console. Although some of the following tasks can also be performed using the command line, using the GUI is strongly recommended.

This chapter explains what need to be configured before starting Sun WebServer:

Sun WebServer Access Control

You must designate a realm that defines the server administrators; by default, the realm name is serverAdmin, and the source of information for user name and password is HTPASSWD. The source of user information determines whether user list is created with HTPASSWD utility or from the user information on the system.

You must be root to change realm information for the administration server.

You need at least one administrator of the realm so that at least one user has the ability to change the realm itself.

Using the Default Realm
  1. Create a user admin as the administrator in the serverAdmin realm:


    # htrealm add -r serverAdmin -u adminSetting password for the user admin.
    Password:
    Confirm Password:
    
  2. Assign the user admin administrative privileges for the realm so that it can create other users later:


    # htrealm add -r serverAdmin -u admin -A
    
Creating a New Server Administration Realm

To use a different realm or to change the source of user information in serverAdmin, complete the following steps:

  1. Delete the current serverAdmin definition:


    # htrealm delete -r serverAdmin
    
  2. Create a new realm.

    The realm source can be HTPASSWD, or UNIXSYS.


    # htrealm add -r serverAdmin -s UNIXSYS
    
  3. Name an existing realm user as the administrator of the realm. This user will have permission to delete or change the realm.


    # htrealm add -r serverAdmin -u userName -A
    
  4. If you used a realm name other than serverAdmin, you'll need to replace the access control in /etc/http/access.conf with your realm name.

  5. For detailed help on access.conf and htrealm, refer to the access.conf(4) and htrealm(1m) man pages.

Administration Server Port

The administration server uses port 2380 by default, but you may specify any port for the Sun WebServer administration server to use. To change the default port, edit the administration server's configuration file (located in /usr/http/admin_server/conf/admin.httpd.conf) and change the port number for the port {} block. If the administration server is already running, you must restart it to use the new port.

The default port {} block looks like:

port 2380 {
...
}

Start Sun WebServer

To start Sun WebServer, run htserver start with the -a option:


# htserver start -aadmin : Started successfully.

To verify that your server is running, use the htserver list command. If the server instance named admin has a process ID listed, then the server is running:


# htserver listInstance : admin
        Enabled : Yes
        pid : 29159
        Config file : /usr/http/admin_server/conf/admin.httpd.conf

If you want the administration server automatically restarted if it stops or at reboot, you must enable the server. If the administration server is enabled, it will be restarted whenever htserver start is run with no arguments.

To enable the server:


# htserver enable -aadmin: Enabled.

For more information on htserver, refer to the htserver(1m) man page.

Using the Sun WebServer GUI

The Sun WebServer GUI allows you to configure settings and maintain the server.

To use the Sun WebServer GUI:
  1. Open HotJavaTM.

  2. Go to URL http://hostname:port/admin/admin.html.

    For site administration, select Web Sites from the open folder list on any server configuration screen or go directly to URL http://hostname:port:admin/admin.html?server:site.

    This URL opens with the Server Properties screen.