# Apache + mod_perl =

## idtt2s

I tried the mod_perl guide on the Gentoo Wiki, to no benefit, since my script still turns up a "500 Internal Server Error".

The script is 

```

#!/usr/bin/perl -wT

 print "Content-type: text/html\n\n";

 print "Hello, world!\n";

```

Can someone guide me the through this because this is killing me!

----------

## magic919

What do your Apache logs say.  That's where I normally troubleshoot.

----------

## idtt2s

```

$MY_USER$@localhost ~/Desktop $ tail /var/log/apache2/error_log

[Sat Feb 04 12:40:44 2006] [notice] caught SIGTERM, shutting down

[Sat Feb 04 12:40:47 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)

[Sat Feb 04 12:40:47 2006] [warn] module perl_module is already loaded, skipping

[Sat Feb 04 12:40:48 2006] [notice] Digest: generating secret for digest authentication ...

[Sat Feb 04 12:40:48 2006] [notice] Digest: done

[Sat Feb 04 12:40:48 2006] [notice] Apache configured -- resuming normal operations

[Sat Feb 04 12:40:48 2006] [error] [client 127.0.0.1] failed to resolve handler `Apache::Registry': Can't locate Apache/Registry.pm in @INC (@INC contains: /home/httpd/perl /etc/perl /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.7/i686-linux-thread-multi /usr/lib/perl5/5.8.7 /usr/local/lib/site_perl . /usr/lib/apache2) at (eval 6) line 3.\n

[Sat Feb 04 12:40:48 2006] [error] [client 127.0.0.1] failed to resolve handler `Apache::Registry': Can't locate Apache/Registry.pm in @INC (@INC contains: /home/httpd/perl /etc/perl /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.7/i686-linux-thread-multi /usr/lib/perl5/5.8.7 /usr/local/lib/site_perl . /usr/lib/apache2) at (eval 6) line 3.\n

[Sat Feb 04 12:47:23 2006] [error] [client 127.0.0.1] failed to resolve handler `Apache::Registry': Can't locate Apache/Registry.pm in @INC (@INC contains: /home/httpd/perl /etc/perl /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.7/i686-linux-thread-multi /usr/lib/perl5/5.8.7 /usr/local/lib/site_perl . /usr/lib/apache2) at (eval 7) line 3.\n

[Sat Feb 04 12:57:13 2006] [error] [client 127.0.0.1] failed to resolve handler `Apache::Registry': Can't locate Apache/Registry.pm in @INC (@INC contains: /home/httpd/perl /etc/perl /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.7/i686-linux-thread-multi /usr/lib/perl5/5.8.7 /usr/local/lib/site_perl . /usr/lib/apache2) at (eval 6) line 3.\n

```

----------

## magic919

That Registry.pm is part of mod_perl as far as I can see.  It can't have installed correctly.

----------

## idtt2s

So can someone walk me through editing the configuration files?

----------

## magic919

This might be worth a look http://perl.apache.org/docs/2.0/user/intro/start_fast.html

----------

## jenshauser

 *magic919 wrote:*   

> This might be worth a look http://perl.apache.org/docs/2.0/user/intro/start_fast.html

 

yes - also have a look at my script in /etc/apache2/modules.d/99_otrs.conf

(important is the "#"-line and the one after)

Alias /otrs-web/ "/var/www/localhost/htdocs/otrs2/"

Alias /otrs2/ "/var/www/localhost/otrs-2.0.4/bin/cgi-bin/"

<Location /otrs2>

        SetHandler  perl-script

#       PerlHandler Apache::Registry

        PerlResponseHandler ModPerl::Registry

        Options ExecCGI

        PerlSendHeader On

        PerlSetupEnv On

</Location>

----------

