You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "michael watson (IAH-C)" <mi...@bbsrc.ac.uk> on 2007/11/20 15:22:32 UTC
Apache offers to download the perl script rather than execute it!
Hi
I am sure this is an age old problem, and one I have had before, but I
cannot find how to solve it.
My set up from error_log:
[Tue Nov 20 14:07:53 2007] [notice] Apache/2.2.4 (Unix) PHP/5.2.1
mod_perl/2.0.3 Perl/v5.8.5 configured -- resuming normal operations
In httpd.conf:
PerlModule ModPerl::Registry
Alias /perl /usr/local/apache2/perl-bin/
<Location /perl>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order allow,deny
allow from all
</Location>
I have /use/local/apache2/perl-bin/ as so:
drwxrwxr-x 2 apachebi molbiol 4096 Nov 20 14:08 perl-bin
Apachebi and molbiol being the user and group that httpd is running as.
I have /usr/local/apache2/perl-bin/rock.pl as so:
-rwxrwxr-x 1 apachebi molbiol 84 Nov 20 14:02 rock.pl
When I go to http://localhost/perl/rock.pl, Internet Explorer asks me if
I want to download or open the file.
Help?
Thanks
Mick
The information contained in this message may be confidential or legally
privileged and is intended solely for the addressee. If you have
received this message in error please delete it & notify the originator
immediately.
Unauthorised use, disclosure, copying or alteration of this message is
forbidden & may be unlawful.
The contents of this e-mail are the views of the sender and do not
necessarily represent the views of the Institute.
This email and associated attachments has been checked locally for
viruses but we can accept no responsibility once it has left our
systems.
Communications on Institute computers are monitored to secure the
effective operation of the systems and for other lawful purposes.
Re: Apache offers to download the perl script rather than execute it!
Posted by "Roberto C. Sánchez" <ro...@connexer.com>.
On Tue, Nov 20, 2007 at 02:22:32PM -0000, michael watson (IAH-C) wrote:
>
> When I go to http://localhost/perl/rock.pl, Internet Explorer asks me if
> I want to download or open the file.
>
> Help?
>
Umm, what do the error and access logs say?
Regards,
-Roberto
P.S. Any chance you can get rid of this nonsense from your messages?
>
> The information contained in this message may be confidential or legally
> privileged and is intended solely for the addressee. If you have
> received this message in error please delete it & notify the originator
> immediately.
> Unauthorised use, disclosure, copying or alteration of this message is
> forbidden & may be unlawful.
> The contents of this e-mail are the views of the sender and do not
> necessarily represent the views of the Institute.
> This email and associated attachments has been checked locally for
> viruses but we can accept no responsibility once it has left our
> systems.
> Communications on Institute computers are monitored to secure the
> effective operation of the systems and for other lawful purposes.
--
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com
Re: Apache offers to download the perl script rather than execute it!
Posted by Jonathan Vanasco <jv...@2xlp.com>.
What does it download?
> print "Content-type: text/plain\n\n";
> print "Mod Perl 2 Rocks\n";
or
Mod Perl 2 Rocks
?
RE: Apache offers to download the perl script rather than execute it!
Posted by "michael watson (IAH-C)" <mi...@bbsrc.ac.uk>.
Hi
Test.pl works fine:
print "Content-type: text/html\n\n";
print "Perl works\n";
Rock.pl it tries to download:
print "Content-type: text/plain\n\n";
print "Mod Perl 2 Rocks\n";
Both have same permissions:
-rwxrwxr-x 1 apachebi molbiol 65 Nov 20 14:47 rock.pl
-rwxrwxr-x 1 apachebi molbiol 59 Nov 20 14:47 test.pl
So I can't send text/plain using mod_perl? That doesn't sound right....
Mick
-----Original Message-----
From: Tobias Regneri [mailto:tobias.regneri@gmail.com]
Sent: 20 November 2007 14:37
To: michael watson (IAH-C)
Cc: modperl@perl.apache.org
Subject: Re: Apache offers to download the perl script rather than
execute it!
Hi,
> SetHandler perl-script
I think it's only a missing file type
SetHandler perl-script .pl
Hth,
Tobias
Re: Apache offers to download the perl script rather than execute it!
Posted by "Roberto C. Sánchez" <ro...@connexer.com>.
On Tue, Nov 20, 2007 at 03:36:55PM +0100, Tobias Regneri wrote:
> Hi,
>
> > SetHandler perl-script
>
> I think it's only a missing file type
>
> SetHandler perl-script .pl
>
Actually, since he specified it inside of a Location block, it will
apply the handler to everything in that location. The extension is only
necessary if you want it to apply to only items with that extension.
Regards,
-Roberto
--
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com
Re: Apache offers to download the perl script rather than execute
it!
Posted by Tobias Regneri <to...@gmail.com>.
Hi,
> SetHandler perl-script
I think it's only a missing file type
SetHandler perl-script .pl
Hth,
Tobias