Gentoo Archives: gentoo-server

From: Brad Plant <bplant@×××××××××.au>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] apache-2.2.4-r6
Date: Fri, 08 Jun 2007 13:01:18
Message-Id: 20070608225821.518f7741@localhost
In Reply to: Re: [gentoo-server] apache-2.2.4-r6 by Luca Longinotti
1 On Fri, 08 Jun 2007 10:57:25 +0200
2 Luca Longinotti <chtekk@g.o> wrote:
3
4 > Korthrun wrote:
5 > > It seems to me that when I setup .cgi and .pl via an addhandler
6 > > statement such as:
7 > >
8 > > AddHandler cgi-script .cgi .pl
9 > >
10 > > apache will try to execute anything containing .pl or .cgi.
11 > >
12 > > If i have a file, foo.pl for example.
13 > > http://localhost/foo.pl will execute (good)
14 > > now if I move it to foo.txt
15 > > http://localhost/foo.txt will show me the contents of the file
16 > > (good) now if I move it to foo.pl.txt
17 > > http://localhost/foo.pl.txt will try to execute it, as it will if i
18 > > canme it foo.cgi.txt.
19 > > calling it foo.php.txt will still print it out, but the new lines
20 > > are stripped etc, it looks like it's been run through and spat out
21 > > php.
22 > >
23 > > Is this intended behaviour? It kind of seems like something gone
24 > > wrong.
25 >
26 > Yup, it is intended, check the doc:
27 >
28 > http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler
29 >
30 > "Once that has been put into your httpd.conf file, any file containing
31 > the .cgi extension will be treated as a CGI program."
32 >
33 > The keyword here is "containing", not "ending with", which may be
34 > surprising, but it is so. :)
35
36 I think AddType is what you're after.
37
38 Cheers,
39
40 Brad

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-server] apache-2.2.4-r6 Korthrun <korthrun@×××××.com>