# Where is mod_perl.so after emerge?

## Tonearm

I emerged mod_perl, and I'm supposed to add the following directive to apache2.conf:

LoadModule perl_module modules/mod_perl.so

as stated here:

http://theory.uwinnipeg.ca/modperl/docs/2.0/user/config/config.html#Enabling_mod_perl

but "locate mod_perl.so" after an updatedb turns up nothing.  Is there another possible name for the module or am I missing something?

- Grant

----------

## daledude

Try locate mod_perl without the .so.

Alternative look around /usr/lib/apache2-extramodules or in the other apache2 dirs.

----------

## bin-doph

the name is libperl.so and it is located in /usr/lib/apache-extramodules

next time try using qpkg from gentoolkit, which is a gift for such issues

```
qpkg -l mod_perl |egrep "\.so"

/usr/lib/perl5/vendor_perl/5.8.0/i686-linux/auto/Apache/Leak/Leak.so

/usr/lib/perl5/vendor_perl/5.8.0/i686-linux/auto/Apache/Symbol/Symbol.so

/usr/lib/apache-extramodules/libperl.so
```

hth

-fe

----------

## bin-doph

I just mentioned that u use apache2 but ur ebuild for mod_perl should be corresponding so don't get mixed up since I'm using apache1.3.x. Your output could be different but the result will be that what u need.

cheers

-fe

----------

## Tonearm

Bingo: /usr/lib/apache-extramodules/libperl.so

I added the following directive to apache2.conf:

LoadModule perl_module /usr/lib/apache-extramodules/libperl.so

like it says here:

http://theory.uwinnipeg.ca/modperl/docs/2.0/user/config/config.html#Enabling_mod_perl

and now when I "apache2ctl restart" I get:

Syntax error on line 191 of /etc/apache2/conf/apache2.conf:

Cannot load /usr/lib/apache-extramodules/libperl.so into server: /usr/lib/apache-extramodules/libperl.so: undefined symbol: ap_null_cleanup

Any idea what that means?

- Grant

----------

## daledude

Paste the output of:

```
ldconfig -p|grep perl
```

----------

## Tonearm

Here it is:

        libperl.so.1 (libc6) => /usr/lib/libperl.so.1

        libperl.so (libc6) => /usr/lib/libperl.so

Thanks!

- Grant

----------

## bin-doph

As I can read in the active-state-forum (I am everywhere!) you should maybe try to reemerge mod_perl like this

```
emerge -pv /usr/portage/dev-perl/mod_perl/mod_perl-1.99.11.ebuild

emerge /usr/portage/dev-perl/mod_perl/mod_perl-1.99.11.ebuild
```

mod_perl-1.99.11 is for sure the version which runs with apache2. After emerging check for the files again and see if your libperl.so is in /usr/lib/apache2-extramodules

hth

-fe

----------

## Tonearm

YES!  I did that emerging and I ended up with a /usr/lib/apache2-extramodules/mod_perl.so which is what the file is supposed to be called anyway.  Apache2 now restarts without that weird error and indicates that mod_perl is enabled.  Thank you!

I feel like I should understand more about what went on here.  Why did the long emerge work but emerge mod_perl was no good?  Why does Gentoo seem to move so many files and rename so many files from their standard locations and standard names?

----------

## bin-doph

well, I guess this specific case has more to do with the structure of mod-perl.

If you have a look at http://perl.apache.org u'll notice that the mod-perl-version for apache 1.3.x is mod_perl 1.29 and for apache2.x 1.99_14 which is a very wired versionin IMHO. ebuilds r getting the version to download from the filename itself. Ok, why not go for a useflag apache2? 'cause then the version of the filename isn't working anymore for the download and all is mixed up (could be done by hardcoding inside the ebuild but that doesnt seem to be the strategy). It's more a kind of keeping your eyes open ... always ... everywhere ...  :Wink: 

hth

-fe

----------

## Tonearm

bin-doph -

I'm sorry if I'm too slow, and if you want to ignore this post there won't be any hard feelings.

Keeping my eyes open sounds like a very good idea, but maybe I don't understand enough about emerge.  I did:

emerge apache

and:

emerge mod_perl

and that turned out to be the wrong way to get apache and mod_perl.  That's what I don't understand and I feel like I should.  Oh wait a minute....  I just did an:

emerge -p mod_perl

and it's telling me:

[ebuild  N    ] dev-perl/mod_perl-1.27-r4

So I guess I had installed a version of mod_perl that wasn't compatible with apache2?  Eyes open!

Ok, searching for mod_perl on packages.gentoo.org I see there are 10 versions available.  Apparently it goes to mod_perl-1.27-r4 by some kind of default.  How does it make that decision?  How can I select 1.99.11 instead?

- Grant

----------

## bin-doph

 *Tonearm wrote:*   

> I'm sorry if I'm too slow, and if you want to ignore this post there won't be any hard feelings.

 

hrhrhr, I guess I don't mind since everybody starts sometime (I hope) ...

well have a look at this

```
emerge -pv mod_perl

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] net-www/apache-1.3.31-r2  +pam  3,146 kB

[ebuild  N    ] dev-perl/mod_perl-1.27-r4  -ipv6  0 kB

Total size of downloads: 3,146 kB
```

This is from one of my boxes. If I would install mod-perl I'd get apache 1.3.31-r2 and mod_perl-1.27-r4 which do fit together and would work like a charm. It takes apache 1.3.31 because it has a dependency inside the ebuild

```
grep net-www /usr/portage/dev-perl/mod_perl/mod_perl-1.27-r4.ebuild

DEPEND="dev-lang/perl dev-perl/libwww-perl =net-www/apache-1* >=sys-apps/sed-4"
```

 which clearly say's that it needs an apache of version 1, right?

If you take a look at the mod_perl-1.99-ebuilds like this

```
grep net-www /usr/portage/dev-perl/mod_perl/mod_perl-1.99.11.ebuild

        =net-www/apache-2*
```

You'll need apache2 for that and if you would go for emerging this ebuild you'd get apache2 installed

```
emerge -pv /usr/portage/dev-perl/mod_perl/mod_perl-1.99.11.ebuild

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] net-www/apache-2.0.49-r4  +berkdb -doc +gdbm -ipv6 +ldap +ssl -static -threads  5,959 kB

[ebuild  N    ] dev-perl/CGI-3.00   0 kB

[ebuild  N    ] dev-perl/mod_perl-1.99.11   1,067 kB

Total size of downloads: 7,027 kB
```

I think your main missunderstanding is that you don't know why you have apache2 and the correct corresponding mod-perl-version which I don't know exactly but I could guess. Have a look at this

```
emerge -pv mod_perl apache

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] net-www/apache-1.3.31-r2  +pam  3,146 kB

[ebuild  N    ] dev-perl/mod_perl-1.27-r4  -ipv6  0 kB

[ebuild  N    ] net-www/apache-2.0.49-r4  +berkdb -doc +gdbm -ipv6 +ldap +ssl -static -threads  5,959 kB

Total size of downloads: 9,105 kB
```

Looks weird, I'm suprised too. If I would go like this I'd get

1. apache 1.3.x because of dependency for step2

2. mod_perl for apache 1.3.x

3. apache 2.x (without mod_perl, replacing apache1.3)

Since apache1 and apache2 are from the same ebuild they won't life together on your system and apache1.3.x will get removed after step3 by step3 and you've got apache2 without its correct mod_perl 

Keep in mind always using pretend and verbose (-pv) until you install a package and keeping eye's open  :Shocked: 

 :Laughing: 

hth

-fe

----------

## Tonearm

Alright, thanks for all your help bin-doph!  I'm coming along....

- Grant

----------

## stoffe

I seem to recall Apache and mod_perl versions was mixed up due to masks when I installed it recently, so using ACCEPT_KEYWORDS="~x86" got me apache2 and corresponding mod_perl version. 

What I really hopped in to say though, was that you needn't add manual LoadModule stuff to apache2.conf, but rather you could (should?) edit /etc/conf.d/apache2 and set APACHE2_OPTS="-D PERL" - same goes for PHP and other extra modules. That way, appropriate loading will be taken care of by Gentoo, including correct paths and extras etc.

----------

## gcasillo

Here we go again not even a year later. Now, they're in /usr/lib/apache2-extramodules. Or not. I dunno.  :Mad: 

----------

