Sun Java System Web Server 7.0 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 systems' documentation.

  1. Login 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.

    1. mkdir cgi-bin

    2. chown user:group cgi-bin

    3. 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 Administrator’s Configuration File Reference.

    • Use the Admin Console.

      1. Select Common Tasks tab > CGI Directories from the Virtual Server Tasks list.

        The CGI Settings window is displayed.

      2. Enter the user and the group who can execute CGI programs.

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

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

      The syntax of the command is:

      ./wadm set-cgi-prop [--user|-u admin-user] [--password-file|-w admin-pswd-file] [--host|-h admin-host] [--port|-p admin-port] [--no-ssl|-N] [--echo|-e] [--rcfile|-R rcfile] [--no-prompt|-Q] [--verbose|-v] --config|-c name [--vs|-s name] (propertyname=value)

      For example:

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