CGI Essentials and Tips
Freeola Internet Get Dotted Domains Blog Guides Forums
CGI Essentials and Tips
Menu

Freeola Guides


CGI Essentials

By Freeola Support on 14th July, 2016 | 0 Comment(s)

Welcome to the Freeola Internet customer support pages. This guide is designed to give general information about CGI scripting. For more internet help topics please visit our main Support Page.

 

CGI stands for Common Gateway Interface. It allows you to run a script on the Freeola Internet servers which can perform tasks that are not available in HTML. For example, hit counters, guestbooks and random image displays to name but a few.

 

CGI scripts are simply text or ASCII files which are 'compiled on the fly' (interpreted by a program on the server rather than the browser) by the Perl interpreter. They can be edited or created on any text editor and must be saved with a '.cgi' file extension.

 

To run a script on the Freeola Server there are a few configuration settings for your script which must be changed or added inside the script. The following instructions are for the standard hosting servers we provide, for VIP Hosting customers please click here or visit the bottom of this page for some slightly different settings needed.

 

Standard Hosting

 

The following instructions apply to customers using Freeola's standard hosting service.

All Freeola standard hosting accounts have usernames beginning with the characters sr, if you have a vip username please see the bottom section of this page.

 

Path To Perl: #!/usr/bin/perl

 

This must be on the VERY first line or the script will not work.

 

Some or all of the following settings may be required by your script. If you have downloaded a third party script there may be comments within the script to tell you where to place them. Instructions could also be within any text files which accompany the script.

 

Path To Sendmail: /usr/sbin/sendmail

 

For sending e-mail from your script

 

Full Server Path To Web Space Root Directory

 

This depends on your Freeola User Name. The last 2 numbers form part of the path (e.g. For 'sr0011223' the path is /freeola/users/3/2/sr0011223. For 'sr0024658' the path is /freeola/users/8/5/sr0024658).

 

Full Server Path To CGI Directory

 

As the with the server path above to web space above, this is based on your Freeola User Name (e.g. For 'sr0011223' the path is /freeola/users/3/2/sr0011223/cgi-shl/. For 'sr0024658' the path is /freeola/users/8/5/sr0024658/cgi-shl/.

 

Full URL For Web Space

 

Your web address as viewed by a browser (e.g. www.bob.spursfans.com or www.mydomain.com).

 

Full URL To CGI Script

 

Your web address with '/cgi-bin/' added to the end (e.g. www.bob.spursfans.com/cgi-bin/).

 

Full URL To Temporary File

 

This is probably the directory you wish to send information from your script to. Your web address plus a temporary file name (e.g. www.bob.spursfans.com/tempfile/).

 

E-Mail Address

 

The e-mail address which you would like your script to send e-mails to. The '@' symbol in the e-mail address should be preceded by a '\' symbol. For example, '[email protected]' would be john\@spursfans.co.uk. This is only required if you are setting an email address in the script itself.

 

Uploading CGI Scripts

 

CGI scripts must be placed within your cgi-shl directory in your web space account otherwise it will not work. The file MUST be transferred in 'Text' or 'ASCII' mode and NOT in 'Automatic' or 'Binary' mode.

 

Now that your script is on the server you need to set the 'Permissions' for the script using your FTP software, this is the way that you open access to the script for people accessing the website. Take care with this procedure as setting the wrong permissions can deny even you access to the script.

 

In your FTP software there should be a link for 'Set Permissions' or CHMOD (if you cannot find this link you may have to use a different FTP program). There are two ways to change permissions for a file. The first is to enter a number which will identify the permissions for the file. ALL scripts in the cgi-shl directory should be set to CHMOD 755.

 

If your script outputs information to or creates a file or a web page the file or page must be stored in a sub-directory of the htdocs directory. Create this sub-directory using your FTP software, then using CHMOD again set permissions for the directory and any file within it to 777.

 

VIP and VIP+ Hosting

 

There are a few changes to the above information for customers using a VIP or VIP+ Hosting service. All other settings are the same as listed above apart from the exceptions given below:

 

Full Server Path To Web Space Root Directory

 

The full path to your web space root for VIP customers is simply /httpd/

 

Full Server Path To CGI Directory

 

Similar to above, the path to the CGI directory is /httpd/cgi-bin/

 

Uploading CGI Scripts

 

CGI scripts must be placed within your cgi-bin directory in your web space account otherwise it will not work. The file MUST be transferred in 'Text' or 'ASCII' mode and NOT in 'Automatic' or 'Binary' mode.


Did you find this article helpful?

Yes | No


Article Comments (0)
There are currently no comments on this article.
Add your comment:

Comments are limited to 750 characters, you have 750 remaining.

Freeola is a UK internet service provider offering the best value and extensive free services. Please compare our domain name registration prices or check out our UK high speed internet access. If you are in business please see examples of our free hosting at Freeola.com/customer-sites.

Safe and Secure Payment

Tell us what you think!

Live Chat is offline

Live Chat is available:
9am to 6:30pm Monday to Friday (excluding bank holidays).

01376 55 60 60

Send us a ticket.