Using CGI/Perl

CGIs must be set with executable file permissions, or requests for the script from the web server will result in an Internal Server error. Scripts that need to be executable should have their permission set with chmod 755. This sets the file's permissions so that the file's owner may read, write, and execute the file; and anyone else can only read and execute it. You can do this using FTP, the Webshell3 file manager, or via SSH if enabled.

You can create complex web pages using any of the standard HTML editors and the HTML publishing capabilities of many popular desktop applications. You can create and link the web pages themselves on your desktop computer, and then move them to the appropriate directory in your virtual server via an FTP program or our Webshell3 File Manager in the website control panel. We currently have no restrictions on CGI scripts as long as they do not affect the performance on the system to the point at which others will notice.

All accounts have access to their personal cgi-bin located inside the domain directory. 

You will want to put your files here:

/hsphere/local/home/
username/domain.com/cgi-bin

You can then access it in a page with this URL

h
ttp://yourdomainname.com/cgi-bin

Using CGI Scripts

Our servers support CGI scripts written in Perl, C, and other languages. If CGI is enabled for your site then you can add CGI scripts to work with your web content. Use FTP to upload your .cgi and .pl files. You must use ASCII mode to upload CGI files.

Once the file is on the server, use your FTP program or use the SSH command "chmod 775 filename.cgi" to make the script executable. 

The path to Perl is /usr/bin/perl

By default, CGI scripts must use .pl or .cgi filename extensions in order to be executed by the web server. However, you can change the extension names under the "Web Options" section of your end user control panel.

Here are some things you can check if you are having trouble with cgi scripts:

 
• Check to see if the permissions on your script are as follows:
   -rwx rwx r-x (775) or -rwxr-xr-x (775)

 • Run the following command: head -50 "filename" (filename is the name of your script).
   This will display the first 50 lines of your script. If the file looks like someone took your
   text file and ran it through a paper shredder, then you may not have uploaded your file
   in ASCII or TEXT mode.

 • Check the first line of your script to see if it is exactly as follows: #!/usr/bin/perl

Also, check to see if you are specifying the correct path to all commands.

Here are a few examples:

•  sendmail: /usr/sbin/sendmail

•  perl: /usr/bin/perl

•  date: /usr/bin/date