cgi_bin

Discussion in 'Perl Misc' started by Nick Wedd, Oct 20, 2007.

  1. Nick Wedd

    Nick Wedd Guest

    When I first wrote Perl cgi scripts to run on web sites, I was told to
    put them in a directory called cgi_bin. I did so, assuming either that
    the name of the directory was significant, or that the cgi_bin provided
    by the web host has some magic property.

    As I have written more scripts and used more servers, I have come to
    realise that this is not at all necessary. I can put a cgi script
    wherever I like, just as I can a .gif file. There is no magic involved.

    So why did books and web hosts once encourage the use of a directory
    called cgi_bin? Have things changed, or was it always irrelevant where
    you kept your cgi scripts?

    Nick
    --
    Nick Wedd
    Nick Wedd, Oct 20, 2007
    #1
    1. Advertising

  2. Nick Wedd wrote:
    > When I first wrote Perl cgi scripts to run on web sites, I was told to
    > put them in a directory called cgi_bin. I did so, assuming either
    > that the name of the directory was significant, or that the cgi_bin
    > provided by the web host has some magic property.
    >
    > As I have written more scripts and used more servers, I have come to
    > realise that this is not at all necessary. I can put a cgi script
    > wherever I like, just as I can a .gif file. There is no magic
    > involved.
    > So why did books and web hosts once encourage the use of a directory
    > called cgi_bin? Have things changed, or was it always irrelevant
    > where you kept your cgi scripts?


    This is a question about which webserver you are using, how it is
    configured, and best practices for structuring web sites.
    It has nothing to do with Perl and you may get much better responses asking
    a NG that actually deals with web servers and web sites.

    jue
    Jürgen Exner, Oct 20, 2007
    #2
    1. Advertising

  3. Nick Wedd

    still me Guest

    On Sat, 20 Oct 2007 12:36:25 GMT, "Jürgen Exner"
    <> wrote:

    >This is a question about which webserver you are using, how it is
    >configured, and best practices for structuring web sites.
    >It has nothing to do with Perl and you may get much better responses asking
    >a NG that actually deals with web servers and web sites.


    Or, more directly, if you can put cgi programs in any directory on
    your web server and they execute, the web server is very poorly
    configured. I'd have serious questions about the abilities of the
    people running the web server. In addition, There are also a lot of
    aspects of having executable programs running from only one directory
    that you can use to your advantage in laying out your web site (that
    go away in a loose structure).
    still me, Oct 21, 2007
    #3
  4. Nick Wedd

    Nick Wedd Guest

    In message <>, still me
    <> writes
    >On Sat, 20 Oct 2007 12:36:25 GMT, "Jürgen Exner"
    ><> wrote:
    >
    >>This is a question about which webserver you are using, how it is
    >>configured, and best practices for structuring web sites.
    >>It has nothing to do with Perl and you may get much better responses asking
    >>a NG that actually deals with web servers and web sites.

    >
    >Or, more directly, if you can put cgi programs in any directory on
    >your web server and they execute, the web server is very poorly
    >configured.


    They don't execute if I just put them there - I have to chmod them to
    assign execute rights.

    > I'd have serious questions about the abilities of the
    >people running the web server. In addition, There are also a lot of
    >aspects of having executable programs running from only one directory
    >that you can use to your advantage in laying out your web site (that
    >go away in a loose structure).


    Obviously I have the ability to keep all my executables in one directory
    if I want to - but I don't see how this helps. Can you explain?

    Nick
    --
    Nick Wedd
    Nick Wedd, Oct 21, 2007
    #4
  5. Nick Wedd <> wrote:
    > In message <>, still me
    ><> writes
    >>On Sat, 20 Oct 2007 12:36:25 GMT, "Jürgen Exner"
    >><> wrote:
    >>
    >>>This is a question about which webserver you are using, how it is
    >>>configured, and best practices for structuring web sites.



    Note that this newsgroup is for discussing the Perl programming language.


    > Obviously I have the ability to keep all my executables in one directory
    > if I want to - but I don't see how this helps. Can you explain?



    Please ask questions about web server configuration in a newsgroup
    that has some connection with web servers.


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
    Tad McClellan, Oct 21, 2007
    #5
  6. Tad McClellan wrote:
    > Nick Wedd <> wrote:
    >>> On Sat, 20 Oct 2007 12:36:25 GMT, "Jürgen Exner"
    >>> <> wrote:
    >>>> This is a question about which webserver you are using, how it is
    >>>> configured, and best practices for structuring web sites.

    >
    > Note that this newsgroup is for discussing the Perl programming language.


    So? Perl programs, intended to be run via CGI, are not very useful if
    you don't know how to run them, you know.

    >> Obviously I have the ability to keep all my executables in one directory
    >> if I want to - but I don't see how this helps. Can you explain?

    >
    > Please ask questions about web server configuration in a newsgroup
    > that has some connection with web servers.


    Any suggestions? The FAQ suggests comp.infosystems.www.authoring.cgi,
    which has been out of order for over a year.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 21, 2007
    #6
  7. Nick Wedd

    Lars Eighner Guest

    In our last episode, <>, the lovely and
    talented Gunnar Hjalmarsson broadcast on comp.lang.perl.misc:

    > Tad McClellan wrote:
    >> Nick Wedd <> wrote:
    >>>> On Sat, 20 Oct 2007 12:36:25 GMT, "Jürgen Exner"
    >>>> <> wrote:
    >>>>> This is a question about which webserver you are using, how it is
    >>>>> configured, and best practices for structuring web sites.

    >>
    >> Note that this newsgroup is for discussing the Perl programming language.


    > So? Perl programs, intended to be run via CGI, are not very useful if
    > you don't know how to run them, you know.


    >>> Obviously I have the ability to keep all my executables in one directory
    >>> if I want to - but I don't see how this helps. Can you explain?

    >>
    >> Please ask questions about web server configuration in a newsgroup
    >> that has some connection with web servers.


    > Any suggestions? The FAQ suggests comp.infosystems.www.authoring.cgi,
    > which has been out of order for over a year.


    So, run them from the command line. You complain that nameless authors of
    nameless books recommend putting scripts in "cgi_bin" --- why do you not ask
    those authors?

    Frankly, I do not know why authors would give you that advice. The default
    configuration for most of the servers in use on the web defines the script
    alias directory as "/cgi-bin/" and since a hyphen is not an underscore, I
    do not know where your authors got their advice.

    --
    Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
    Countdown: 457 days to go.
    What do you do when you're debranded?
    Lars Eighner, Oct 21, 2007
    #7
  8. Lars Eighner wrote:
    > In our last episode, <>, the lovely and
    > talented


    Oh, I'm flattered.

    > Gunnar Hjalmarsson broadcast on comp.lang.perl.misc:
    >
    >> Tad McClellan wrote:
    >>> Nick Wedd <> wrote:
    >>>>> On Sat, 20 Oct 2007 12:36:25 GMT, "Jürgen Exner"
    >>>>> <> wrote:
    >>>>>> This is a question about which webserver you are using, how it is
    >>>>>> configured, and best practices for structuring web sites.
    >>> Note that this newsgroup is for discussing the Perl programming language.

    >
    >> So? Perl programs, intended to be run via CGI, are not very useful if
    >> you don't know how to run them, you know.

    >
    >>>> Obviously I have the ability to keep all my executables in one directory
    >>>> if I want to - but I don't see how this helps. Can you explain?
    >>> Please ask questions about web server configuration in a newsgroup
    >>> that has some connection with web servers.

    >
    >> Any suggestions? The FAQ suggests comp.infosystems.www.authoring.cgi,
    >> which has been out of order for over a year.

    >
    > So, run them from the command line. You complain that nameless authors of
    > nameless books recommend putting scripts in "cgi_bin" --- why do you not ask
    > those authors?
    >
    > Frankly, I do not know why authors would give you that advice. The default
    > configuration for most of the servers in use on the web defines the script
    > alias directory as "/cgi-bin/" and since a hyphen is not an underscore, I
    > do not know where your authors got their advice.


    Excuse me, Lars, but who are you talking to?

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 21, 2007
    #8
  9. >>>>> "NW" == Nick Wedd <> writes:

    NW> Obviously I have the ability to keep all my executables in one
    NW> directory if I want to - but I don't see how this helps. Can
    NW> you explain?

    As has been explained to you at least twice, the use of a cgi-bin
    directory is entirely a question of web server configuration, and has
    nothing whatsoever to do with Perl specificially. The answer would be
    the same if the executables in the the cgi-bin directory were written
    in C or Java or INTERCAL. So ask for explanation in a newsgroup or on
    a mailing list where web server configuration is on topic.

    (Your inability to find such a forum that will answer your question is
    not justification for asking it here, either.)

    Charlton


    --
    Charlton Wilbur
    Charlton Wilbur, Oct 21, 2007
    #9
  10. Charlton Wilbur wrote:
    >>>>>> "NW" == Nick Wedd <> writes:

    >
    > NW> Obviously I have the ability to keep all my executables in one
    > NW> directory if I want to - but I don't see how this helps. Can
    > NW> you explain?


    <snip>

    > (Your inability to find such a forum that will answer your question is
    > not justification for asking it here, either.)


    Even if we don't know anything about the OPs ability in that respect,
    I'd say that the lack of a more appropriate Usenet group _does_ justify
    him asking it here.

    Quoted from "perldoc -q usenet":

    "Use comp.lang.perl.misc for topics which do not have a more-appropriate
    specific group."

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 21, 2007
    #10
  11. Suppose that your webserver is organised so that several people write
    ordinary static pages under directories they own but that one person is
    responsible for the webserver as a whole. (This might not be an unusual
    situation and certainly applies to my own server.)

    Forcing all CGIs to be in the cgi-bin directory means that a new CGI
    (in a directory writable only by root) has to pass at least some
    quality assessment before installation.

    Also it's just good organisation to keep related things together
    and a directory of CGIs may make a useful unit to keep together
    in a version control system.

    --
    Elvis Notargiacomo master AT barefaced DOT cheek
    http://www.notatla.org.uk/goen/
    all mail refused, Oct 22, 2007
    #11
  12. >>>>> "GH" == Gunnar Hjalmarsson <> writes:

    GH> Charlton Wilbur wrote:

    >> (Your inability to find such a forum that will answer your
    >> question is not justification for asking it here, either.)


    GH> Even if we don't know anything about the OPs ability in that
    GH> respect, I'd say that the lack of a more appropriate Usenet
    GH> group _does_ justify him asking it here.

    GH> Quoted from "perldoc -q usenet":

    GH> "Use comp.lang.perl.misc for topics which do not have a
    GH> more-appropriate specific group."

    Ah, but there *is* a more appropriate specific group for this
    question, and it's called comp.infosystems.www.authoring.cgi. And
    even more relevantly, it's mentioned in the FAQ answer you cited as an
    appropriate place to ask CGI-specific questions. If you're going to
    cite the FAQ at people, I recommend you read the answers fully, and
    not snip only the bits that you like.

    There are also likely to be groups dedicated to his web server: the
    mailing list, for instance, if he's using
    Apache. This is also a far more appropriate place to ask Apache
    questions with no specific Perl content.

    Your quotation from the FAQ does not support your stance, especially
    as the same question directs the reader to a more appropriate place.
    Language-independent questions about the configuration of web servers,
    and about the *historical* configuration of web servers, simply do not
    belong in comp.lang.perl.misc. That's why the word 'perl' is in the
    name of the newsgroup, and why the Perl FAQ directs people to ciwac.

    Charlton


    --
    Charlton Wilbur
    Charlton Wilbur, Oct 22, 2007
    #12
  13. Charlton Wilbur wrote:
    >>>>>> "GH" == Gunnar Hjalmarsson <> writes:

    >
    > GH> Charlton Wilbur wrote:
    >
    > >> (Your inability to find such a forum that will answer your
    > >> question is not justification for asking it here, either.)

    >
    > GH> Even if we don't know anything about the OPs ability in that
    > GH> respect, I'd say that the lack of a more appropriate Usenet
    > GH> group _does_ justify him asking it here.
    >
    > GH> Quoted from "perldoc -q usenet":
    >
    > GH> "Use comp.lang.perl.misc for topics which do not have a
    > GH> more-appropriate specific group."
    >
    > Ah, but there *is* a more appropriate specific group for this
    > question, and it's called comp.infosystems.www.authoring.cgi. And
    > even more relevantly, it's mentioned in the FAQ answer you cited as an
    > appropriate place to ask CGI-specific questions.


    And if you had been a little more attentive, and read the whole thread
    before you posted, you had noticed that I - in my reply to Tad - pointed
    out that the group in question has been out of order for more than a year.

    > If you're going to
    > cite the FAQ at people, I recommend you read the answers fully, and
    > not snip only the bits that you like.


    If you're going to reply to other people's posts, I recommend you follow
    the Usenet netiquette and review the whole thread before posting.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 22, 2007
    #13
  14. >>>>> "GH" == Gunnar Hjalmarsson <> writes:

    GH> And if you had been a little more attentive, and read the
    GH> whole thread before you posted, you had noticed that I - in my
    GH> reply to Tad - pointed out that the group in question has been
    GH> out of order for more than a year.

    What does that have to do with anything? There's a more appropriate
    place to post the question, and there's no Perl content in the
    question. Does the appropriate place not functioning suddenly excuse
    a total lack of Perl content?

    If that's the case, I'd love to ask some questions about roleplaying
    games here (as rec.games.frp.moderated is nonfunctional) and knitting
    (as I can't find a knitting-specific newsgroup). By your logic, both
    of those should be perfectly fine, no?

    Charlton


    --
    Charlton Wilbur
    Charlton Wilbur, Oct 22, 2007
    #14
  15. Abigail wrote:
    > Gunnar Hjalmarsson () wrote on VCLXIV September MCMXCIII
    > in <URL:news:>:
    > &&
    > && I'd say that the lack of a more appropriate Usenet group _does_ justify
    > && him asking it here.
    > &&
    > && Quoted from "perldoc -q usenet":
    > &&
    > && "Use comp.lang.perl.misc for topics which do not have a more-appropriate
    > && specific group."
    >
    > Don't take things out of context. Here's the context:
    >
    > Several groups devoted to the Perl language are on Usenet:
    >
    > comp.lang.perl.announce Moderated announcement group
    > comp.lang.perl.misc High traffic general Perl discussion
    > comp.lang.perl.moderated Moderated discussion group
    > comp.lang.perl.modules Use and development of Perl modules
    > comp.lang.perl.tk Using Tk (and X) from Perl
    >
    > comp.infosystems.www.authoring.cgi Writing CGI scripts for the Web.
    >
    > Some years ago, comp.lang.perl was divided into those
    > groups, and comp.lang.perl itself officially removed.
    > While that group may still be found on some news servers,
    > it is unwise to use it, because postings there will not
    > appear on news servers which honour the official list of
    > group names. Use comp.lang.perl.misc for topics which do
    > not have a more-appropriate specific group.
    >
    >
    > Clearly, as anyone with some usenet knowledge ought to know,
    > comp.lang.perl.misc is for topics that not have a more-appropriate
    > specific group WITHIN the comp.lang.perl.* hierarchie.


    The FAQ mentions ciwac as one of the groups devoted to the Perl language
    into which comp.lang.perl was divided. Consequently, your interpretation
    is not obvious at all.

    Unfortunately this discussion is not about linguistic semantics. It's
    actually caused by some regulars' disinterest in CGI and in giving those
    who want to use Perl for CGI apps a helping hand with the CGI side of
    it. This thread comes to mind:
    http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/463c4e90b6dbc2ea

    I use Perl for web stuff and will keep doing so, because I like it.
    However, if a newbie would ask for my advice on which language is best
    to learn for web stuff, I think I would answer PHP. Not because I
    personally have a firm opinion on which language is best suited for the
    area, but because I imagine that there is no similar 'anti-web attitude'
    in the groups and forums that deal with PHP.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 22, 2007
    #15
  16. Charlton Wilbur wrote:
    >>>>>> "GH" == Gunnar Hjalmarsson <> writes:

    >
    > GH> And if you had been a little more attentive, and read the
    > GH> whole thread before you posted, you had noticed that I - in my
    > GH> reply to Tad - pointed out that the group in question has been
    > GH> out of order for more than a year.
    >
    > What does that have to do with anything? There's a more appropriate
    > place to post the question, and there's no Perl content in the
    > question. Does the appropriate place not functioning suddenly excuse
    > a total lack of Perl content?


    Even if the question was not really a Perl question, there is an obvious
    Perl connection that anybody can see who wants to see it. You don't want
    to see it - not much I can do about that.

    See also my reply to Abigail.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 22, 2007
    #16
  17. Gunnar Hjalmarsson <> wrote:
    > Charlton Wilbur wrote:
    >>>>>>> "GH" == Gunnar Hjalmarsson <> writes:

    >>
    >> GH> Charlton Wilbur wrote:
    >>
    >> >> (Your inability to find such a forum that will answer your
    >> >> question is not justification for asking it here, either.)

    >>
    >> GH> Even if we don't know anything about the OPs ability in that
    >> GH> respect, I'd say that the lack of a more appropriate Usenet
    >> GH> group _does_ justify him asking it here.



    > And if you had been a little more attentive, and read the whole thread
    > before you posted, you had noticed that I - in my reply to Tad - pointed
    > out that the group in question has been out of order for more than a year.



    So if the garbage man, errr, I mean the waste management personnel
    won't take my old mattress away, then it is OK to just dump it anywhere?

    The lack of somewhere else to ask web server configuration questions
    does not mean that it is OK to post non-Perl questions in the
    Perl newsgroup.


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
    Tad McClellan, Oct 22, 2007
    #17
  18. Charlton Wilbur <> wrote:
    >>>>>> "GH" == Gunnar Hjalmarsson <> writes:

    >
    > GH> And if you had been a little more attentive, and read the
    > GH> whole thread before you posted, you had noticed that I - in my
    > GH> reply to Tad - pointed out that the group in question has been
    > GH> out of order for more than a year.
    >
    > What does that have to do with anything? There's a more appropriate
    > place to post the question, and there's no Perl content in the
    > question. Does the appropriate place not functioning suddenly excuse
    > a total lack of Perl content?
    >
    > If that's the case, I'd love to ask some questions about roleplaying
    > games here (as rec.games.frp.moderated is nonfunctional) and knitting
    > (as I can't find a knitting-specific newsgroup). By your logic, both
    > of those should be perfectly fine, no?



    The 2nd one would be be OK only if you were using a purl stitch.

    :)


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
    Tad McClellan, Oct 22, 2007
    #18
  19. Gunnar Hjalmarsson <> wrote:
    > Abigail wrote:
    >> Gunnar Hjalmarsson () wrote on VCLXIV September MCMXCIII
    >> in <URL:news:>:
    >> &&
    >> && I'd say that the lack of a more appropriate Usenet group _does_ justify
    >> && him asking it here.



    But he does not have a question about the Perl programming language,
    which is the topic of this newsgroup.

    Defending off-topic posting is a futile postion to take...


    > Unfortunately this discussion is not about linguistic semantics.



    And neither is it about Perl.

    It is about web server configuration.

    If the OP chose to use Python instead, the answer to his
    question would be *exactly the same*.

    The answer is independant of programming language, hence cannot
    be on topic in a newsgroup about a particular programming language.


    > It's
    > actually caused by some regulars' disinterest in CGI and in giving those
    > who want to use Perl for CGI apps a helping hand with the CGI side of
    > it.



    I'm one of the "other" regulars then, as I don't mind helping with
    a CGI application written in Perl.

    What I do mind is off-topic posts whose answer is unchanged
    when you substitute "Python" or "PHP" for "Perl".


    > However, if a newbie would ask for my advice on which language is best
    > to learn for web stuff, I think I would answer PHP.



    And that would be the right answer.

    PHP was created specifically for "web stuff", so it should
    be expected to be good at web stuff.


    > Not because I
    > personally have a firm opinion on which language is best suited for the
    > area, but because I imagine that there is no similar 'anti-web attitude'
    > in the groups and forums that deal with PHP.



    When you find a thread that serves as an example of what you're
    speaking of, point it out.

    This thread is clearly not such an example, as his question has
    no relationship to the Perl programming language.


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
    Tad McClellan, Oct 23, 2007
    #19
  20. >>>>> "GH" == Gunnar Hjalmarsson <> writes:

    GH> Even if the question was not really a Perl question, there is
    GH> an obvious Perl connection that anybody can see who wants to
    GH> see it. You don't want to see it - not much I can do about
    GH> that.

    Hardly - I see the alleged connection, but I think it's far too
    tenuous to justify the post.

    I mean, I use Perl utilities to keep track of some things related to
    role-playing games. Since rec.games.frp.moderated is dead, that means
    I can post RPG-related questions here, right?

    And I'm thinking someday of writing some software to help with
    knitting patterns, and I might use Perl. Since there's no newsgroup
    dedicated to knitting, and there are purl stitches involved, that
    means I can post knitting questions here, right?

    Both of those have about as solid a connection to Perl as the OP's
    question. Why is asking his question here defensible, while asking
    those is not?

    Charlton



    --
    Charlton Wilbur
    Charlton Wilbur, Oct 23, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page