Re: Simple perl question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



modperl doesn't need to have perl installed because it has it
embedded. Have you tried to put your script into your /perl directory
and run it using Apache::Registry? But most probably it'll have
problems anyway because it'll require perl libraries: CGI, strict,
etc... unless it's a really generic script.

On 1/11/07, Israel Brewster <israel@xxxxxxxxxxxxxxxxxx> wrote:
On Jan 11, 2007, at 6:22 AM, Serge Dubrouski wrote:

> DO NOT REMOVE that #!/usr/bin/perl line. Without it OS tries to run it
> as a binary (ELF or whatever is appropriate for your systen ) file and
> of course fails.

But with it, it can not find /usr/bin/perl (thanks to the chroot),
and, of course, fails :-p bit of a catch 22-can't run with it, can't
run without it. So after reading the various responses, as well as
some additional web searching, I have gone ahead and copied /usr/bin/
perl to /var/www/usr/bin/perl so the script can see/access /usr/bin/
perl, even when chrooted. This, at least, gets rid of the cant find
file/directory and invalid exec format errors. I'm still getting a
"premature end of script headers" error when I try to run it though
Apache, however. Running the test script as "chroot /var/www/ /cgi-
bin/test.cgi" gives an "Abort trap" error. Running it normally (not
chrooted) works. Obviously I do not have a proper install of perl in
my chroot. Sigh. I'll keep trying. Thanks for the responses!

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service INC.
5245 Airport Industrial Rd
Fairbanks, AK 99709
-----------------------------------------------

>
> On 1/10/07, Israel Brewster <israel@xxxxxxxxxxxxxxxxxx> wrote:
>> yeah, perl is not available at all from within the Apache chroot
>> jail, unless I am missing something. Making the change to the
>> LoadModule line you suggested allowed the various perl directives in
>> the config file to load without complaint. Attempting to execute the
>> script, however, results in a [error] (8)Exec format error: exec of /
>> cgi-bin/perl/routers2.cgi failed This error is the same if I try with
>> either a .cgi extension on the file or a .pl extension
>> -----------------------------------------------
>> Israel Brewster
>> Computer Support Technician
>> Frontier Flying Service INC.
>> 5245 Airport Industrial Rd
>> Fairbanks, AK 99709
>> -----------------------------------------------
>>
>>
>> On Jan 10, 2007, at 4:31 PM, Serge Dubrouski wrote:
>>
>> > So you don't have perl available at all? Then you definetely need
>> > mod_perl. Have you tried to change your LoadModule line for
>> mod_perl
>> > like I suggested erlier?
>> >
>> > On 1/10/07, Israel Brewster <israel@xxxxxxxxxxxxxxxxxx> wrote:
>> >> But with it I get a "file not found" error since it can't access /
>> >> usr/
>> >> bin/perl from within the chroot (/var/www). If that line can't be
>> >> removed, then apparently I can't run perl scripts under Apache
>> with
>> >> Apache chrooted, even with mod_perl running properly-is that
>> correct?
>> >> or do I just need to change that line to something else? On the
>> >> brighter side, changing the LoadModule line as suggested did allow
>> >> the config directives to load properly. Didn't help get the
>> script to
>> >> run though.
>> >> -----------------------------------------------
>> >> Israel Brewster
>> >> Computer Support Technician
>> >> Frontier Flying Service INC.
>> >> 5245 Airport Industrial Rd
>> >> Fairbanks, AK 99709
>> >> -----------------------------------------------
>> >>
>> >>
>> >> On Jan 10, 2007, at 2:35 PM, Serge Dubrouski wrote:
>> >>
>> >> > Do not remove  #!/usr/bin/perl line! Without it OS doesn't know
>> >> how to
>> >> > run that file.
>> >> >
>> >> > On 1/10/07, Israel Brewster <israel@xxxxxxxxxxxxxxxxxx> wrote:
>> >> >> I installed mod_perl from the package that was distributed with
>> >> >> OpenBSD 4.0. The install didn't give any errors, so I have to
>> >> assume
>> >> >> it installed properly. As far as I can tell, it didn't make any
>> >> >> configuration changes. Just placing the script in my CGI
>> directory
>> >> >> (and removing the #!/usr/bin/perl line) gives "[error] (8)Exec
>> >> format
>> >> >> error: exec of /cgi-bin/perl/routers2.pl failed".
>> >> >> -----------------------------------------------
>> >> >> Israel Brewster
>> >> >> Computer Support Technician
>> >> >> Frontier Flying Service INC.
>> >> >> 5245 Airport Industrial Rd
>> >> >> Fairbanks, AK 99709
>> >> >> -----------------------------------------------
>> >> >>
>> >> >>
>> >> >> On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote:
>> >> >>
>> >> >> > For this configuration you need to have mod_perl installed on
>> >> your
>> >> >> > server. Why don't you simply put your script into your cgi-
>> bin
>> >> >> > directory?
>> >> >> >
>> >> >> > On 1/10/07, Israel Brewster <israel@xxxxxxxxxxxxxxxxxx>
>> wrote:
>> >> >> >> I don't know if what I am trying to do here is even possible
>> >> >> (sane?)
>> >> >> >> but I thought I'd ask. I am running Apache 1.3.29 on an
>> OpenBSD
>> >> >> 4.0
>> >> >> >> system, with Apache chrooted to /var/www. I have a perl
>> >> script CGI
>> >> >> >> (it has the .cgi extention, not .pl, but is actually a perl
>> >> >> script)
>> >> >> >> that I need to run. Currently, the script is written to run
>> >> >> using the
>> >> >> >> system perl interpreter, with the first line of the script
>> >> >> being #!/
>> >> >> >> usr/bin/perl This obviously doesn't work, since when it
>> runs as
>> >> >> a CGI
>> >> >> >> it is chrooted to /var/www, and can not see /usr/bin. Now I
>> >> would
>> >> >> >> think that Apache should be able to run this script using
>> >> the perl
>> >> >> >> module, which I have installed, but I can't seem to get
>> it to
>> >> >> work.
>> >> >> >> Could someone point me to something that tells me how to
>> >> properly
>> >> >> >> enable/run perl scripts in Apache? I looked at mod_perl
>> >> >> website, but
>> >> >> >> all it says is to add a code block like the following:
>> >> >> >>
>> >> >> >> Alias /perl/ /home/httpd/perl/
>> >> >> >>    PerlModule Apache::Registry
>> >> >> >>    <Location /perl>
>> >> >> >>      SetHandler perl-script
>> >> >> >>      PerlHandler Apache::Registry
>> >> >> >>      Options ExecCGI
>> >> >> >>      allow from all
>> >> >> >>      PerlSendHeader On
>> >> >> >>    </Location>
>> >> >> >>
>> >> >> >> which just gives me an 'Invalid command 'PerlModule' This
>> would
>> >> >> imply
>> >> >> >> to me that mod_perl isn't being loaded, in spite of being
>> >> >> installed,
>> >> >> >> but that leaves me needing to know how to load the perl
>> module.
>> >> >> >> Adding a line like LoadModule mod_perl /usr/local/lib/
>> >> mod_perl.so
>> >> >> >> (which is the correct path to the mod_perl.so file) just
>> gives
>> >> >> me a
>> >> >> >> "Can't locate API module structure `mod_perl' in file /usr/
>> >> >> local/lib/
>> >> >> >> mod_perl.so: Unable to resolve symbol" What am I missing
>> >> here? How
>> >> >> >> can I get Apache to run perl scripts? Thanks for any
>> assistance
>> >> >> that
>> >> >> >> can be provided
>> >> >> >>
>> >> >> >>
>> >> >> >> -----------------------------------------------
>> >> >> >> Israel Brewster
>> >> >> >> Computer Support Technician
>> >> >> >> Frontier Flying Service INC.
>> >> >> >> 5245 Airport Industrial Rd
>> >> >> >> Fairbanks, AK 99709
>> >> >> >> -----------------------------------------------
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> >> The official User-To-User support forum of the Apache HTTP
>> >> Server
>> >> >> >> Project.
>> >> >> >> See <URL:http://httpd.apache.org/userslist.html> for more
>> info.
>> >> >> >> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> >> >> >>    "   from the digest: users-digest-
>> >> unsubscribe@xxxxxxxxxxxxxxxx
>> >> >> >> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> > The official User-To-User support forum of the Apache HTTP
>> >> Server
>> >> >> > Project.
>> >> >> > See <URL:http://httpd.apache.org/userslist.html> for more
>> info.
>> >> >> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> >> >> >   "   from the digest: users-digest-
>> unsubscribe@xxxxxxxxxxxxxxxx
>> >> >> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>> >> >>
>> >> >>
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> The official User-To-User support forum of the Apache HTTP
>> Server
>> >> >> Project.
>> >> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> >> >> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> >> >>    "   from the digest: users-digest-
>> unsubscribe@xxxxxxxxxxxxxxxx
>> >> >> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> ---------------------------------------------------------------------
>> >> > The official User-To-User support forum of the Apache HTTP
>> Server
>> >> > Project.
>> >> > See <URL:http://httpd.apache.org/userslist.html> for more info.
>> >> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> >> >   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>> >> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>> >>
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> The official User-To-User support forum of the Apache HTTP Server
>> >> Project.
>> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> >> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> >>   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>> >> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>> >>
>> >>
>> >
>> >
>> ---------------------------------------------------------------------
>> > The official User-To-User support forum of the Apache HTTP Server
>> > Project.
>> > See <URL:http://httpd.apache.org/userslist.html> for more info.
>> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> >   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>>    "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux