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,037 posts
  • Gender:Male
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • Interests:http://jim.haslip.googlepages.com/home
  • myCENT:53.48
  • 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,037 posts
  • Gender:Male
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • Interests:http://jim.haslip.googlepages.com/home
  • myCENT:53.48
  • 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,043 posts
  • Gender:Male
  • Location:Dubai
  • myCENT:30.12

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.

#11 nolan

    Member [Level 3]

  • Kontributors
  • PipPipPipPipPipPip
  • 96 posts

Posted 28 December 2009 - 08:27 PM

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.

View Postk_nitin_r, on May 22 2009, 09:28 PM, said:

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


#12 Quatrux

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 585 posts
  • Gender:Male
  • Location:Lithuania, Vilnius
  • Interests:Programming
  • myCENT:56.68

Posted 29 December 2009 - 07:24 AM

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

#13 iGuest

    Hail Caesar!

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

Posted 16 April 2010 - 01:13 PM

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

 






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