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

Apache para ejecutar .cgi .pl con el /cgi-bin en el home del usuario



Hola a todos

Estoy configurando ...

Debian woody 3.0r1 con ..
apache 1.3.26 , apache-perl 1.3.26-1-1.26, libhtml-embperl-perl 1.3.3-2

Tengo definido un VirtualHost para el dominio bodegonweb.com.ar con
DocumentRoot /home/bodegonweb/public_html

Si tomo el Script de ejemplo que figura en http://perl.apache.org escrito en
mod_perl funciona perfectamente
http://200.68.76.51/~bodegonweb/cgi-bin/hello.cgi

Pero con culaquier otro Script el Apache
http://200.68.76.51/~bodegonweb/cgi-bin/hello.pl    o bien
http://200.68.76.51/~bodegonweb/cgi-bin/test-cgi
me da los siguientes errores ....

Error.log
[error ] Premature end of script headers: /home/bodegonweb/cgi-bin/hello.pl
[error ] File does not exist: /var/www/default.ida

Suexec.log
[2003-07-01 09:35:00]: info: (target/actual) uid: (bodegonweb/bodegonweb)
gid: (bodegonweb/bodegonweb) cmd: hello.pl
[2003-07-01 09:35:00]: error: command not in docroot
(/home/bodegonweb/cgi-bin/hello.pl)

Por lo que entiendo seria un problema de permisos para el www-data cuyos
permisos por defecto estan definidos para la estructura /usr/lib/cgi-bin que
utiliza el Alias /cgi-bin ..

Pero lo que mas me desorienta es que al ejecutar el script en mod_per si
bien funciona registra en suexec.log
Suexec.log
[2003-07-01 09:35:00]: info: (target/actual) uid: (bodegonweb/bodegonweb)
gid: (bodegonweb/bodegonweb) cmd: hello.cgi
[2003-07-01 09:35:00]: error: command not in docroot
(/home/bodegonweb/cgi-bin/hello.cgi)

Estuve leyendo de la web de Apache http://httpd.apache.org/docs/suexec.html
este tema pero no se como implementarlo

Si alguno lo ha implemetado agradeceria ver como tiene configurado el
httpd.conf

Desde ya gracias de antemano ...
Saludos
Nestor Mazza
asd-vtas@movi.com.ar

Este es el detalle de mi /etc/apache/httpd.conf , detallo solo unas lineas a
modo de mostrar lo que tengo configurado

LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
LoadModule perl_module /usr/lib/apache/1.3/mod_perl.so

User www-data
Group www-data

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
#
# "/usr/lib/cgi-bin" could be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory /usr/lib/cgi-bin/>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>


################################### Aqui agregue la directiva
ScriptAliasMatch ########################
# Directiva ScriptAliasMatch
# sacada de http://www.apache.org
# para ejecutar cgi desde el home del usuario
#
# /home/public_html para el sitio web
# http://server.ip.address/~user/
#
# /home/cgi-bin para los cgi
# http://server.ip.address/~user/cgi-bin/hello.cgi


ScriptAliasMatch ^/~([^/]*)/cgi-bin/(.*) /home/$1/cgi-bin/$2
<Directory /home/*/public_html/cgi-bin>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

############################################################################
#####################

# To use CGI scripts:
#
AddHandler cgi-script .cgi .sh .pl

#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml




# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
    Alias /perl/ /var/www/perl/
    <Location /perl>
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options +ExecCGI
    </Location>
</IfModule>

################################################
# Ejemplo de Hello.cgi escrito en mod_perl
################################################

<Files hello.cgi>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
</Files>

################################################

#
# Dominio bodegonweb.com.ar
#
<VirtualHost 200.68.76.51>
    ServerAdmin webmaster@asdgroup.com.ar
    ServerName www.bodegonweb.com.ar
    DocumentRoot /home/bodegonweb/public_html
</VirtualHost>



Reply to: