1 |
On 6/8/07, Brad Plant <bplant@×××××××××.au> wrote: |
2 |
> On Fri, 08 Jun 2007 10:57:25 +0200 |
3 |
> Luca Longinotti <chtekk@g.o> wrote: |
4 |
> |
5 |
> > Korthrun wrote: |
6 |
> > > It seems to me that when I setup .cgi and .pl via an addhandler |
7 |
> > > statement such as: |
8 |
> > > |
9 |
> > > AddHandler cgi-script .cgi .pl |
10 |
> > > |
11 |
> > > apache will try to execute anything containing .pl or .cgi. |
12 |
> > > |
13 |
> > > If i have a file, foo.pl for example. |
14 |
> > > http://localhost/foo.pl will execute (good) |
15 |
> > > now if I move it to foo.txt |
16 |
> > > http://localhost/foo.txt will show me the contents of the file |
17 |
> > > (good) now if I move it to foo.pl.txt |
18 |
> > > http://localhost/foo.pl.txt will try to execute it, as it will if i |
19 |
> > > canme it foo.cgi.txt. |
20 |
> > > calling it foo.php.txt will still print it out, but the new lines |
21 |
> > > are stripped etc, it looks like it's been run through and spat out |
22 |
> > > php. |
23 |
> > > |
24 |
> > > Is this intended behaviour? It kind of seems like something gone |
25 |
> > > wrong. |
26 |
> > |
27 |
> > Yup, it is intended, check the doc: |
28 |
> > |
29 |
> > http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler |
30 |
> > |
31 |
> > "Once that has been put into your httpd.conf file, any file containing |
32 |
> > the .cgi extension will be treated as a CGI program." |
33 |
> > |
34 |
> > The keyword here is "containing", not "ending with", which may be |
35 |
> > surprising, but it is so. :) |
36 |
> |
37 |
> I think AddType is what you're after. |
38 |
> |
39 |
> Cheers, |
40 |
> |
41 |
> Brad |
42 |
> |
43 |
> |
44 |
It seems so. Thanks for that. |
45 |
|
46 |
No clue how I missed this last night: |
47 |
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#multipleext |
48 |
|
49 |
I always associated an extention with the end of the file name, but |
50 |
that's kind of silly when you think about it. |
51 |
|
52 |
-- |
53 |
() The ASCII Ribbon Campaign - against HTML Email, |
54 |
/\ vCards, and proprietary formats. |
55 |
-- |
56 |
gentoo-server@g.o mailing list |