Sun Java System Web Server 7.0 Update 4 Developer's Guide

ProcedureTo Create a cgi-bin Directory and Define User and Group

To prevent a virtual server’s CGI programs from interfering with other users, the CGI programs must be stored in a unique directory and executed with the permissions of a unique UNIX user and group.

Before You Begin

Create the UNIX user and group. The exact steps required to create a user and group vary by operating system. For instructions, refer your operating system's documentation.

  1. Log in as a superuser.

  2. Change to the document root directory for the virtual server.

    cd document-root

  3. Create the cgi-bin directory and set appropriate permissions.

    mkdir cgi-bin
    chown user:group cgi-bin
    chmod 755 cgi-bin
  4. Set the virtual server’s CGI directory, user, and group in one of the following ways.

    • Modify the obj.conf file.

      Use the user and group parameters of the send-cgi Service SAF in the obj.conf file. For detailed instructions, see the Sun Java System Web Server 7.0 Update 4 Administrator’s Configuration File Reference.

    • In the Admin Console,

      1. Select Common Tasks tab. .

      2. Select CGI Directories from the Virtual Server Tasks list

        The CGI Settings window is displayed.

      3. Type the user and the group that can execute CGI programs.

        For more information on CGI directories, see the Sun Java System Web Server 7.0 Update 4 Administrator’s Guide.

    • Use the set-cgi-prop command to define a unique CGI directory, UNIX user and group for a virtual server.

      For example:

      /wadm set-cgi-prop --user=admin --password-file=admin.pwd --host=serverhost --port=8989 --config=config1 user=admin group=group