LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Installing mod_perl and FastCGI on Apache 1.3 (https://www.linuxquestions.org/questions/linux-server-73/installing-mod_perl-and-fastcgi-on-apache-1-3-a-481719/)

initself 09-08-2006 06:57 PM

Installing mod_perl and FastCGI on Apache 1.3
 
All the HOWTO files I found related to mod_perl and FastCGI approached their installations assuming you would use one or the other. But what if you wanted to use both? Here are installation steps to install both mod_perl and FastCGI on Apache.

Apache

Download and compile Apache 1.3 from source. Configure it with '--enable-shared=rewrite'. This will turn on Dynamic Shared Object (DSO) Support, enabling us to load mod_perl and FastCGI dynamically rather than compiling them directly into Apache. If you wish to use Embperl, add '--enable-shared=env'.

Code:

./configure --enable-shared=rewrite --enable-shared=env
make && make install

mod_perl

Download mod_perl. From the root directory, execute Makefile.PL with the following parameters:

Code:

perl Makefile.PL USE_APXS=1 WITH_APXS=/path/to/apxs
If you used the default installation directory for Apache, apxs will be located in /usr/local/apache/bin/apxs:

Code:

perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs
make && make install

Your httpd.conf configuration will updated automatically to load the following module:

Code:

LoadModule perl_module        libexec/libperl.so
FastCGI

Download FastCGI (mod_fastcgi). From the root directory, run the following commands:

Code:

/usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c
/usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so

Your httpd.conf configuration will updated automatically to load the following module:

Code:

LoadModule fastcgi_module    libexec/mod_fastcgi.so
To use FastCGI, you will need to edit httpd.conf to enable your FastCGI application. See the documentation for details.

Embperl

Perhaps you will also want to add Embperl for use with this DSO system. Here's how:

Installing Embperl with Apache previously installed and mod_perl installed as a DSO:

Code:

Build with support for Apache mod_perl?(y/n) [y]y
Searching for Apache sources...
Look at ..
Look at ../src
Look at ../apache_1.3.37/src
Use ../apache_1.3.37/src as Apache source(y/n) [y]n
Look at ./src

When get asked for the Apache sources, enter the directory where you found httpd.h, in my case '/usr/local/apache/include'.

Code:

Apache source not found, enter path name or q to quit []/usr/local/apache/include/
Searching for Apache sources...
Look at /usr/local/apache/include
Use /usr/local/apache/include as Apache source(y/n) [y]y

For the Apache executable enter the path to httpd:

Code:

Enter path and file to start as httpd [/usr/local/apache/httpd]/usr/local/apache/bin/httpd
Apache Version Server version: Apache/1.3.37 (Unix)

Then enter the directory where mod_env.so is located:

Code:

Library for mod_env.c not found, please enter path to mod_env.so  []/usr/local/apache/libexec
 + Load dynamic module mod_env.c
  (/usr/local/apache/libexec/mod_env.so)
 + Load dynamic module mod_perl.c
  (/usr/local/apache/libexec/libperl.so)
 + mod_perl was build with USE_DSO
Test start /usr/local/apache/bin/httpd
Test httpd will run as user nobody and group root
Test httpd will listen on port 8531
Found mod_perl  Version 1.29
Found LWP::UserAgent  Version 2.033
Found HTML::HeadParser  Version 2.22
Apache::Session not installed on this system
-> Disable tests for persistent data storage
Found File::Spec  Version 3.19
Found CGI  Version 3.23
Writing Makefile for HTML::Embperl

Hope this helps!

mb


All times are GMT -5. The time now is 03:09 AM.