1 |
Korthrun wrote: |
2 |
> It seems to me that when I setup .cgi and .pl via an addhandler |
3 |
> statement such as: |
4 |
> |
5 |
> AddHandler cgi-script .cgi .pl |
6 |
> |
7 |
> apache will try to execute anything containing .pl or .cgi. |
8 |
> |
9 |
> If i have a file, foo.pl for example. |
10 |
> http://localhost/foo.pl will execute (good) |
11 |
> now if I move it to foo.txt |
12 |
> http://localhost/foo.txt will show me the contents of the file (good) |
13 |
> now if I move it to foo.pl.txt |
14 |
> http://localhost/foo.pl.txt will try to execute it, as it will if i |
15 |
> canme it foo.cgi.txt. |
16 |
> calling it foo.php.txt will still print it out, but the new lines are |
17 |
> stripped etc, it looks like it's been run through and spat out php. |
18 |
> |
19 |
> Is this intended behaviour? It kind of seems like something gone wrong. |
20 |
|
21 |
Yup, it is intended, check the doc: |
22 |
|
23 |
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler |
24 |
|
25 |
"Once that has been put into your httpd.conf file, any file containing |
26 |
the .cgi extension will be treated as a CGI program." |
27 |
|
28 |
The keyword here is "containing", not "ending with", which may be |
29 |
surprising, but it is so. :) |
30 |
-- |
31 |
Best regards, |
32 |
Luca Longinotti aka CHTEKK |
33 |
|
34 |
LongiTEKK Networks Admin: chtekk@×××××××××.com |
35 |
Gentoo Dev: chtekk@g.o |
36 |
SysCP Dev: chtekk@×××××.org |
37 |
TILUG Supporter: chtekk@×××××.ch |
38 |
-- |
39 |
gentoo-server@g.o mailing list |