mod_perl 2 Setup ?

B

Bob Welton

I am running Red Hat 9 that has Apache 2 installed with the build. I have
been trying to set up mod_perl 2 but have had lots of problems and don't
think its working. How can I check if its installed ?

I have tried # httpd -l and get:
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c

Should mod_perl appear here in version 2 ?

I'm pretty new to Linux, so take it easy on me.

Many thanks

Bob
 
B

Bob Welton

Thanks Sam,

conf.d was All OK but still the site is very slow.

Should # httpd -l list ' mod_perl.c' as a compiled module with
mod_perl 2 ?

Any other suggestions as what may be wrong ?
 
B

Bob Welton

mmm can I clarify: Where should the 'Alias' and '<Directory' point to ?

If I point them to my index.pl I get a server error 500
If I point them to the directories where my application is loaded i.e where
the '####.pm' exist it loads pages, but is not too quick.

Many thanks
 
S

sam

mmm can I clarify: Where should the 'Alias' and '<Directory' point to ?

It shoud point to the location where your scripts are.
Your index.pl must be in this directory.
Set the permission of this directory to 0777.
chmod 0777 /var/www/perl

This is very very insecure and you should not follow this approach on the
production machine. This is good enough when you just want to try things out
and want to have as few obstacles as possible.

Try first with and index.pl that contains this:

#!/usr/bin/perl
print "Content-type: text/plain\r\n\r\n";
print "mod_perl rules!\n";

chmod 0755 /var/www/perl/index.pl

and point your browser to : http://your_server/perl/index.pl

Hope this helps.
 
P

pkent

Bob Welton said:
I am running Red Hat 9 that has Apache 2 installed with the build. I have
been trying to set up mod_perl 2 but have had lots of problems and don't
think its working. How can I check if its installed ?

I have tried # httpd -l and get:
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c

Should mod_perl appear here in version 2 ?

On my SuSE Linux system mod_perl was a separate package (i.e. an RPM)
which I had to install separately from the mail apache install. Have a
look in your system configuration tool (it's called YAST in SuSE linux,
for example) and see if you can add a mod_perl package. I reckon that's
the easiest thing to start with.

Also you can try using the locate program and look for mod_perl.so -
this is what I get on my machine:

$ locate mod_perl.so
/usr/local/apache2/modules/mod_perl.so

That will at least tell you if the module is on the disk somewhere.
Similarly try to 'locate Apache2/ModPerl'

P
 
B

Bob Welton

Thanks Sam,

I have the following structure:

/mysite.com/cgi-bin/index.pl + a few other .pl's
/mysite.com/perl/directories/###.pm + all my .pm's for the application

Currently I have the Directory and Alias pointing to /mysite.com/perl path
If I point it to the higher directory /mysite.com or to
/mysite.com/cgi-bin I get a Server Error 500 when trying to browse the web
site.

I have setup the test index.pl, set the chmod permissions and pointed to it
in the Alias and Directory settings of perl.conf. However when browsing it
I get the Server error ! Error 500 page returned.

Reverting it index.pl to my site version, however works ok.... but slow

Any other suggestions ?
 
B

Bob Welton

Thanks Sam, I've sent you the httpd.conf etc

sam said:
I can't see the problem with the infos you give.
I have the same configuration as you: redhat, apache2,...
and all is fine.

Try with adding "Allow from all" to the directory list of directives:
<directory /var/www/perl>
....
....
....
Allow from all
</directory>

Please send your httpd.conf file to help?
Hide all the private infos (IPs and domain names)
from your httpd.conf file before you send it :)





to
 
B

Bob Welton

Yep have confirmed that both Perl and mod_perl are installed, its more a
matter of configuration I think.

My site is running the perl ok, just a bit slow.
When I browse the site, there is a 2.1 second delay following the SYN of the
initial connection to the point that the 1st byte of resultant HTML is
returned. This test takes out effect of connection speed etc and should
indicate the time to translate the perl code to HTML.

Many thanks

Bob
 
S

sam

Thanks Sam, I've sent you the httpd.conf etc

Where ?

The email address I use in the news group is fa....

Please send to the news group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,129
Messages
2,570,770
Members
47,329
Latest member
FidelRauch

Latest Threads

Top