How to install a Perl Module in Linux?

April 30, 2011    |   Posted by admin   |    Category: Linux Administration

There are various ways to download and install perl modules from CPAN. In general it’s a good idea to download and install the perl module but we will see the different ways of installing the perl module.

Method 1. The easiest way is to use the perl CPAN module. SSH to the server as root and execute:

# cpan

if you are running this for the first time, it will prompt you for a few questions (default answers are fine) before providing you with the “cpan >” prompt. To install a module, say for example “Perl::OSType”, execute

cpan > install Perl::OSType

this will download and compile the module and install it server wide. To know more commands/options of cpan, type question mark ( ? ) at the cpan prompt.

Method 2. The second and the quickest method is to use perl CPAN module from the bash prompt instead of ‘cpan’ prompt. If you are on the command line of Linux, just execute

# perl -MCPAN -e 'install Perl::OSType'

Method 3. The above 2 methods are the easiest one but it is recommended to install the module manually as the above methods may not always work.

Search and download the module from http://search.cpan.org/ and then wget it on your server. Once done, extract it:

# tar -zxf Perl-OSType-1.002.tar.gz

Untar the downloaded file and go to the extracted directory. There is a README file inside the directory with the installation steps, however, here are they:

# perl Makefile.PL 
# make 
# make test 
# make install

That is it.

configure error: Ogg needed! Ogg not found

February 27, 2011    |   Posted by admin   |    Category: Linux Administration

You may receive the “configure: error: Ogg needed” while installing libogg which indicates some missing devel packages related to Ogg. The complete error message is as follows:

Could not run Ogg test program, checking why... 
The test program compiled, but did not run. 
This usually means that the run-time linker is not finding Ogg 
or finding the wrong version of Ogg. configure: error: Ogg needed!

This requires the installation of libogg and libvorbis devel package which is available with yum. SSH to the server as root and install the packages

# yum install libogg-devel libvorbis libvorbis-devel

Once done, you will be able to install libogg package.

Comments Off on configure error: Ogg needed! Ogg not found

nslookup / host / dig Command Not Found in Linux

February 18, 2011    |   Posted by admin   |    Category: Linux Administration

How to install the nslookup, host OR dig commands in Linux?

Sometimes you are unable to use the nslookup, host OR dig command on your Linux server and receives the following message

-bash: nslookup: command not found 
-bash: host: command not found 
-bash: dig: command not found

This indicates that the DNS package “bind-utils” isn’t installed during the OS installation. The ‘bind-utils’ package install nslookup, host, dig and other DNS related commands.

Installation:
SSH to your server as root and execute

# yum install bind-utils

Once done, you will be able to use host, nslookup etc

# host domain.tld
  domain.tld has address 1.1.1.1
# nslookup domain.tld
  Name: domain.tld Address: 1.1.1.1
Comments Off on nslookup / host / dig Command Not Found in Linux

PCRE Library Not Found: Nginx compilation

January 22, 2011    |   Posted by admin   |    Category: Linux Administration

The HTTP rewrite module requires the PCRE library during the Nginx compilation. The PCRE package contains Perl Compatible Regular Expression libraries useful for implementing regular expression pattern matching.

If PCRE package is not installed on the server, NGINX installation will fail with the following message:

checking for PCRE library ... not found 
checking for PCRE library in /usr/local/ ... not found 
checking for PCRE library in /usr/include/pcre/ ... not found 


 

./configure: the HTTP rewrite module requires the PCRE library. 
You can disable the module by using --without-http_rewrite_module 
or install the PCRE library into the system, 
or build the PCRE library statically from the source with nginx 
by using--with-pcre=<path> option.

How to Install the PCRE library?

1) SSH to the server and go to a temporary directory

 # cd /usr/local/src

2) Download PCRE:

 # wget http://downloads.sourceforge.net/pcre/pcre-8.10.tar.bz2

3) Unpack and change to the pcre directory

# tar -jxf pcre-8.10.tar.bz2 
# cd pcre-8.10

4) Confiure PCRE:

# ./configure

5) Create the installation files and install PCRE

# make 
# make install

Once done, you should be able to install Nginx with the HTTP rewrite module.

Comments Off on PCRE Library Not Found: Nginx compilation

Starting sshd: Missing privilege separation directory: /var/empty/sshd

December 5, 2010    |   Posted by admin   |    Category: Linux Administration

The SSHD service while restarting, looks for the “/var/empty/sshd/etc” directory which contains a symlink to the ‘localtime’ file. If the file doesn’t exist, it results in a “cannot create symbolic link `/var/empty/sshd/etc’: No such file or directory” error message.

The complete error message is as follows:

-bash-3.2# service sshd restart 
cp: cannot create symbolic link `/var/empty/sshd/etc': 
No such file or directory 
Starting sshd: Missing privilege separation: /var/empty/sshd [FAILED]

The solution is to create the “/var/empty/sshd/etc” directory and then create a symlink for localtime file.

# mkdir /var/empty/sshd/etc
# cd /var/empty/sshd/etc
# ln -s /etc/localtime localtime

Once done, you should be able to restart the sshd service.