
Here are some hints from our web server administrators on how to make sure your cgi script works properly on our server.
But first... check out some of the CGI scripts that Internode provides for use on your website.
The email submission form allows a user to fill in a form on your web page and have the results automatically mailed to you (i.e. a feedback form or even a product order form). For basic information on how to use this CGI script see http://www.yourdomain.com.au/cgi/mail (substitute yourdomain with your companies web address)
This feature is only available for UNIX hosted corporate webspace customers. This feature is not available for Windows webserver customers or "www.users.on.net".
The Internode Page Counter is also easily included on your web pages to calculate visitors to your website.
The Internode webserver provides a counter mechanism that enables you to add counters to your pages (on that server) without having to coordinate with Internode first. If you add a counter to a page, the counter is automatically created, with a zero count. Here's the essential HTML required to place a counter in a page.
<img src="/cgi/nph-count?width=6&link=/username/pagename.html">
Other attributes can be added to improve the layout of a counter image. For example:
<img src="/cgi/nph-count?width=10&link=/username/pagename.html" alt="[Page hit counter]" height="20" width="90">
Note: substitute /username/pagename.html above with your username and the name of the page you wish to count the hits of.
Users of Internode have the ability to run their own programs written in the programming language perl, written as cgi scripts to be run in their web space. When a CGI script is executed, it is run as the user id we allocate to you on our web server for your virtual hosting facilities.
The idea is that databases or other files you have can be made readable and writeable only by your user id, and then only CGI scripts and the user FTP'ing in can access and modify the files.
Permissions can be set by the user with the FTP command site
chmod permissions file, where permissions is a standard
permissions number line 755. The first digit is permissions for the
user, the second permissions for the group, and the last permissions
for everyone else. Each digit is composed from numbers representing
different permissions, 4 for read access, 2 for write access, and
1 for execute access. So 7 is full access, 0 is no access, 4 is read
only, 6 is read and write but no execute access.
The CGI script itself can be made read/write/execute only by the user themselves if it contains sensitive information. This is permission 700.
.cgi or .pl, or be in a directory
called cgi-bin at the top level of a virtual server. #!/usr/bin/perl. Usually a problem
with those coming from NT Systems. print "Content-Type:
text/html
"; Errors are logged to the virtual server's error log file. If using Perl's standard CGI module, the following lines include the standard CGI module, then include some intercept code to take any compilation errors and format them in HTML so the user can easily determine the problem.
use CGI;
use CGI::Carp qw(fatalsToBrowser);
Also of note is that /cgi/ on all virtual servers is
mapped to /web/cgi/, so that clients can use our standard
CGI scripts referenced as in their own virtual server..
As a general note, we provide this facility for experienced and competent perl programmers. We are unable to provide free programming advice if you are unfamiliar with this language. Instead, we strongly suggest you engage the services of an experienced perl programmer - we can recommend some if you would like.
If you import non-trivial perl packages into our server from somewhere else and you're not familiar with perl, you should (again) be prepared to engage the services of a perl consultant to help you - again we can help with pointers here and can contract staff out to assist you if you wish.