Installing Perl Modules

Thanks to

LiveJournal requires several Perl modules to be installed. Installing these modules requires a fully working perl and C development environment (including a C compiler and make tool).


Some modules such as GD and Compress::Zlib require certain system libraries to be pre-installed on your machine. Please read the author-provided README files for each module before proceeding further.

This may mean particular development packages need to be installed on your system, before a Perl module will install in CPAN. For example, on a Debian system, to install the optional Math::BigInt::GMP module, you should install libgmp3-dev first. Similarly, you may need to install the “development” packages for MySQL and GD on your system, before attempting to install the related Perl modules. The names of these packages varies between Linux distributions, but are often called <packagename>-dev. Installing binary packages of modules provided through your Linux distribution is the easier option.

Table�6.1.�Required Perl Modules

DateTime libdatetime-perl
DBI libdbi-perl
DBD::mysql libdbd-mysql-perl
Class::Autouse libclass-autouse-perl
Digest::MD5 libmd5-perl
Digest::SHA1 libdigest-sha1-perl
HTML::Template libhtml-template-perl
Image::Size libimage-size-perl
MIME::Lite libmime-lite-perl
MIME::Words libmime-perl
Compress::Zlib libcompress-zlib-perl
Net::DNS libnet-dns-perl
URI::URL liburi-perl
HTML::Tagset libhtml-tagset-perl
HTML::Parser libhtml-parser-perl
LWP::Simple libwww-perl
LWP::UserAgent libwww-perl
GD libgd-gd2-perl
Mail::Address libmailtools-perl
Unicode::MapUTF8 libunicode-maputf8-perl
XML::Simple libxml-simple-perl
IO::WrapTie libio-stringy-perl
Captcha::reCAPTCHA libcaptcha-recaptcha-perl
Digest::HMAC_SHA1 libdigest-hmac-perl


Optional modules

GD::Graph, libgd-graph-perl
Required for making graphs for the statistics page.
Proc::ProcessTable, libproc-process-perl
Better reliability for starting daemons necessary for high-traffic installations.
RPC::XML, librpc-xml-perl
Required for outgoing XML-RPC support
SOAP::Lite, libsoap-lite-perl
Required for XML-RPC support.
XML::RSS, libxml-rss-perl
Required for retrieving RSS off of other sites (syndication).
String::CRC32, libstring-crc32-perl
Required for palette-altering of PNG files. Only necessary if you plan to make your own S2 styles that use PNGs, not GIFs.
XML::Atom, libxml-atom-perl
Required for Atom API support.
Math::BigInt::GMP, libmath-bigint-gmp-perl
Aides Crypt::DH so it is not crazy slow.
URI::Fetch, liburi-fetch-perl
Required for OpenID support.
Crypt::DH, libcrypt-dh-perl
Required for OpenID support.
Image::Magick, perlmagick
Required for the userpic factory.
Class::Accessor, libclass-accessor-perl
Required for TheSchwartz job submission.
Class::Trigger, libclass-trigger-perl
Required for TheSchwartz job submission.
Class::Data::Inheritable, libclass-data-inheritable-perl
Required for TheSchwartz job submission.
GnuPG::Interface, libgnupg-interface-perl
Required for email posting.
Mail::GnuPG, libmail-gnupg-perl
Required for email posting.
Text::vCard, libtext-vcard-perl
Used to generate user vCards.
Required for country lookup with IP address.
Required for Apache per-request database logging.

Debian Install.�If you are using Debian the following command should retrieve and build every required module. If there are any modules not yet packaged in Debian, you can use CPAN to install those — Unicode::CheckUTF8 is an example.:

# apt-get install libdatetime-perl libdbi-perl libdbd-mysql-perl \
libclass-autouse-perl libmd5-perl libdigest-sha1-perl \
libhtml-template-perl libimage-size-perl libmime-lite-perl \
libmime-perl libcompress-zlib-perl libnet-dns-perl \
liburi-perl libhtml-tagset-perl libhtml-parser-perl \
libwww-perl libwww-perl libgd-gd2-perl \
libmailtools-perl libunicode-maputf8-perl libxml-simple-perl \
libio-stringy-perl  libcaptcha-recaptcha-perl \

And likewise for the optional modules:

# apt-get install libgd-graph-perl libproc-process-perl librpc-xml-perl \
libsoap-lite-perl libxml-rss-perl libstring-crc32-perl \
libxml-atom-perl libmath-bigint-gmp-perl liburi-fetch-perl \
libcrypt-dh-perl perlmagick libclass-accessor-perl \
libclass-trigger-perl libclass-data-inheritable-perl libgnupg-interface-perl \
libmail-gnupg-perl libtext-vcard-perl  \

Using CPAN.� Alternatively, you can use CPAN to install the modules:

From the root prompt on your server, invoke the CPAN shell:

# perl -MCPAN -e shell

Once the Perl interpreter has loaded (and been configured), you can install modules with: install MODULENAME.

The first thing you should do is upgrade your CPAN:

cpan> install Bundle::CPAN

Once it is completed, type:

cpan> reload cpan

Now, enter the following command to retrieve all of the required modules:

cpan> install DateTime
cpan> install DBI
cpan> install DBD::mysql
cpan> install Class::Autouse
cpan> install Digest::MD5
cpan> install Digest::SHA1
cpan> install HTML::Template
cpan> install Image::Size
cpan> install MIME::Lite
cpan> install MIME::Words
cpan> install Compress::Zlib
cpan> install Net::DNS
cpan> install URI::URL
cpan> install HTML::Tagset
cpan> install HTML::Parser
cpan> install LWP::Simple
cpan> install LWP::UserAgent
cpan> install GD
cpan> install Mail::Address
cpan> install Unicode::MapUTF8
cpan> install XML::Simple
cpan> install IO::WrapTie
cpan> install Unicode::CheckUTF8
cpan> install Captcha::reCAPTCHA
cpan> install Digest::HMAC_SHA1

And likewise for the optional modules:

cpan> install GD::Graph
cpan> install Proc::ProcessTable
cpan> install RPC::XML
cpan> install SOAP::Lite
cpan> install XML::RSS
cpan> install String::CRC32
cpan> install XML::Atom
cpan> install Math::BigInt::GMP
cpan> install URI::Fetch
cpan> install Crypt::DH
cpan> install Image::Magick
cpan> install Class::Accessor
cpan> install Class::Trigger
cpan> install Class::Data::Inheritable
cpan> install GnuPG::Interface
cpan> install Mail::GnuPG
cpan> install Text::vCard
cpan> install IP::Country::Fast
cpan> install GTop


Be aware that after freshly installing make / gcc, your perl installation will not necessarily detect it. This means module installation will still fail during the ‘make’ stage. You may need to invoke the CPAN shell and run the setup routine again, to point to the location of make:

# perl -MCPAN -e shell CPAN


cpan> o conf make /usr/bin/make
cpan> o conf commit


You can find out the locations of the various tools the CPAN setup routine (o conf) will ask you about by using the whereis command, at a command prompt. For example:

$ whereis gzip

To make sure you have the necessary modules run the included tool: $LJHOME/bin/ --needed-debs --only=modules

If does not detect all of the required modules, it will tell you which ones you are missing. You should install those.