It's been a couple of days I am pulling my hair trying to get a legacy Perl script working as cgi within an apache2 server. It requires Crypt::OpenSSL::AES. From the Apache error logs:

Can't locate Crypt/OpenSSL/AES.pm in @INC

The easiest would have been if a ubuntu package could install it with me, but I am unable to locate any package with the proper files. The following returns nothing:

apt-file search AES.pm

As a regular user, I have installed cpan and used it to install perl modules, so that Crypt::OpenSSL::AES is installed under my user directory at /home/user/.cpan/build/Crypt-OpenSSL-AES-0.02-H74J64/lib. Unfortunately, whether I manually copy AES.pm to its proper location (/usr/local/lib/perl/5.10.1/... as per @INC) or I add the PERL5LIB env variable within the apache2 configuration files (SetEnv PERL5LIB /home/user/.cpan/build/Crypt-OpenSSL-AES-0.02-H74J64/lib), the error logs now show that there is a missing shared object:

Can't locate loadable object for module Crypt::OpenSSL::AES in @INC 

The error mesage is subtly different from the first one (I didn't notice it at first): now it does find AES.pm, but there is another dependency on an unspecified "loadable object" and I have no clue which one. Openssl is installed on my system.

So:

Generally, what is the proper way (on a Linux-ubuntu system) to install perl modules to work with an apache2 server? (I searched and there are many answers to this question, but it still doesn't work).

Specifically, how can I properly satisfy my cgi perl application's dependency on Crypt::OpenSSL::AES?

link|improve this question

feedback

migrated from stackoverflow.com Aug 29 '11 at 6:56

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 1 down vote accepted

I solved my problem by installing the package libssl-dev and compiling the module manually in the directory referenced in the question (created by cpan).

link|improve this answer
feedback

You should look at http://debian.pkgs.cpan.org/. It provides a way for you to generate your own .deb files from CPAN packages. You could try to just shotgun their pre-packaged ones, but just be very aware that they could break due to differences between the Debian machines they were built for and whatever version of Ubuntu you are using: "There be Dragon's Here."

link|improve this answer
Thank you. That looks very interesting. I already have a working system so I am not going to break it now, but I bookmarked your page and will try it next time I have a similar need. – augustin Sep 7 '11 at 23:55
feedback

Usually there are *-dev packages in the Ubuntu repository, for developers and administrators to build other software. So the packages to merely run the program can get smaller in size.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.