»2. Installing Perl Modules

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).

Note

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

Table 6.1. Required Modules

DBIlibdbi-perl
DBD::mysqllibdbd-mysql-perl
Digest::MD5libdigest-md5-perl
Digest::SHA1libdigest-sha1-perl
Image::Sizelibimage-size-perl
MIME::Litelibmime-lite-perl
MIME::Wordslibmime-perl
Compress::Zliblibcompress-zlib-perl
MIME::Base64libmime-base64-perl
URI::URLliburi-perl
HTML::Tagsetlibhtml-tagset-perl
HTML::Parserlibhtml-parser-perl
LWP::Simplelibwww-perl
LWP::UserAgentlibwww-perl
GDlibgd-perl
Mail::Addresslibmailtools-perl
Unicode::MapUTF8libunicode-maputf8-perl
Storablelibstorable-perl
Time::HiReslibtime-hires-perl
IO::WrapTie 

Optional modules

Net::SMTP, libnet-perl
Alternative to piping into sendmail to send mail.
GD::Graph, libgd-graph-perl
Required to make 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 XMLRPC 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.

Debian Install. If you're using Debian the following command should retrieve and build every required module:

# apt-get install libdbi-perl libdbd-mysql-perl libdigest-md5-perl \
libdigest-sha1-perl libimage-size-perl libmime-lite-perl \
libmime-perl libcompress-zlib-perl libmime-base64-perl \
liburi-perl libhtml-tagset-perl libhtml-parser-perl \
libwww-perl libwww-perl libgd-perl \
libmailtools-perl libunicode-maputf8-perl libstorable-perl \
libtime-hires-perl  

And likewise for the optional modules:

# apt-get install libnet-perl libgd-graph-perl libproc-process-perl \
librpc-xml-perl libsoap-lite-perl libxml-rss-perl \
libstring-crc32-perl 

Using CPAN.  Otherwise you'll want to use CPAN to install the modules by performing the following steps:

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 by issuing the command install MODULENAME.

The first thing you should do is upgrade your CPAN:

cpan> install Bundle::CPAN

Once it's done, type:

cpan> reload cpan

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

cpan> install DBI
cpan> install DBD::mysql
cpan> install Digest::MD5
cpan> install Digest::SHA1
cpan> install Image::Size
cpan> install MIME::Lite
cpan> install MIME::Words
cpan> install Compress::Zlib
cpan> install MIME::Base64
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 Storable
cpan> install Time::HiRes
cpan> install IO::WrapTie

And likewise for the optional modules:

cpan> install Net::SMTP
cpan> install GD::Graph
cpan> install Proc::ProcessTable
cpan> install RPC::XML
cpan> install SOAP::Lite
cpan> install XML::RSS
cpan> install String::CRC32

Warning

There used to be a few custom LJ:: modules that needed installing. Those no longer need to be installed on the system, as LJ uses them right out of /cgi-bin/* instead. If by chance you have those old LJ modules installed, it's best to go remove them since Perl will prefer system-level ones over the (newer) local ones.

Important

To ensure that you have installed the necessary modules, be sure to run the included tool: $LJHOME/bin/checkconfig.pl. If checkconfig.pl doesn't detect all of the required modules, it will tell you which ones you are missing. Note that this tool will fail after checking for modules, because it will also check for a database connection, which hasn't been set up yet. This will be fixed later when we add options to checkconfig.pl to detect for specific sections of installation.