Working with CGI Scripts

Article No. 65
Created: 01:14 AM 04.16.04
Author: Support
Original URL: http://myonlinehostingsupport.com/question.php?qstId=65


How to use CGI for your domain(s)

All CGI scripts used for any of the domains on your package are to be placed in /CGI-BIN in the root of your file space.

In order to reference CGI scripts from your site code, it must be referenced using relative paths.
Example: /cgi-bin/myscript.cgi

Your scripts must be world executable (permissions).
Example (RWX-X-X) (Owner, Group, Other)

Scripts do not have to be world readable, or world writeable, unless specified by the script itself.

In most cases, your FTP software will allow you to manage your file permissions. Cute FTP and WS-FTP are example FTP programs that allow this function.

Please note that your cgi-bin directory is accessible by all your sites serving under that account.

Do not attempt to create your own cgi-bin directory as the security features on our system will not permit CGI or Perl scripts to run from any directory other than the default cgi-bin directory created by the system. It is understood that you may wish to customize a script on a per site basis. Simply make a copy of the script and rename it. For example:

   www.mydomain.com/cgi-bin/formail.pl
   www.myotherdomain.com/cgi-bin/formail2.pl

Most scripts do not a "called as" check (some scripts do a check to see what name the were run as and execute code accordingly) so renaming scripts to retain multiple copies is acceptable.

Back to original article