cgi_bin

N

Nick Wedd

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
 
J

Jürgen Exner

Nick said:
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
 
S

still me

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

Nick Wedd

still me said:
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
 
T

Tad McClellan

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

Gunnar Hjalmarsson

Tad said:
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.
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.
 
L

Lars Eighner

So? Perl programs, intended to be run via CGI, are not very useful if
you don't know how to run them, you know.
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.
 
G

Gunnar Hjalmarsson

Lars said:
In our last episode, <[email protected]>, the lovely and
talented

Oh, I'm flattered.
Gunnar Hjalmarsson broadcast on comp.lang.perl.misc:




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?
 
C

Charlton Wilbur

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
 
G

Gunnar Hjalmarsson

Charlton said:
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?

(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."
 
A

all mail refused

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

Charlton Wilbur

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
(e-mail address removed) 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
 
G

Gunnar Hjalmarsson

Charlton said:
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.
 
C

Charlton Wilbur

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
 
G

Gunnar Hjalmarsson

Abigail said:
Gunnar Hjalmarsson ([email protected]) wrote on VCLXIV September MCMXCIII
in <URL:&&
&& 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.
 
G

Gunnar Hjalmarsson

Charlton said:
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.
 
T

Tad McClellan

Gunnar Hjalmarsson said:
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.
 
T

Tad McClellan

Charlton Wilbur said:
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.

:)
 
T

Tad McClellan

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

Charlton Wilbur

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top