Securing CGI scripts

The Common Gateway Interface (CGI) is a standard protocol which is used for interfacing external applications/softwares with an information servers like HTTP or Web servers.
If you are using any CGI program within your website then it will be executed in real-time, giving web user dynamic information, you will have to use custom CGI scripts or free scripts for getting such type of dynamic data.
All CGI scripts are executable files which will allow any webuser to run this program on your system/server thus its not safe to play with them and should be used only if required, therefore you should take utmost precautions while dealing with them. Its always better to keep all your CGI scripts in a special directory called “cgi-bin” so that the Webserver would know to execute script rather then just display it into your webbrowser. Mostly this directory is under direct control of webmaster, thus none other then you can create cgi scripts for your server and can put then into cgi-bin directory. Thus you can keep hackers away from installing cgi-scripts for your hosting account.
You should put all your CGI scripts which you want to execute into your cgi-bin directory, you can use .cgi or .pl file extensions for all your cgi scripts. cgi-bin directory have 755 permission so you just need to upload your required scripts into this directory so that they can be executed in real-time.

cgi scripts Securing CGI scripts

If you want you can put cgi scripts in any directory your want, but for security reasons its always suggested to put them in cgi-bin directory as they have potentially large security holes. If all your cgi scripts are kept al central location within cgi-bin directory then it would be easier to keep track of all your scripts which you have installed on your server so that you can manage them efficiently.

Posted under Fantastico Hosting, Reseller Hosting, WHM cpanel Hosting, cPanel account Hosting

This post was written by admin on November 7, 2008

Tags: ,