Setting up CGI
Tips for using CGI on different platforms
In order to use CGI scripts, you will normally need higher access to the server than users normally have. CGI scripts are normally saved in the "cgi-bin" of the Web server. Your best bet is to try to run a development server locally, before trying to upload to a production server (see Next steps for links to download server software). If your script doesn't run correctly, check some first debugging suggestions.
- Unix
- You must set the permissions on your uploaded file (using chmod): for a cgi program, it's generally 755 (for example: chmod 755 filename.cgi); for a file that needs to be written to (i.e. log file) it's generally 777 [CuteFTP on Windows or Fetch on the Mac make it easier to change permissions when uploading files].
- The Perl Institute has a wealth of information related to the native version of Perl under Unix. For specific Web servers, see the Apache or Netscape sites.
Windows
Use the Explorer to associate perl scripts with the ".cgi" file extension. For the Microsoft IIS server, install the correct script mapping registry keys.
For more info, see the ActiveState Perl Window FAQ (comes with download of Perl), especially on the configuration of Apache, Netscape and IIS servers to use Perl.
Mac
Normal file extension is either .cgi, .acgi (scripts run asynchronously) or .fcgi (for Frontier scripts). Perl scripts must be saved as "CGI scripts" within MacPerl. AppleScript CGI's should be saved in the Script Editor with options "Stay open" and "Never show startup screen" checked.
For more info, see the WebStar site or that for WebTen.