Apache y perl
Santiago Gallegos
xochical@data.net.mx
Mon, 23 Feb 1998 00:27:51 +0000
Lista:
!Estoy pariendo chayotes! con la instalacion del mod_perl con apache,
les cuento lo que hice, espero me ayuden.
1. Baje los fuentes de apache 1.2.5 y del mod_perl 5.X, los fuentes que
requeria el mod_perl: MD5, MIME64, libnet, instale estos tres sin
problemas.
2. al compilar mod_perl le puse la primera vez que no cargara los
modulos (default) luego los active al compilar con
perl Makefile.PL EVERYTHING=1
make
make test
make install
todo corrio bien, sin ningun warning ni error
3. Genera el HHTPD, le puse en el archivo httpd.conf las sig. lineas:
ServerType standalone
Port 80
HostnameLookups off
User nobody
Group nobody
BrowserMatch Mozilla/2 nokeepalive
BrowserMatch Java1.0 force-response-1.0
BrowserMatch JDK/1.0 force-response-1.0
ServerRoot /etc/httpd
Timeout 300
#mod_perl stuff
#-Tw
#PerlTaintCheck On
PerlWarn On
PerlPassEnv TERM EDITOR NOCHANCE
PerlSetEnv KeyForPerlSetEnv OK
PerlSetVar KeyForPerlSetVar OK
PerlScript conf/startup.pl
#PerlHandler Apache::Registry
Alias /perl/ /home/httpd/cgi-bin/
Alias /cgi-bin/ /home/httpd/cgi-bin/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
<Location /cgi-bin>
SetHandler cgi-script
Options +ExecCGI
</Location>
#end mod_perl stuff
4. los directorios estan bien, el archivo startup.pl existe y si lo lee,
es el que viene de ejemplo, lo anexo:
#use lib qw(/foo/perl/lib);
#load perl modules of your choice here
#this code is interpreted *once* when the server starts
#use CGI::Switch ();
#use LWP::UserAgent ();
#use DBI ();
#you may define Perl*Handler subroutines here too
use Apache::Registry ();
1; #return true value
5. Copie' algunos ejemplos de scrips en el directorio
/home/httpd/cgi-bin, los ejecuto desde la linea de comandos y si
funcionan ($perl printenv) y luego los ejecuto desde el lynx y me indica
que hay un server error 500, que algo esta desconfigurado, ejecuto otro
script (registry.pl) y manda el mismo error, entonces reviso el archivo
log que anexo:
[Sun Feb 22 03:41:08 1998] created shared memory segment #768
[Sun Feb 22 03:41:08 1998] Server configured -- resuming normal
operations
exec of /home/httpd/cgi-bin/printenv failed, reason: No such file or
directory (errno = 2)
[Sun Feb 22 03:41:12 1998] access to /home/httpd/cgi-bin/printenv failed
for 192.168.0.2, reason: Premature end of script headers
exec of /home/httpd/cgi-bin/printenv failed, reason: No such file or
directory (errno = 2)
[Sun Feb 22 03:42:42 1998] access to /home/httpd/cgi-bin/printenv failed
for 192.168.0.2, reason: Premature end of script headers
exec of /home/httpd/cgi-bin/registry.pl failed, reason: Exec format
error (errno = 8)
[Sun Feb 22 03:46:42 1998] access to /home/httpd/cgi-bin/registry.pl
failed for 192.168.0.2, reason: Premature end of script headers
en el primero (printenv) me indica que falta algo, lo extraño es que si
corre en perl, el segundo marca error de formato de ejecución, !pero son
los ejemplos que vienen con el mod_perl!
Los scripts de access.conf y srm.conf no los modifique.
Espero que me indiquen donde esta la falla, ya lei el perldoc mod_perl,
si me indican que debo leer o que script debo modificar, algun norte
sera bienvenido.
Saludos
Santiago