Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use apache and perl???

Status
Not open for further replies.

maryam421

MIS
Apr 5, 2004
102
0
0
US
Hi,
I am trying to configure apache with perl. I have installed the perl and mod_perl successfully. But don't know how to configure httpd.config file. I did put an entry for mod_perl in httpd.config file.
I am using apache 2 with windows 2000. Also apcache does show the perl version when I start it. Please help
Thanks
 
Modperl can be configured in many ways, there is no single way to do it.

Are you trying to use it as a CGI accelerator? Are you installed things like HTML::Mason on top of it or are you writing direct access location handlers?

For CGI its pretty easy, just do this :

Code:
  PerlModule Apache::Registry
  <FilesMatch *.cgi>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options ExecCGI
    allow from all
    ##PerlSendHeader On
  </FilesMatch >

That will enable any file ending in .cgi to be executed natively under modperl for a huge speed boost.

Much much more info at:


What are your goals with modperl?

Oh, I also recommend putting a reverse proxy in front of the modperl server if you are going to do any sort of public traffic, serving images and other static content out of modperl will eat your system alive..
 
I will be using the cgi as well. Well most of the time the perl will be embeded in html.If you click on the following url you will the code only:


I will try to do the changes that you mentioned. I am not very sure about reverse proxy. Can please tell me what that means?
I am very new to perl.
Thanks for all your help.
 
THe link you gave me is a cgi, just change the filesmatch directive to match .pl instead of .cgi and modperl will accelerate it.

Also, you'll have to uncomment the PerlSendHeaders line to work with your hello.pl, your not sending headers.

I recommend you read the guide before you go any farther. Modperl is a fabulous tool but it can also be a weapon that you can hurt yourself with if you don't have a firm grasp on what its doing.

Things like reverse proxy etc are covered in the guide.
 
If I want run both cgi and perl, do I need two entries or can use one entry for both.
Thanks for your help.
 
I am getting syntax error if put the FilesMatch entry. Following is the error
</FilesMatch> directive missing closing '>'

Please help!!
 
I fixed that now I am getting the following error in error logfile

[Wed Apr 16 18:58:03 2003] [error] Can't load Perl module Apache::Registry for server WORKGROUP:80, exiting...
 
Thanks for your reply. I was able to fix that error too. But now apache is not serving the page. I used ppm and put an entry in httpd.config.
If you try to click the following url you will get page not found erro:

Do I need any make file? I can run the script locally using perl hello.pl command.
Do I need to set any enviornment variables? I can get to perl executeable form any directory.
Please help. Your advice would greatly be appreciated.
Thanks
 
>>>>Do I need any make file?
the answer is NO , Once you installed an active perl , you can install all the module using ppm
unless your behind a firewall then for windows its nmake command

>>Do I need to set any enviornment variables?
the answer is NO , when you install Activeperl the setup auto configures the environmental variables

>>I can get to perl executeable form any directory.
yes you can run a perl program from any director as long as u have perl in ur environmen variables no problem

-------------------------------------------------------------hope this helps
let us know if u need to know more
happy coding
ronan

 
Thanks for your reply. How do you know if active perl is installed or not? I know perl is installed. What is the difference between active perl and perl?
Thanks
 
>>>>>How do you know if active perl is installed or not?
Well u can simply check it out by clicking the start button -> program files -> you have active perl there listed in programs

>>>>>What is the difference between active perl and perl?
well active perl is for Windows environment
 
Type
perl -v
at the command line, and that will tell you what version of perl your system's path leads to.

--jim
 
Now I am getting the following error:

[Fri Apr 18 08:39:08 2003] [error] failed to resolve handler `ModPerl::Registery'
[Fri Apr 18 08:39:08 2003] [error] [client 65.87.179.39] Can't locate ModPerl/Registery.pm in @INC (@INC contains: /home/httpd/perl C:/Perl/site/lib/Apache2 C:/Perl/lib C:/Perl/site/lib . C:/Program Files/Apache Group/Apache2/ C:/Program Files/Apache Group/Apache2/lib/perl) at (eval 4) line 3.

Please help!!
 
what have you configured your Apache with ModPerl or with ActivePerl ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top