About forms and CGI scripts on IU's web server
CGI programs and scripts are executable; if you have one, you are allowing anyone in the world to run a program on your computer. Because of the potential security risks, users with web pages on the UITS Mypage web server may not use CGI scripts.
CGI programs are permitted on the IU central web server (Webserve). Such programs must adhere to UITS's Network Information Services guidelines for information providers. See Executing CGI Scripts.
For information about obtaining an account on Webserve, see At IU, who can have an account on Webserve, and how do I get one?
For more information about web pages at IU, visit the IU Webmaster's page.
On this page:
- Setting up CGI scripts on Webserve
- Alternatives to CGI programs
- Tutorials for forms and CGI applications
Setting up CGI scripts on Webserve
To run CGI scripts from your account on Webserve:
- Name your script so that it ends with a
.cgior a.plextension. Scripts without one of these extensions will not run on Webserve.
- Put the script in your
wwwdirectory or any subdirectory of yourwwwdirectory.
- Set the permissions of the script to read, write, and execute for
the owner only. To do this, move to the directory
where your script is stored and, at the command prompt,
enter:
chmod 700 scriptname
Replace
scriptnamewith the name of your script. For more information on thechmodcommand, see In Unix, how do I change the permissions for a file? - Make a link to your CGI script from a web page, or use the action
attribute in the <form> tag of a form that submits information
to your CGI script. As with your other files on the server, you don't
need to include the
wwwdirectory within the URL for your script. The URL of your script will be in the following form: http://www.iupui.edu/~netid/subdirectory/scriptnameReplace
iupuiwith your campus designation, if necessary. Replacenetidwith the account's Network ID username, and if your script is in a subdirectory ofwww, replacesubdirectorywith the name of the subdirectory of your script. Replacescriptnamewith the name of your script. - Test your script to make sure it is working properly.
The information above comes from Executing CGI Scripts.
For useful utilities and guides for creating web pages on Webserve, see Tools for IU Information Providers.
Alternatives to CGI programs
You may not need a CGI program to complete certain tasks. Consider the following options:
- You can use Java applets; see Is Java supported on IU's web servers?
- You can limit who has access to your web pages; see How do I limit access to my web pages?
- You can use links to online utilities hosted by other sites, such as guest books and counters. Searching the web (e.g., using Google or Yahoo!) will return many useful links.
Tutorials for forms and CGI applications
The IU Webmaster web site provides tutorials on using forms and CGI applications on Indiana University's web server (Webserve). In particular, the following may be helpful:
- Tools and Guides for Webserve Accounts
- Web Forms with Transform 3.0: the Users' Guide
- WebHost Services Usage Reports
Last modified on January 31, 2011.







