Linux: Command to check Perl Modules

instmodsh, a shell to examine installed modules. Used to easily list all the installed module from your server/PC.

[email protected] [~]# instmodsh
Available commands are:
   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program

By hitting ‘l’, it will show you the list of installed module,

cmd? l
Installed modules are:


Install Git on CentOS

Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

To install Git on CentOS, you may refer to the installation step as below from Shell,

cd /usr/local/src
tar jxvf git-1.7.6.tar.bz2
cd git-1.7.6
make clean && make distclean
make configure
./configure --prefix=/usr
make install

For more information, may refer to the URL below,

tailwatchd failed: A restart was attempted automagically

If you have cPanel with your server, you might get the following error.

tailwatchd failed @ Tue Jan 1 00:00:00 2010. A restart was attempted automagically
Service Check Method: [check command] tailwatchd is not running

However, you do not need to worry on it as it might be cPanel services stopped or restarted.

To understand in detail, you may execute the command as below from your Shell.
tail -f /usr/local/cpanel/logs/tailwatchd_log

To fix it, you may try to execute the command as below.
/usr/local/cpanel/libexec/tailwatchd –status

Then restart the cPanel services.
service cpanel restart

If the issue still not fix, may update cPanel,
/scripts/upcp –force

Install Memcache with cPanel that running CentOS

I was trying to install Memcache from cPanel from yesterday night but it seems to be sucks when installing from cPanel control panel.

Hence, I am sharing the step as below which I used to compiled manually from the shell.

Create a temporary folder
1. As it is a manually work, you might want to clear the source file after the installation, so create a folder as command below.

mkdir ~/memcache

Install LibEvent
To install memcache, you will need LibEvent, go to their site to get the latest version.

cd ~/memcache
tar zxvf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
make install

Install Memcache
Now, install the memcache and get the latest version from their site.

cd ~/memcache
tar zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --with-lib-event=/usr/local/
make install

Install PHP Memcache
Now, install PECL Memcache and get the latest version.

cd ~/memcache
tar zxvf memcache-2.2.6.tgz
cd memcache-2.2.6
make install
vi /usr/local/lib/php.ini

Find the extension as below and if it is not existed, add it in the php.ini.

Restart the Apache services.

service httpd restart

Install Perl DBD::MySQL

Today, I am getting an error while trying to install application from fantastico, however it is found out the database is not dump correctly but the database, user and password is done correctly.

After checking with cPanel team and Netenberg team. It is found out the problem was came from MySQL issue where I have upgrade the MySQL from 5.0 to 5.1.

To overcome the issue, DBD::MySQL is needed for an upgrade. However, it is found out WHM could not help to upgrade the DBD::MySQL. Hence I am performing the manually installation.

Below is the step,
1. Run from Shell.

perl -MCPAN -e shell

2.Type in,

cpan> install DBD::mysql

3. Wait for the installation and you could retry again.

how to update Rubygems

Today, I got another challenge from @thebosscat to help out the Ruby on Rails case.

Symptoms: the server using RubyGems 1.2.0 and all of the ruby gems could not able updated through “gem update” or even “gem update –system”.

To overcome the problem, I was trying to update the rubygems as step below.
1. Download rubygems version from URL below.
2. Extract the file (in this case, I used the version 1.3.1).

tar -xvf rubygems-1.3.1.tgz

3. Then enter to the path,

cd rubygems-1.3.1

4. Run the setup.

ruby setup.rb

5. Verify from the shell again.

gem environment

cPanel Fantastico not able to install any apps

Today I found out that the cPanel do not working well with the Fantastico DeLuxe and I have no idea what it is going on at first as there do not have any error from the server.

1. Fantastico showing installation configuration file and database with ERROR.
2. No web file in the public_html folder.
3. Database is not configured properly(no table and data).

After long time tested and checked. Finally I am able to get some hint from the cPanel error_log.
PHP Warning:  shell_exec() has been disabled for security reasons in /tmp/cpanel_phpengine.1289814352.9866F8Ane8kVMm on line 979

I have immediate go to php.ini file and check for the disable_function and found out shell_exec and system is being listed.

To overcome it, I have putting a semi-colon “;” to the line of disable_function and restart the Apache HTTPD services and it is working fine.

iptables filter mac address

Mick Genie ever guide how to allow and block IP, port, etc from iptables, however there is another option which is to block or allow mac address.

MAC address stand for Media Access Control Address and it could be specifically for a network.

To block a mac address, simply run from shell.

iptables -A INPUT -m mac –mac-source 00:11:22:FF:33:EE -j DROP

Creating SSL MySQL from Windows

Assumed that you will going to install OpenSSL and you wish to apply to your MySQL if you are using Windows Operating System.

1. Download OpenSSL from URL here.
2. Once installation done, add your bin folder of the OpenSSL to your Environment Variable.
3. Open command prompt.
4. Follow the command as below.
cd \
If you see the result return is “OpenSSL>”, that mean you have successfully installed.
5. Open the MySQL command and refer to the following line.
shell> md c:\newcerts
shell> cd c:\newcerts
6. Test your certificate.
shell> mysqld –defaults-file=$DIR/my.cnf &