Setting up CGI-BIN scripts on rosemary.umw.edu

Follow these steps to have scripts or other programs execute on rosemary.umw.edu in response to an HTTP request from a client.

  1. Create a directory named cgi-bin to hold the scripts as a subdirectory of ~/public_html.
    Enter mkdir ~/public_html./cgi-bin
  2. Set the permissions on that directory do that the Web server may access the scripts in that directory.
    Enter chmod u=rwx,g=rx,o=rx ~/public_html./cgi-bin or chmod 755 ~/public_html./cgi-bin
  3. Create a file named .htaccess in that directory and set its contents to Options ExecCGI. Here's one way to do that
    echo "Options ExecCGI" > ~/public_html/cgi-bin/.htaccess
  4. Set permissions on .htacess so the owner has read, write access and all others have read access
    chmod o=rw,g=r,o=r ~/public_html/cgi-bin/.htaccess or chmod 644 ~/public_html/cgi-bin/.htaccess
  5. Now copy or enter a script into a file in ~/public_html/cgi-bin/. The server on rosemary is configured to execute files in this directory as long as the name of the file ends with .cgi or .pl, and the owner has read,write,execute access and all others have read, execute permission. Try this out by copying /users/ernie/public_html/cgi-bin/calendar1.cgi and calendar3.pl from that same directory into your cgi-bin directory, check permissions, and then try accessing them via the Web using your login name instead of ernie in the URL.

Creative Commons License
This work is licensed under a Creative Commons License.
Ernest Ackermann Department of Computer Science, Mary Washington College
CPSC 104 | CPSC 220 | CPSC 370K

Bibliographic Information:
.