Uploading and running CGI scripts

You can upload and run CGI scripts to make your site interact with databases and other applications.

To upload and run a CGI script:

1. Write or obtain the CGI script.

- Note: If you are writing a script that sends out email, make sure to include a valid email address in the From field header; otherwise, all replies are returned to the Web server and become unavailable to you.

2. Copy the script to the CGI directory on your site. If you are unsure of the name of your CGI directory, check the Configuration page. You can derive your CGI directory name from the Script Alias listed on the Configuration page. For example, if your Script Alias is cgi-bin, then your CGI directory name is /var/www/cgi-bin.

3. Important: If you are on a Microsoft Windows system, you need to upload CGI scripts to your site through an FTP connection instead of through the File Manager. Further, when you upload through FTP, upload files as ASCII, so that hidden characters inserted into the CGI script by Windows are translated correctly. If these characters are not translated correctly, the CGI scripts do not work.
   If you are on a Linux system, you can upload CGI scripts to your site through the File Manager. Linux does not add hidden characters to files, so no translation is needed.

3. Change the CGI script file permissions to the following settings:

- Owner: Allow Read, Write, and Execute

- Group: Allow Read and Execute

- Others: Allow Read and Execute

4. Open your Internet browser and in the Address field, enter the following URL:

http:// <web_server_name>/<script alias>/<script name>

Your CGI script runs. The results appear in the browser window.