You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tom Weber <we...@nytimes.com> on 2006/06/22 16:53:10 UTC

Basic Help, RedHat

New to this list, so I'm sure that this has been covered, but hoping 
someone can point me in the right direction. Hope this doesn't make 
you laugh too hard, being such a newbie. Don't know where to turn, 
but don't want to abandon this project.

I've been unsuccessful at trying to get mod_perl to work on RedHat 
Linux. I'm willing to write the code either in mod_perl v1 or v2, 
whichever I can get to work.

I'm attempting to use these pieces of software that comes straight from RedHat:
RedHat Linux O/S: 2.6.9-34.0.1.ELsmp
Apache: 2.0.52 (Red Hat)
Perl:  v5.8.5 built for i386-linux-thread-multi

and have made two attempts at mod_perl:

mod_perl: 1.99_16: (the one that comes with RedHat).  I can't even 
get Apache::Cookie to load, and a simple: $r->args does not give me 
anything...... can't get $r->headers_out->add (or set) also errors.

and:
mod_perl: 2.0.2: I was totally unsuccessful at trying "make" this. 
This version failed terribly with "make test", even some tests 
%failed = 200% (Huh??). Even with lots of errors, I did install it, 
but only with partial success. The Apache::compat did not seem to work neither.


Was thinking about apache 2.2.2 with mod_perl: 2.0.2, but noticed 
someone had problems with that.


The part that is really frustrating was that someone built a combo 
apache/mod_perl for windows that installed easily, and I was able to 
prototype what I needed on there.

Thanks to anyone who can help,
Tom


Re: Basic Help, RedHat

Posted by Hendrik Van Belleghem <he...@gmail.com>.
Tom,

I've had no trouble with Red Hat packages and Apache or mod_perl in
the past.. but last time I did that, RH9 was just out. I can recommend
the following installation plan for Apache. It always worked for me,
on various linux dists.

http://www.delouw.ch/linux/apache.phtml

There is also a XAMPP version for Linux.. XAMPP is pretty much a
prepackaged apache + goodies. Good for a quick start (but I personally
stick to official packages or compiling from source).

HTH

Hendrik

On 6/22/06, Clinton Gormley <cl...@traveljury.com> wrote:
> Hi Tom
>
> Here's the install script that I walk through to install Apache 2,
> mod_perl 2 and libapreq.  Done it on a number of machines including
> redhat, and it works for me.
>
> You may get errors along the way because of missing libraries.  Just
> install them and repeat the last step.
>
> It installs apache to /opt/httpd.... and links it to /opt/apache/, so
> you can stick your websites under /opt/apache, and when you want to
> upgrade, just relink to the new directories in /opt/httpd....
> ===============================================
>
> ### For 64 bit, try LDFLAGS="-L/usr/lib64"
>
> MPM="prefork"
>
> SUFFIX="_${MPM}_perl_php"
>
> rm -Rf apache_and_friends
> mkdir -p apache_and_friends/packages
> cd apache_and_friends/packages
>
> # See http://httpd.apache.org/download.cgi
> wget http://apache.rediris.es/httpd/httpd-2.0.58.tar.gz
>
> # See http://perl.apache.org/download/index.html
> wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
>
> # See http://httpd.apache.org/apreq/download.cgi
> wget http://apache.rediris.es/httpd/libapreq/libapreq2-2.07.tar.gz
>
> cd ..
>
> tar -xzf packages/httpd*
> tar -xzf packages/mod_perl*
> tar -xzf packages/libapreq*
>
> APACHE=`echo httpd*`
>
> echo "INSTALLING to /opt/$APACHE$SUFFIX"
>
> cd $APACHE
>
> CFLAGS="-DAP_UNSAFE_ERROR_LOG_UNESCAPED" \
> ./configure --prefix=/opt/$APACHE$SUFFIX \
>             --localstatedir=/opt/apache \
>             --sysconfdir=/opt/apache/conf \
>             --datadir=/opt/apache \
>             --with-mpm=$MPM\
>             --enable-cache=shared\
>             --enable-deflate=shared\
>             --enable-disk-cache=shared\
>             --enable-file-cache=shared\
>             --enable-info=shared\
>             --enable-mem-cache=shared\
>             --enable-rewrite=shared\
>             --enable-dav=shared\
>             --enable-auth-digest\
>             --enable-ssl=shared\
>             --enable-unique-id=shared\
>             --enable-usertrack=shared
> make
> rm -Rf /opt/$APACHE$SUFFIX
> make install
> cd ..
>
>
>
> cd mod_perl-*
> perl Makefile.PL \
>       MP_AP_PREFIX=/opt/$APACHE$SUFFIX \
>       MP_COMPAT_1X=0
>
>
> make
> make test
> make install
> cd ..
>
>
> cpan "ExtUtils::XSBuilder"
>
> cpan "Parse::RecDescent"
>
> cd libapreq*
> perl Makefile.PL --with-apache2-apxs=/opt/$APACHE$SUFFIX/bin/apxs
> make
> make test
> make install
>
>
> ln -fs /opt/$APACHE$SUFFIX/* /opt/apache
> ln -sf /opt/apache/bin/apachectl /usr/bin/apachectl
> ln -sf /opt/apache/bin/apachectl /etc/rc.d/httpd
> chkconfig httpd on
>
> perl -pi -e "s/ServerRoot \"\/opt\/$APACHE$SUFFIX\"/ServerRoot \"\/opt\/apache\"/" /opt/apache/conf/httpd.conf
>
> grep -qE "mod_perl.so" /opt/apache/conf/httpd.conf || \
>          perl -pi -e 's!(modules/mod_apreq.so\s*\n)!$1LoadModule perl_module modules/mod_perl.so\n!' \
>         /opt/apache/conf/httpd.conf
>
>
> mkdir /opt/apache/conf/ssl.crt/
> mkdir /opt/apache/conf/ssl.key/
> cd /opt/apache/conf/ssl.key/
> openssl genrsa -out server.key 1024
> openssl req -new -days 1000 -key server.key -x509 -out ../ssl.crt/server.crt
>
>
>
>
>
>


-- 
Hendrik Van Belleghem
Spine - The backbone for your website - http://spine.sf.net

Re: Basic Help, RedHat

Posted by Clinton Gormley <cl...@traveljury.com>.
Hi Tom

Here's the install script that I walk through to install Apache 2,
mod_perl 2 and libapreq.  Done it on a number of machines including
redhat, and it works for me.

You may get errors along the way because of missing libraries.  Just
install them and repeat the last step.

It installs apache to /opt/httpd.... and links it to /opt/apache/, so
you can stick your websites under /opt/apache, and when you want to
upgrade, just relink to the new directories in /opt/httpd....
===============================================

### For 64 bit, try LDFLAGS="-L/usr/lib64" 

MPM="prefork"

SUFFIX="_${MPM}_perl_php"

rm -Rf apache_and_friends
mkdir -p apache_and_friends/packages
cd apache_and_friends/packages

# See http://httpd.apache.org/download.cgi
wget http://apache.rediris.es/httpd/httpd-2.0.58.tar.gz

# See http://perl.apache.org/download/index.html
wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz

# See http://httpd.apache.org/apreq/download.cgi
wget http://apache.rediris.es/httpd/libapreq/libapreq2-2.07.tar.gz
    
cd ..

tar -xzf packages/httpd*
tar -xzf packages/mod_perl*
tar -xzf packages/libapreq*

APACHE=`echo httpd*` 

echo "INSTALLING to /opt/$APACHE$SUFFIX"

cd $APACHE

CFLAGS="-DAP_UNSAFE_ERROR_LOG_UNESCAPED" \
./configure --prefix=/opt/$APACHE$SUFFIX \
            --localstatedir=/opt/apache \
            --sysconfdir=/opt/apache/conf \
            --datadir=/opt/apache \
            --with-mpm=$MPM\
            --enable-cache=shared\
            --enable-deflate=shared\
            --enable-disk-cache=shared\
            --enable-file-cache=shared\
            --enable-info=shared\
            --enable-mem-cache=shared\
            --enable-rewrite=shared\
            --enable-dav=shared\
            --enable-auth-digest\
            --enable-ssl=shared\
            --enable-unique-id=shared\
            --enable-usertrack=shared
make
rm -Rf /opt/$APACHE$SUFFIX
make install
cd ..



cd mod_perl-*
perl Makefile.PL \
      MP_AP_PREFIX=/opt/$APACHE$SUFFIX \
      MP_COMPAT_1X=0 

      
make
make test
make install
cd ..


cpan "ExtUtils::XSBuilder"

cpan "Parse::RecDescent"

cd libapreq*
perl Makefile.PL --with-apache2-apxs=/opt/$APACHE$SUFFIX/bin/apxs
make
make test
make install


ln -fs /opt/$APACHE$SUFFIX/* /opt/apache
ln -sf /opt/apache/bin/apachectl /usr/bin/apachectl
ln -sf /opt/apache/bin/apachectl /etc/rc.d/httpd 
chkconfig httpd on

perl -pi -e "s/ServerRoot \"\/opt\/$APACHE$SUFFIX\"/ServerRoot \"\/opt\/apache\"/" /opt/apache/conf/httpd.conf

grep -qE "mod_perl.so" /opt/apache/conf/httpd.conf || \
         perl -pi -e 's!(modules/mod_apreq.so\s*\n)!$1LoadModule perl_module modules/mod_perl.so\n!' \
        /opt/apache/conf/httpd.conf
            

mkdir /opt/apache/conf/ssl.crt/
mkdir /opt/apache/conf/ssl.key/
cd /opt/apache/conf/ssl.key/
openssl genrsa -out server.key 1024
openssl req -new -days 1000 -key server.key -x509 -out ../ssl.crt/server.crt