Home page

  Hosting plans

  Contact us

  Network information

 FAQ (support)

  Terms of service

  H2-MINI  H2-PRO  H2-BIG  H2-VIP 
•  Pre-sales questions
•  Startup configuration

•  Understanding DNS and Name Servers
•  Email problems
•  CGI, SSI, permissions
•  Microsoft Frontpage
Download Cpanel documentation
Support / CGI, SSI, permissions

What is CGI?

CGI, Common Gateway Interface, includes programs that run on the server to enhance the quality and functionality of a web site. There are many resources on-line that allow the downloading of free cgi scripts.

Do you allow CGI to run on your servers?

We do allow running of cgi scripts on the servers, however they must conform to our acceptable server resource usage policy. If we deem that a script is using an excessive amount of server resources, it will be disabled.

Setting directories within your cgi scripts.

When you configure a cgi script for "any" server, it may ask you to set variables such as the base, relative, and CGI directory/url settings. Here's an "example" using Matt Wright's wwwboard.pl script. Obviously, each script may vary, but this should provide you with some basic idea:

$basedir = "/home/yourlogin/public_html/wwwboard";
$baseurl = "http://www.yoursite.com/wwwboard";
$cgi_url = "http://www.yoursite.com/cgi-bin/wwwboard.pl";

Most scripts come with documentation on how to set these directories. Please make sure you read and understand it before configuring the script. New to cgi? Here is a page with questions and answers to numerous questions evolving around the inns and outs of using cgi within your scripts: http://www.w3.org/Security/Faq/ www-security-faq.html
Another excellent site, which provides step by step chapters is: http://www.cgi101.com/class/

What is the exact physical path to your root directory on the webserver?

The path to your root directory is: /home/yourlogin/
Obviously, substitute "yourlogin" with the login you were assigned when you first received your account details. Also, keep in mind that when you configure your CGI, that your /public_html is included in your path. For instance, if you have a guestbook.pl script in your /cgi-bin, the exact physical path to that file is:

Whats the correct path to perl?

Before a cgi script will work certain modifications must be made to them. Certain paths must be specified in some scripts. After the "#" in the first line of the perl script, the path to perl must be specified. /usr/bin/perl should suffice for this path. Below is a printout of a "whereis perl" from our system.

perl: /usr/bin/perl

What is the path to send mail?
Another program that needs to be specified in many scripts is sendmail. This is located at


Why doesn't my CGI work?

Make sure when you upload the CGI file DO NOT upload in binary mode, instead use ASCII mode. Uploading in binary will cause the server not to recognize the scripts as executables. Most FTP clients will upload .pl or .cgi files in binary mode by default so you will need to change this. You will need to upload the scripts into your cgi-bin directory for security reasons, however they will execute from anywhere within your account. The last step is to set the file permissions. This is otherwise known as chmoding and can be done from most FTP clients. For specifics on chmoding you can refer to our "chmoding files" help section.

What is SSI?

Server Side Includes
When using a UNIX system it is sometimes necessary to enable certain HTML files executable for the purpose of using SSI. Server Side Includes are often used to run a cgi script. An include is called with an example such as this: After you insert your include, you must mark the HTML file as executable so the server will parse the file.

Rename the file to .shtml: On our server any file name .shtml will be parsed. So instead of having an index.html file, you would name it index.shtml. This is the easiest way of enabling includes.

Reasons for Using SSI

SSI is often used to include something into an HTML page. You can insert the contents of one HTML page into another page. An example of a practical usage for this would be to include your e-mail address at the bottom of each page. If you do this as an include, then when your e-mail address changes, you will only have to update it on one page and not your entire web site. Another usage is to call cgi scripts into action. Many counters, clocks, and other scripts are called using SSI. The command used will most likely be provided in the documentation of your cgi script.

PLEASE do not use the .shtml extension on "all" of your web pages unless it's absolutely necessary. With a busy web site, this means that every page must be executed, as opposed to just read. This as you can appreciate, can add considerable memory and CPU load to the system. As always, read the instructions that came with your script carefully. They should provide specific instructions on how to configure the script, as well as the SSI tag.

CHMOD general info

When using a UNIX system it is sometimes necessary to change file permissions. This is done using the CHMOD command. There are two different ways to chmod a file.
Certain FTP clients such as Cute FTP and WS/FTP Pro allow for a chmoding directly within FTP. To do this you would highlight the file that you want to use, and select from the command menu "change file permissions." There is on option for "manual." This is where you will enter the desired CHMOD. Many other FTP clients will support CHMODing as well, we recommend checking the documentation.

Reasons for CHMODING

CHMODing files can be done for a variety of reasons. You can CHMOD files to do things such as: mark them executable, give them write permission, restrict access to them, and a variety of other reasons. It is important to note that chmoding is nearly impossible to avoid. If you are trying to run a certain cgi script it could require execute permissions on the script itself, write permissions on a directory, and read on an informational page. Your cgi scripts should contain the proper documentation to inform you of the proper CHMOD's.
List of CHMOD's and what they mean.
chmod 777 filename The file is available for Read, Write, and Execute for the owner, group, and world.
chmod 755 filename The file is available for Read, Write, and Execute for the owner; and Read and Execute only for the group and world.
chmod 644 filename The file is available for Read and Write for the owner, and Read only for the group and world.
chmod 666 filename The file is available for Read and Write for the owner, group, and world. I wonder if the 666 number is just a coincidence. Anybody can create havoc with your files with this wide-open permission mask.

Setting permissions on files is a relatively simple task, however MAKE SURE you fully understand what it is you're allowing the public to do with your files. For example, some less experienced users often make the fatal mistake of simply setting ALL of their files to 777. While 777 will automatically allow executing privileges, it also allows full "READ, WRITE, and EXECUTION ability to the entire world!!!!
This is how web sites get hacked! While most visitors have good intentions, all it takes is one person whom snoops about your files seeking an "Open Back Door." This could result is them gaining full access to your directories, which means they can do anything from deleting your entire site, to defacing it with obscenities.

New to cgi? Here is a page with questions and answers to numerous questions evolving around the inns and outs of using cgi within your scripts: http://www.w3.org/Security/Faq/www-security-faq.html

What is SSL?

Secure Socket Layers provide a means for submitting encrypted data via the web. SSL works based upon a public key / certificate system. As data is transmitted it is encrypted into 40 bit encryption and the web server then decrypts the data once it is transmitted. In the rare occasion that the data was stolen during the transmission process the only data that they would be would be encrypted which means that viewing it would show nothing but letters, numbers, and symbols randomly mixed.

How dose SSL work?

In order for this process to work without many warning messages from IE and Netscape about possible security hazards a certificate must be obtained from a trusted source. A certificate is only good for one domain name.

How do I add this feature?

If you would like to enable SSL on your account contact us and ask to take advantage of this feature. If you would like to have your own certificate installed so that customers can navigate your site via https://www.yourdomain.com you will have to purchase your own certificate and have us generate a key request and install it on the server. We recommend using Thawte for this purpose. Once you have the key from thawte, we will install it for you.
(Plese note there is a $15.00 one time fee to install your Personal SSL Certificate.)
You have to order one of our H2Hosting.com plan with dedicated IP!


 Copyright © 2001-2013 H2HOSTING.COM   All Rights Reserved.