Support / KnowledgeBase

 
Search the KnowledgeBase Search

Running scripts outside of the cgi-bin

  • Applies to: All Service Types

  • Difficulty: Easy

  • Time needed: 5 minutes

  • Tools needed: None

 

This article describes how to execute scripts outside of the cgi-bin using an .htaccess file.

As with so many other features of the apache web server, CGI settings can be modified using .htaccess files.  Please consult our KnowledgeBase article "What is an .htaccess file?" for further information.

To enable execution of CGI files outside of your cgi-bin directory you can create a .htaccess file and add these lines:

AddHandler cgi-script .cgi

Options +ExecCGI

Then upload the text file to the desired directory and rename it to ".htaccess". This will allow scripts to execute anywhere on your website. Customers may find it easier to use the File Manager in the WebControl panel to edit this file, or to use SSH since files that begin with a "." are typically invisible to most FTP programs.


NOTE:


If you would like to run CGI scripts that end with the .pl extension your .htaccess file should also include the line:

AddHandler cgi-script .pl 

If you are using this directive in your existing cgi-bin directory, the above line alone will also work.

Revisions:

07-20-2009: Minor Fixes
 


User Comments

No visitor comments posted. Post a comment

Fields marked with an asterisk(*) are required. Comment on this article

Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue