Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/ 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

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 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, but there is another dependency on an unspecified "loadable object" and I have no clue which one. Openssl is installed on my system.


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?

share|improve this question

migrated from Aug 29 '11 at 6:56

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

up vote 5 down vote accepted

I solved my problem

  1. installing the package

    debian and ubuntu

    aptitude install libssl-dev

    Centos o fedora

    yum install -y openssl-devel

  2. compiling the module manually

    sudo cpan Crypt/OpenSSL/

share|improve this answer

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.

share|improve this answer

You should look at 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."

share|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
Link is broken :-(. – pevik Jan 29 at 21:32

How about creating package with dh-make-perl ( A bit too late, but it might help to someone.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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