Basic Account Assumptions
In the instructions below, the following example account details are assumed. These are only examples, but they make the setup process easier to explain in a realistic way.
- UserID: joe
- Home Directory: /users/joe
- Web documents are served from the user's public_html area.
- CGI scripts will live inside a cgi-bin directory beneath that web area.
Create the CGI Directory
If you do not already have a cgi-bin directory set up, create one inside your account. In the common CGIWrap layout, that directory lives under ~/public_html.
cd ~joe
mkdir public_html
mkdir public_html/cgi-bin
Once this structure exists, you have the usual starting point for CGIWrap script placement. If your local server uses a different layout, the administrator may have customized the path, but this is the common arrangement assumed by the distributed documentation.
AFS Environments
If you are using AFS, you will also need to set the correct AFS permissions on the directories. Standard Unix filesystem permissions are not the whole story in that environment, so review Use of CGIwrap with AFS for the permission details required to make CGIWrap function correctly.
Install the Script and Set Permissions
After your CGI directory exists, install the script into that directory and assign the proper execution permissions. The exact script name may vary, but the basic pattern looks like this:
cp script.pl ~joe/public_html/cgi-bin/script.pl
chmod 755 ~joe/public_html/cgi-bin/script.pl
At this stage, the file is in the expected place and has execution permissions set. That does not guarantee the script itself is correct, but it does mean the account-level CGIWrap setup is moving in the right direction.
Normal Execution URL
The script is executed using a CGIWrap URL that points to your userid and the script name. A typical URL pattern looks like this:
https://SERVER/cgi-bin/cgiwrap/joe/script.pl
Replace SERVER with your actual host name and adjust the script name if needed. This is the normal execution path for a user-owned CGI script under CGIWrap.
Debugging URL
If you want to see debugging output for your CGI script, specify cgiwrapd instead of cgiwrap. This returns debug-oriented output that is often much more useful when you are trying to figure out why a script is failing.
https://SERVER/cgi-bin/cgiwrapd/joe/script.pl
NPH Script URLs
If the script is an nph- style script, you may need to use one of the NPH CGIWrap variants instead. These are typically used when a script sends its own complete headers or when response handling needs to be less filtered.
https://SERVER/cgi-bin/nph-cgiwrap/joe/script.pl https://SERVER/cgi-bin/nph-cgiwrapd/joe/script.pl
In practical terms, the main pattern is simple: place the script in the correct directory, make it executable, use cgiwrap for normal execution, use cgiwrapd for debugging, and switch to the NPH variants only when your script specifically requires that style of output handling.