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
cmd?

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

cmd? l
Installed modules are:
   Acme::Spork
   Apache::Admin::Config
   AppConfig
   Archive::Tar
   Archive::Tar::Streamed
   Archive::Zip
   Attribute::Handlers
   Authen::Libwrap
   Authen::SASL
   BSD::Resource
   Bundle::Interchange
   Business::OnlinePayment
   Business::OnlinePayment::AuthorizeNet
   Business::UPS
...
...

 

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.

Debugging Perl/CGI Scripts

By default, Perl/CGI script will send the error to STDERR where it is the server standard error and normally it will store to the server Apache error log.

To setup private error_log from your Perl/CGI script, you may easily get them done with script below.

BEGIN {
use CGI::Carp qw(carpout);
open(LOG, “>>/home/mickgenie.com/logs/cgi-error.log”) or
die(“Unable to open cgi-error.log: $!n”);
carpout(LOG);
}

The carpout() used to call the error and send it to the log file that you set.

To setup error to send to browser,

use CGI::Carp qw(fatalsToBrowser);
die “Couldn’t open log file”;

Use the above script and it could send all the error to the Browser.

Perl Script getting Premature End Of Script Headers Error

Assume that you have a sample Perl script that only print the clear text and you still got the premature end of script headers error.

Sample Perl Script used.

#!/usr/local/bin/perl
print “Content-type: text/html\n\n”;
print “Hello, Mick Genie!\n”;

Step to overcome the problem.

1. Check the Apache error_log or domain error log.
2. Check if the perl script come with permission 755 where this will allow the script to execute.
Continue reading Perl Script getting Premature End Of Script Headers Error

No Space Left on Device

When you restarting the httpd services while the the server found high load, you might get these error.

ERROR: (28)No space left on device: mod_rewrite: could not create rewrite_log_lock

Why you will getting this error? The reason is the semaphore issue. What is semaphore? It is the process used to communicate between active process from Apache.

To check what is the semaphore used, you may use the command as below.

Continue reading No Space Left on Device

You need to install the LWP perl module (libwww-perl) and then install csf

You might got error with “You need to install the LWP perl module (libwww-perl) and then install csf” when you installing your CSF firewall. Below is the error message got.

[[email protected] csf]# sh install.sh

Configuring for OS

Checking for perl modulesfailed
You need to install the LWP perl module (libwww-perl) and then install csf
[[email protected] csf]#

To overcome the problem, you may yum install the required module named perl-libwww-perl.

yum install perl-libwww-perl