CGI, SSI and Perl - FAQ

 

1. How do I upload my CGI scripts using FTP?

2. How do I call my CGI script?

3. Are there any limitations placed on CGI scripts?

4. What version of Perl is supported?

5. What path do I use to call Perl?

6. What path do I use to call sendmail?

7. I'm getting 'Internal server error' running my Perl script. What's wrong?

8. I'm getting 'file not found' running my script. What's wrong?

9. Do you support Server Side Includes?

10. My SSI doesn't seem to be running at all. What could be wrong?

11. I'm getting '[an error occurred while processing this directive]' when running a perl script as an SSI. What can I do?
12. Can I user server-parsed image maps?

13. Can I change file permissions if I only have FTP access?

14. What path do I use to access files in my home directory using my cgi script?

 

 

 

 

 


 

1. How do I upload my CGI scripts using FTP?

All CGI programs must be uploaded to your cgi-bin directory. You should be sure to use ASCII mode when uploading Perl scripts.


 

2. How do I call my CGI script?

In your HTML documents, reference your cgi script with the following path:
http://www.yourdomain.com/cgi-bin/script


 

3. Are there any limitations placed on CGI scripts?

The following limitations will be placed on ALL CGI scripts:

 

CPU TIME = 10 Seconds This is the amount of CPU time one CGI program can use at a given time.

MAXIMUM FILESIZE = 100 KBytes This is the maximum size that one CGI script can reach

MAXIMUM STACK SIZE = 8 MBytes This is the amount of stack memory that can be used by any CGI program.

MAXIMUM NUMBER OF PROCESSES = 32 Processes This is the number of processes that can be created by the CGI program at a given time.

MAXIMUM NUMBER OF OPEN FILES = 32 Open Files This is the number of files that can be opened by the CGI program at a given time.


 

4. What version of Perl is supported?

5.005_03


 

5. What path do I use to call Perl?

/usr/bin/perl


 

6. What path do I use to call sendmail?

/usr/sbin/sendmail


 

7. I'm getting 'Internal server error' running my Perl script. What's wrong?

When executed, you must print an HTTP header followed by a blank line. The header must contain either a Content-type field or a Location field. eg. print "Content-type: text/htmlnn";
You have incorrectly set the path to Perl in your script.
You have used invalid Perl arguments.


 

8. I'm getting 'file not found' running my script. What's wrong?

Check the following:
script is located in your cgi-bin directory.
page that calls the script has the path properly specified.
script has world read & executable permission.


 

9. Do you support Server Side Includes?

Yes!


 

10. My SSI doesn't seem to be running at all. What could be wrong?

You need to make sure that the page with the SSI has a .shtml extension. The web server will only parse files with this extension.


 

11. I'm getting '[an error occurred while processing this directive]' when running a perl script as an SSI. What can I do?

Make sure that you are using the following format to call include your program:
<!--#include virtual="/cgi-bin/script.pl"-->
Note that your SSI will not function if you use the exec cgi directive. You should also ensure that your file's extension is .shtml.


 

12. Can I user server-parsed image maps?

Yes. You may store the image and its associated map file in your own directories. The server then processes the map file as part of the normal html document parsing performed.


 

13. Can I change file permissions if I only have FTP access?

Yes. ftp access also allows you to run a variety of ommands. These include the chmod &chown commands.


 

14. What path do I use to access files in my home directory using my cgi script?

The path would be as follows:
services/webpages/[first_letter_of_domain]/[second_letter_of_domain]/[domain]/[file]
[domain] is replaced with your domain
[file] is replaced with the filename including sub-directory information being accessed

 

Here is an example:
/services/webpages/y/o/yourdomain.com/chat/chat.log