Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

What Is The Cgi-bin Folder Used For ?


12 replies to this topic

#1 omarsdali

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 74 posts

Posted 23 December 2007 - 07:05 AM

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.

#2 jlhaslip

    Insert Custom Title Here

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,040 posts
  • Gender:Not Telling
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • myCENT:81.07
  • Spam Patrol

Posted 23 December 2007 - 03:01 PM

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.

#3 omarsdali

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 74 posts

Posted 23 December 2007 - 03:29 PM

Quote

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

What kind of scripts ? Can you give an example ?

#4 jlhaslip

    Insert Custom Title Here

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,040 posts
  • Gender:Not Telling
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • myCENT:81.07
  • Spam Patrol

Posted 23 December 2007 - 03:36 PM

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.

#5 craz

    Newbie [Level 3]

  • Kontributors
  • PipPipPip
  • 45 posts
  • Gender:Male
  • Location:-------------------

Posted 23 December 2007 - 11:10 PM

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....teway_Interface

#6 frozen.fish

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 348 posts
  • Gender:Male
  • Location:Everywhere
  • myCENT:42.64

Posted 23 May 2009 - 01:29 AM

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

#7 k_nitin_r

    Grand Imperial Poobah

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPip
  • 1,114 posts
  • Gender:Male
  • Location:Dubai
  • myCENT:50.55

Posted 23 May 2009 - 03:28 AM

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

#8 frozen.fish

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 348 posts
  • Gender:Male
  • Location:Everywhere
  • myCENT:42.64

Posted 23 May 2009 - 08:58 AM

View Postk_nitin_r, on May 23 2009, 11:28 AM, said:

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

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:

#9 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 25 November 2009 - 10:00 PM

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

#10 networker

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 661 posts
  • Gender:Male
  • myCENT:35.34

Posted 28 December 2009 - 07:54 PM

View Postk_nitin_r, on May 23 2009, 03:28 AM, said:

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.

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.




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users