You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "@lbutlr" <kr...@kreme.com> on 2019/06/19 04:03:20 UTC

[users@httpd] Adding perl-cgi in apache 2.4

I need to enable perl-cgi for a specific directory local to a single site. 

I uncommented cgi in http.conf

LoadModule cgid_module libexec/apache24/mod_cgid.so

In the conf for the site in question I have the following:

   <directory "/usr/local/www/bi">
     AllowOverride All
     Require all granted
   </Directory>
   <Directory "/usr/local/www/bi/cgi-local">
      AllowOverride None
      Options +ExecCGI 
      AddHandler cgi-script .pl .cgi
      Order allow,deny
      allow from all
   </Directory>

When I try to go to the file at /usr/local/www/bi/cgi-local/b4.pl I get 

> Internal Server Error
> 
> The server encountered an internal error or misconfiguration and was unable to complete your request.
> 
> Please contact the server administrator at admin@covisp.net to inform them of the time this error occurred, and the actions you performed just before this error.
> 
> More information about this error may be available in the server error log.

in the http-error.log there is only:

[cgid:error] [pid 25120] (2)No such file or directory: AH01241: exec of '/usr/local/www/bi/cgi-local/b4.pl' failed
[Tue Jun 18 21:54:59.858842 2019] [cgid:error] [pid 24551] [client x.x.x.x:58890] End of script output before headers: b4.pl, referer: <the site>

However, the script itself hasn’t been modified in 15 years, so I don’t think the script itself is the problem and if I run it from the command line it outputs a regular html file (without the content since the flags that are normally passed on the URL are not present.

# perl cgi-local/b4.pl                                                                                                                                                          Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<!-- no Filename Set --><!-- no Title Set --><!-- no Column Set -->

…

</html>


-- 
Lead me not into temptation, I can find the way.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding perl-cgi in apache 2.4

Posted by Bret Stern <br...@machinemanagement.com>.
My last comment. Maybe the perl interpreter wasn't in the same place
defined in the perl script header.

Oh Well. Nothing ventured. Nothing gained.




On Thu, 2019-06-20 at 18:53 -0600, @lbutlr wrote:
> On 18 Jun 2019, at 22:03, @lbutlr <kr...@kreme.com> wrote:
> > I need to enable perl-cgi for a specific directory local to a
> > single site. 
> 
> I just punted and rewrote the the script in php.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding perl-cgi in apache 2.4

Posted by "@lbutlr" <kr...@kreme.com>.
On 18 Jun 2019, at 22:03, @lbutlr <kr...@kreme.com> wrote:
> I need to enable perl-cgi for a specific directory local to a single site. 

I just punted and rewrote the the script in php.

-- 
You only had to look into Teatime's mismatched eyes to know one thing,
which was this: if Teatime wanted to find you he would not look
everywhere. He'd look in only one place, which would be the place where
you were hiding. --Hogfather



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding perl-cgi in apache 2.4

Posted by Eric Covener <co...@gmail.com>.
>
> # perl cgi-local/b4.pl

bad shebang in the file itself?  Suspicious that you added "perl" in
front explicitly.

If you don't want to run it via its defined interpreter, which is what
mod_cgi does, you'd need something like Action to pass it as an
argument to some wrapper.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding perl-cgi in apache 2.4

Posted by "@lbutlr" <kr...@kreme.com>.
On 19 Jun 2019, at 09:00, Bret Stern <br...@machinemanagement.com> wrote:
> Your original post log error indicated:
> 
> No such file or directory: AH01241: exec of '/usr/local/www/bi/cgi-
> local/b4.pl' failed
> 
> Perhaps the path for cgi scripts has been changed/redifined from the
> default in the apache config file

 # ls -ls /usr/local/www/bi/cgi-local/b4.pl                                                                                                                        16 -rwxrwxrwx  1 www  wheel  4852 Jun 18  2004 /usr/local/www/bi/cgi-local/b4.pl

And I have that same path set in the <Directory> in the site’s conf file

  <Directory "/usr/local/www/bi/cgi-local”>

I mean, I don’t think there’s a tyop there, but I’ve been known to miss them.

-- 
Lead me not into temptation, I can find the way.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding perl-cgi in apache 2.4

Posted by Bret Stern <br...@machinemanagement.com>.
Your original post log error indicated:

 No such file or directory: AH01241: exec of '/usr/local/www/bi/cgi-
local/b4.pl' failed


Perhaps the path for cgi scripts has been changed/redifined from the
default in the apache config file




On Wed, 2019-06-19 at 08:11 -0600, @lbutlr wrote:
> On 19 Jun 2019, at 00:25, bret_stern@machinemanagement.com wrote:
> > Permissions on the executable/.pl
> > script correct to run when called?
> 
> Permissions are the same they’ve been since 2004, 777.
> 
> 
> On 19 Jun 2019, at 05:07, Eric Covener <co...@gmail.com> wrote:
> > bad shebang in the file itself?  Suspicious that you added "perl"
> > in
> > front explicitly.
> 
> It is a perl cgi, there is no shebang at all.
> 
> > If you don't want to run it via its defined interpreter, which is
> > what
> > mod_cgi does
> 
> No, I very much do want to run it just as it has been run in the
> past.
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding perl-cgi in apache 2.4

Posted by "@lbutlr" <kr...@kreme.com>.
On 19 Jun 2019, at 00:25, bret_stern@machinemanagement.com wrote:
> Permissions on the executable/.pl
> script correct to run when called?

Permissions are the same they’ve been since 2004, 777.


On 19 Jun 2019, at 05:07, Eric Covener <co...@gmail.com> wrote:
> bad shebang in the file itself?  Suspicious that you added "perl" in
> front explicitly.

It is a perl cgi, there is no shebang at all.

> If you don't want to run it via its defined interpreter, which is what
> mod_cgi does

No, I very much do want to run it just as it has been run in the past.



-- 
You and me Sunday driving Not arriving



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding perl-cgi in apache 2.4

Posted by "bret_stern@machinemanagement.com" <br...@machinemanagement.com>.
Permissions on the executable/.plscript correct to run when called?
-------- Original message --------From: "@lbutlr" <kr...@kreme.com> Date: 6/18/19  9:03 PM  (GMT-08:00) To: users@httpd.apache.org Subject: [users@httpd] Adding perl-cgi in apache 2.4 I need to enable perl-cgi for a specific directory local to a single site. I uncommented cgi in http.confLoadModule cgid_module libexec/apache24/mod_cgid.soIn the conf for the site in question I have the following:   <directory "/usr/local/www/bi">     AllowOverride All     Require all granted   </Directory>   <Directory "/usr/local/www/bi/cgi-local">      AllowOverride None      Options +ExecCGI       AddHandler cgi-script .pl .cgi      Order allow,deny      allow from all   </Directory>When I try to go to the file at /usr/local/www/bi/cgi-local/b4.pl I get > Internal Server Error> > The server encountered an internal error or misconfiguration and was unable to complete your request.> > Please contact the server administrator at admin@covisp.net to inform them of the time this error occurred, and the actions you performed just before this error.> > More information about this error may be available in the server error log.in the http-error.log there is only:[cgid:error] [pid 25120] (2)No such file or directory: AH01241: exec of '/usr/local/www/bi/cgi-local/b4.pl' failed[Tue Jun 18 21:54:59.858842 2019] [cgid:error] [pid 24551] [client x.x.x.x:58890] End of script output before headers: b4.pl, referer: <the site>However, the script itself hasn’t been modified in 15 years, so I don’t think the script itself is the problem and if I run it from the command line it outputs a regular html file (without the content since the flags that are normally passed on the URL are not present.# perl cgi-local/b4.pl                                                                                                                                                          Content-type: text/html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"><html><head><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><!-- no Filename Set --><!-- no Title Set --><!-- no Column Set -->…</html>-- Lead me not into temptation, I can find the way.---------------------------------------------------------------------To unsubscribe, e-mail: users-unsubscribe@httpd.apache.orgFor additional commands, e-mail: users-help@httpd.apache.org