Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Trying mod_perl for the first time - how to enable it?

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


ewijaya at singnet

Jan 26, 2005, 5:47 AM

Post #1 of 5 (477 views)
Permalink
Trying mod_perl for the first time - how to enable it?

Dear all,

I am trying my mod_perl in my Apache webserver for the first time (under
Mdk-Linux).
I have created a simple "print hello world" script with the name 'hello.pl'
and I stored it under 'var/www/cgi-bin/' but whenever I try to open
the script with http://localhost/cgi-bin/hello.pl

It gives "Internal Server Error" like this: http://paste.phpfi.com/48050.

BTW my httpd.conf is like this: http://paste.phpfi.com/48067
and my httpd2.perl.conf is like this: http://paste.phpfi.com/48068

Can anybody suggest what's wrong with my approach?
Thanks a lot beforehand.

--
Edward WIJAYA
Singapore


ewijaya at singnet

Jan 26, 2005, 6:21 AM

Post #2 of 5 (420 views)
Permalink
Re: Trying mod_perl for the first time - how to enable it? [In reply to]

Thanks so much for the reply Sean,

On Wed, 26 Jan 2005 20:58:02 -0500, Sean Davis <sdavis2[at]mail.nih.gov>
wrote:

> Edward,
>
> Did you look at the server log?
Sean,here is my error server log:
http://pastebot.nd.edu/127?tx=on&submit=Format+it%21

> Also, is you hello.pl script written as a handler or straight cgi
> script?

I am not sure. How can I check that?
I just simply write a perl code like normal where you can execute
under command line like this: $ perl test.pl

with _"print 'hello\n";_ in it
And just the code under /var/www/cgi-bin


> You don't need modperl to run straight cgi scripts. Some other folks
> may notice problems with the config files....
Should I change
my httpd.conf here: http://paste.phpfi.com/48067

OR

my httpd2.perl.conf here: http://paste.phpfi.com/48068

Hope to hear from you again.


--
Edward WIJAYA
Singapore


randy at theoryx5

Jan 26, 2005, 8:46 PM

Post #3 of 5 (420 views)
Permalink
Re: Trying mod_perl for the first time - how to enable it? [In reply to]

On Wed, 26 Jan 2005, Edward Wijaya wrote:

> Dear all,
>
> I am trying my mod_perl in my Apache webserver for the first time (under
> Mdk-Linux).
> I have created a simple "print hello world" script with the name 'hello.pl'
> and I stored it under 'var/www/cgi-bin/' but whenever I try to open
> the script with http://localhost/cgi-bin/hello.pl
>
> It gives "Internal Server Error" like this: http://paste.phpfi.com/48050.
>
> BTW my httpd.conf is like this: http://paste.phpfi.com/48067
> and my httpd2.perl.conf is like this: http://paste.phpfi.com/48068
>
> Can anybody suggest what's wrong with my approach?
> Thanks a lot beforehand.

You should check out
http://perl.apache.org/docs/2.0/user/intro/start_fast.html
which gives you a quick guide to configuring and testing
mod_perl, both with a simple registry script and with a
simple response handler.

--
best regards,
randy kobes


jay at scherrer

Jan 26, 2005, 9:01 PM

Post #4 of 5 (430 views)
Permalink
Re: Trying mod_perl for the first time - how to enable it? [In reply to]

Looks like you didn't tell http.conf where your .pl scripts are.
My httpd.conf includes a :
##Mod_Perl stuff

Alias /perl/ /var/www/perl/
<Location /perl/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Location>
#####
Chapter 2: Practical mod_perl

Jay Scherrer


On Wednesday 26 January 2005 08:46 pm, Randy Kobes wrote:
> On Wed, 26 Jan 2005, Edward Wijaya wrote:
> > Dear all,
> >
> > I am trying my mod_perl in my Apache webserver for the first time
> > (under Mdk-Linux).
> > I have created a simple "print hello world" script with the name
> > 'hello.pl' and I stored it under 'var/www/cgi-bin/' but whenever
> > I try to open the script with http://localhost/cgi-bin/hello.pl
> >
> > It gives "Internal Server Error" like this:
> > http://paste.phpfi.com/48050.
> >
> > BTW my httpd.conf is like this:
> > http://paste.phpfi.com/48067 and my httpd2.perl.conf is
> > like this: http://paste.phpfi.com/48068
> >
> > Can anybody suggest what's wrong with my approach?
> > Thanks a lot beforehand.
>
> You should check out
> http://perl.apache.org/docs/2.0/user/intro/start_fast.html
> which gives you a quick guide to configuring and testing
> mod_perl, both with a simple registry script and with a
> simple response handler.


sdavis2 at mail

Jan 27, 2005, 3:15 AM

Post #5 of 5 (423 views)
Permalink
Re: Trying mod_perl for the first time - how to enable it? [In reply to]

On Jan 26, 2005, at 9:21 AM, Edward Wijaya wrote:

> Thanks so much for the reply Sean,
>
> On Wed, 26 Jan 2005 20:58:02 -0500, Sean Davis <sdavis2[at]mail.nih.gov>
> wrote:
>
>> Edward,
>>
>> Did you look at the server log?
> Sean,here is my error server log:
> http://pastebot.nd.edu/127?tx=on&submit=Format+it%21
>
>> Also, is you hello.pl script written as a handler or straight cgi
>> script?
>
> I am not sure. How can I check that?
> I just simply write a perl code like normal where you can execute
> under command line like this: $ perl test.pl
>
> with _"print 'hello\n";_ in it
> And just the code under /var/www/cgi-bin
>

Hopefully, you have had a chance to look at some of the documentation
that others have suggested. Also, CGI scripts have to have a special
output format. They need to include headers telling the server/browser
what to do with the output. Your best bet is to follow the
documentation step-by-step to make sure that the server is doing what
you think before writing your own scripts.

As for your error_log/config files, it appears that you do need to tell
your server where your cgi-bin is, as noted elsewhere. Also, you need
to change permissions and chmod on all your scripts so they can be run
by the server. Those "permission denied" errors often imply a script
that does not have correct access and execute privileges set.

Sean


>
>> You don't need modperl to run straight cgi scripts. Some other folks
>> may notice problems with the config files....
> Should I change
> my httpd.conf here: http://paste.phpfi.com/48067
>
> OR
>
> my httpd2.perl.conf here: http://paste.phpfi.com/48068
>
> Hope to hear from you again.
>
>
> --
> Edward WIJAYA
> Singapore

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.