Login as a superuser.
Create the private directory for Cgistub:
Installing Cgistub in the install_dir/https-instance/private directory is recommended. If you install it anywhere else, you must specify the path to Cgistub in the init-cgi function in magnus.conf. For details, see the Sun Java System Web Server 7.0 Administrator’s Configuration File Reference.
It is not possible to install the suid Cgistub program on an NFS mount. If you wish to use an suid Cgistub, you must install your server instance to a local file system.
Copy Cgistub to the private directory:
Set the owner of private to the server user:
chown user .
Set the permissions on private:
Set the owner of Cgistub to root:
chown root Cgistub
Set the permissions on Cgistub:
chmod 4711 Cgistub
You can give each reference to the send-cgi SAF in obj.conf a user parameter.
For example: Service fn="send-cgi" user="user"
You can use variable substitution. For example, in server.xml, give a virtual-server element the following variable subelement:
This modification to the server.xml allows you to write the send-cgi SAF line in the obj.conf as follows:
Service fn="send-cgi" user="$user"
For more information about server.xml and send-cgi in the obj.conf file and , see the Sun Java System Web Server 7.0 Administrator’s Configuration File Reference.
Restart the server to apply the changes.
Cgistub enforces the following security restrictions:
The user the CGI program executes as must have a uid of 100 or greater. This prevents anyone from using Cgistub to obtain root access.
The CGI program must be owned by the user it is executed as and must not be writable by anyone other than its owner. This makes it difficult for anyone to covertly inject and then remotely execute programs.
Cgistub creates its UNIX listen socket with 0700 permissions.
Socket permissions are not respected on a number of UNIX variants, including current versions of Sun operating systems/Solaris. To prevent a malicious user from exploiting Cgistub, ensure that the server's temporary directory is set (using the server.xml temp-path element) to a directory accessible only to the server user.