Friday, September 26, 2008

Install Open SSL for Linux Box

If you working with Perl at Linux, you may sometimes need to use HTTPS page fetching using LWP UserAgent. Actually it requires Crypt::SSLeay module installed at Per library and OpenSSL libraries.

First lets know how to install the OpenSSL at linux. Remember, this is not for windows. Here is the steps to install OpenSSL.

1) Download the OpenSSL binary from their site. Here is the link, Select the latest version, and download it. For this example, I'm using this version openssl-0.9.8h.tar.gz

2) After successful download, unzip the .gz file using gunzip command. You'll get the tar ball extracted from the gz file.
gunzip openssl-0.9.8h.tar.gz

3) Now You have the .tar ball, Just un-tar that file. It will create a folder named openssl-0.9.8h
tar xvf openssl-0.9.8h.tar.gz

4) Now get inside the folder just created.
cd openssl-0.9.8h

5) Configure installation.
sh ./config

6) Make the installation

7) Test it, but you can ignore this steps.
make test

8) Finally Install it.
make install

That's it. Remember you'll require to gcc installed at your linux box. If you are using CentOS, then you can use Yum to install the gcc.
yum install gcc

Or apt-get for debian or ununto linux
 apt-get install gcc

remember installed openSSL using YUM is not sufficient to install Crypt::SSLeay module. That's why this installation process for openssl.

Now install Crypt::SSLeay module using Perl's Cpan. To install it execute the below code.
cpan -i Crypt::SSLeay

At the middle of the installation it will ask you to provide the openssl path. Just add /bin after the openssl path, it will use those libraries for OpenSSL.

To test whether the Perl module installed or not, check by below command.
perl -e "use Crypt::SSLeay;"

1 comment:

Andrew said...

step 3 should be tar xvf openssl-0.9.8h.tar, not tar xvf openssl-0.9.8h.tar.gz as listed..... Otherwise good job!

Get function name programaticaly - Python

This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...