SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    Hibernator YuriKolovsky's Avatar
    Join Date
    Nov 2007
    Location
    Malaga, Spain
    Posts
    1,072
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    CGI-BIN what is it, and how to use it.

    There is this CGI-BIN folder outside of my webroot, that most of you have probably seen, i can live without it in designing websites, etc.
    I know it has something to do with web security as it has a permission level of 750.

    my curiosity is killing me, what is a CGI-BIN and how/when to use it?

  2. #2
    SitePoint Wizard silver trophy Crazybanana's Avatar
    Join Date
    Mar 2003
    Location
    In tha fruit cellar
    Posts
    1,379
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    it can be used to run cgi scripts for blogs, guestbooks, chat, ads, mailing lists, counters etc... cgi scripts can be written in perl language among others like c. c++, unix shell, python etc...

    just place them into the cgi-bin directory and set the permissions
    Who's to doom when the judge himself is dragged before the bar


  3. #3
    SitePoint Member eileensab's Avatar
    Join Date
    Sep 2008
    Location
    usa
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CGI bin is used mostly by CGI and Perl scripts. Check out hotscripts and you will see a category for these type of scripts.

    http://www.hotscripts.com/CGI_and_Pe...ams/index.html

  4. #4
    Hibernator YuriKolovsky's Avatar
    Join Date
    Nov 2007
    Location
    Malaga, Spain
    Posts
    1,072
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    can php be a cgi script?

  5. #5
    SitePοint Troll disgracian's Avatar
    Join Date
    Aug 2006
    Location
    Samsara
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anything that is executable and writes to STDOUT (standard output) can be a CGI script.

    Cheers,
    D.

  6. #6
    SitePoint Enthusiast Tim Greer's Avatar
    Join Date
    Aug 2001
    Location
    California, home of the bear...
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CGI stands for Common Gateway Interface. It allows you to indeed use PHP scripts and run in CGI mode via the CGI gateway interface. CGI scripts can be coded in PHP, Perl, Python, C, C++, Shell, Ruby, and more languages.

    The cgi-bin directory is just a very common name for a general script aliased directory. This means that it's intended to execute files as CGI automatically, without relying upon a file extension (i.e., .php, .cgi, .pl, etc.) to know it's executable. It doesn't display any text/putout unless you tell it to within the script itself, so it helps more naturally protect the files and data stored within it and allows you a more controlled way of serving up the files and preventing mistakes. A script aliased directory can be called anything, but your host would have to set up any customized names for you. You can also just usually add a file with a .cgi file extension for the web server to recognize it's a CGI script to be executable (most likely) without having to place it within a script aliased directory (but this depends on your hosts' configuration).
    Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
    http://www.burlyhost.com/ Shared Hosting, Reseller Hosting, more!
    Industry's most experienced staff! -- Web Hosting With Muscle!

  7. #7
    Hibernator YuriKolovsky's Avatar
    Join Date
    Nov 2007
    Location
    Malaga, Spain
    Posts
    1,072
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    any good tutorials on cgi (any computer language, that you prefer) that you would recommend?

  8. #8
    SitePoint Enthusiast Tim Greer's Avatar
    Join Date
    Aug 2001
    Location
    California, home of the bear...
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What it is:
    http://hoohoo.ncsa.uiuc.edu/cgi/

    Apache CGI information:
    http://httpd.apache.org/docs/1.3/howto/cgi.html
    http://httpd.apache.org/docs/2.0/howto/cgi.html

    Free ebook about CGI using Perl examples:
    http://oreilly.com/openbook/cgi/

    Really, the language tutorials would be completely different than CGI tutorials. There's not much most people need to know about CGI (what it is, how it works, etc.), and it's mainly about knowing the language you want to use and just knowing only a few key things about permissions, ownerships and outputting the correct headers (again, not much there to know). The rest is really the language, in which case you'd just read documentation or a book about your language of choice (that topic can really go too far in-depth to try and even remotely cover here in a forum post).
    Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
    http://www.burlyhost.com/ Shared Hosting, Reseller Hosting, more!
    Industry's most experienced staff! -- Web Hosting With Muscle!

  9. #9
    Hibernator YuriKolovsky's Avatar
    Join Date
    Nov 2007
    Location
    Malaga, Spain
    Posts
    1,072
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •