The UK's longest established independent ISP
Support - CGI - Writing your own

If your virtual server offers the facility of a cgi-bin directory, then you can write your own CGI scripts using PERL. If you are unsure as to whether you have CGI access, then please contact customer support. If you would rather use existing CGI scripts than write your own, please check out the pre-written scripts which we have made available for your use.

Here are a couple of websites that may help:

CGI Programming FAQ (help on getting started with CGI scripting)
The PERL website

When writing CGI scripts on our servers, it is important to get the file permissions on your scripts correct. Please bear the following two points in mind:

If your CGI scripts are not executable, then the web server will not be able to run them, and the scripts will return "Permission Denied" errors.

If they are writable by anyone other than your username, or owned by any other username, then the webserver will refuse to run them, giving "Internal Server Error".

Where should I put my CGI scripts?

The safest place to put your CGI scripts is in the cgi-bin directory, which you will find on the same level as the public_html directory in your FTP space. This maps on to an address of http://www.yourdomain.com/cgi-bin/ but not being underneath the document root of your virtual server, there is no chance that someone could view the source code for your CGI scripts.

What is the directory of my webspace?

The path to the root of your ftp space is normally something like /var/web/username

That means that the public_html directory will be /var/web/username/public_html

and the cgi-bin directory will be /var/web/username/cgi-bin

To reference the public_html directory from a cgi script in the cgi-bin directory, you would normaly just use ../ as the directory path.

Where are Perl and Sendmail?

The Perl executable is /usr/bin/perl and it is currently at version 5.6.0 on our servers
The Sendmail executable is /usr/sbin/sendmail and is currently at version 8.9.3 on our servers.

How can I debug my CGI scripts?

Although we only upload web server log files once a day (in the early hours of the morning) the error log file for your virtual server updates instantly, which can be used to debug your CGI scripts. You will find this in the logs/ directory of your FTP space.

Any questions?

We regret that we can't offer in depth programming advice for free, or even offer to debug your scripts for you, but will point you in the right direction wherever possible. E-mail us on support@zetnet.net



 


 
 
 
 

Contact our support department:
0870 748 2368 or support@zetnet.net


Copyright Zetnet Ltd 2007. All rights reserved.