Loading...


bookmark - What Is The Cgi-bin Folder Used For ?

What Is The Cgi-bin Folder Used For ?

 
 Discussion by omarsdali with 12 Replies.
 Last Update: April 16, 2010, 1:13 pm ( View Rated (1) )
 
bookmark - What Is The Cgi-bin Folder Used For ?  
Quickly Post to What Is The Cgi-bin Folder Used For ?  w/o signup Share Info about What Is The Cgi-bin Folder Used For ?  using Facebook, Twitter etc. email your friend about What Is The Cgi-bin Folder Used For ? Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

I have a quick question for you guys,

I noticed that in CPanel, there is a cgi-bin folder under the www folder, and there is a cgi-bin folder that's created for every subdomain I have. What is this cgi-bin directory suppose to be used for ? And is it safe to just delete it ? Thanks in advance.










   Sun Dec 23, 2007    Reply         

the cgi-bin is a place to run scripts from.
It takes up little or no space and there may be complications if you delete it, so until somebody comes along with further information, I would not delete it.

   Sun Dec 23, 2007    Reply         

QUOTE

the cgi-bin is a place to run scripts from.


What kind of scripts ? Can you give an example ?

   Sun Dec 23, 2007    Reply         


No, I can't because I code in PHP, but cgi is named as "Common Gateway Interface" and is often PERL scripting, AFAIK.
CGI scripts have been replaced with ASP and php for most sites, depending on the scripting languages supported on the Server.
Trap17 allows php.

   Sun Dec 23, 2007    Reply         

omarsdali, the cgi-bin folder is for cgi scripts that you want to be use to be executed.

You can get an idea of what it is here: http://en.wikipedia.org/wiki/Common_Gateway_Interface

   Sun Dec 23, 2007    Reply         

doh! what happens if i accidentally deleted that folder? :lol: it doesnt seem to have any contents, does it?

   Sat May 23, 2009    Reply         


Hi!

A CGI script is just like a normal script, except that it is called using the Common Gateway Interface. The use of CGI is no longer recommended because it creates a separate Operating System process for handling a request.

A previous poster to this thread mentions about the use of Perl to create CGI scripts, but you can use just about any scripting language - you can even use PHP or Shell script! :-)

The purpose of the CGI script folder is that you can grant executable privileges to these scripts but can leave them as read-only. This helps achieve a higher level of security as a user can't abuse the system by uploading their own scripts and injecting code to call their scripts. The basic idea is that you shouldn't grant executable privileges wherever you've got write privileges and vice-versa.

Regards,
Nitin Reddy

   Sat May 23, 2009    Reply         

QUOTE (k_nitin_r)

Hi!

A CGI script is just like a normal script, except that it is called using the Common Gateway Interface. The use of CGI is no longer recommended because it creates a separate Operating System process for handling a request.

A previous poster to this thread mentions about the use of Perl to create CGI scripts, but you can use just about any scripting language - you can even use PHP or Shell script! :-)

The purpose of the CGI script folder is that you can grant executable privileges to these scripts but can leave them as read-only. This helps achieve a higher level of security as a user can't abuse the system by uploading their own scripts and injecting code to call their scripts. The basic idea is that you shouldn't grant executable privileges wherever you've got write privileges and vice-versa.

Regards,
Nitin Reddy
Link: view Post: 445303


So it is safe to delete it right? is it really empty? the cgi-bin folder for the add-on domains? i can see the one for the main domain has contents in it.

cause i deleted mine via FTP and checked the trash bin, i dont think it will be in trash bin when you deleted it via FTP.. :lol:

   Sat May 23, 2009    Reply         

My site now says Opps! this link appears to be brokenWhat Is The Cgi-bin Folder Used For ?

I'm in the process of putting up my first site. Using MattieBlaze for Hosting and FileZilla as my FTP Client.  Problem is when I opened the FTP Interface I deleted too many items on the lower right hand screen, things I thought were unrelated to the site itself.  Now when I type in the URL I get "Opps this link appears to be broken". Error HTTP 404.

Please help, this is nuts. It's my first site.

Ralph 

-reply by Ralph

   Wed Nov 25, 2009    Reply         

QUOTE (k_nitin_r)

The purpose of the CGI script folder is that you can grant executable privileges to these scripts but can leave them as read-only. This helps achieve a higher level of security as a user can't abuse the system by uploading their own scripts and injecting code to call their scripts. The basic idea is that you shouldn't grant executable privileges wherever you've got write privileges and vice-versa.
Link: view Post: 445303


Somehow I've never used the CGI folder or had any use for it. The thing is I've always set read/write permissions
in c-panel anyway(for example 0777 for full permissions) , which appears to be the same thing anyway,
without needing a CGI folder.
Also, if somebody could hack into your system why couldn't they just delete the contents of
the CGI folder anyway? Perhaps perl users would know more and have the full answers.

   Mon Dec 28, 2009    Reply         

This isn't entirely accurate. Some servers can be configured to use a pool of CGI processes to pass requests to, meaning a process is not started anew for each request. Furthermore, 'cgi-bin' is just a folder. It can be configured to have any other name and serve the same purpose. -Certain- scripts are traditionally placed inside of the conventional 'cgi-bin' folder in order to use the Common Gateway Interface (what CGI stands for) to communicate with executables on the host system (or, as I've mentioned, pooled processes). Typically, however, it's better to rely on a module to get the work done for you, or to pass instructions using a system API.

I hope that clarifies.

QUOTE (k_nitin_r)

The use of CGI is no longer recommended because it creates a separate Operating System process for handling a request.
Link: view Post: 445303

   Mon Dec 28, 2009    Reply         

To answer the question, I wouldn't bother to delete it, it doesn't take any space and besides, I think it will be created again after some time automatically if you'll be playing with CPanel for example by doing something..

   Tue Dec 29, 2009    Reply         

Oops there seems to be an error (404 Error Code)What Is The Cgi-bin Folder Used For ?

 A 404 is a page not found error code that the server automatically defaults to if it can't find an index. Upload, or replace the page in question with an index.Html file. You don't even have to put anything on it, but if you're planning on visitors, or even get them already it may be smart to put a page under construction banner up.

Sounds like a GoDaddy default 404, so you can ftp the file or use file manager on the GoDaddy website to upload with the built in utility.

-reply by SoliHost

 

   Fri Apr 16, 2010    Reply         

Quickly Post to What Is The Cgi-bin Folder Used For ?  w/o signup Share Info about What Is The Cgi-bin Folder Used For ?  using Facebook, Twitter etc. email your friend about What Is The Cgi-bin Folder Used For ? Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Similar Topics:

Need Help Cant Run Cgi On Trap17 ...

Hi. ** note: i did create this topic before, but under a stupid name, so i didnt get replies. Sorry about that :S ** Im new to perl and CGI could someone tell me how to run CGI on trap17 free hosting. I have created a programme which look like CODEprint ...more

   07-Sep-2008    Reply         

Strange Folders In My Web Root Fold...

Updating my site and looking through the logs my eye caught a visit to a page called "klux.php" i viewed the file which was in a subfolder under "iqici" and as i suspected it was full of references to the KKK. Needless to say this isnt something i want on my website. ...more

   22-Jan-2010    Reply         

Undo Function For Folders In Window...

Hi, I use Windows 7 Ultimate, and for some odd reason, while trying to delete a subfolder from my D:\ drive (a second hard drive used for backups etc.), a great deal of folders were wiped off, while I only wanted to remove the one. I also made the mistake of pressing & ...more

   07-Aug-2010    Reply         

Have There Been Any Changes? PHP script not working anymore.   Have There Been Any Changes? PHP script not working anymore. (1) (6) Trap17 + Computinghost(partner Site Question)   Trap17 +  Computinghost(partner Site Question)