Archive for January, 2006

Cpanel Error - Can’t locate DBD/mysql.pm

On restoring a site on cpanel server, got following error

Error while connecting to MySQL. Failover enacted.
install_driver(mysql) failed: Can’t locate DBD/mysql.pm in @INC
(@INC contains: /usr/lib/perl5/5.8.7/i686-linux
/usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-
linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5
/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/
5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5
/site_perl/5.8.0 /usr/lib/perl5/site_perl .
/scripts /scripts /scripts /scripts /scripts
/scripts /scripts /scripts) at (eval 32) line 3.
Perhaps the DBD::mysql perl module hasn’t
been fully installed,

The problem is due to Perl module DBD::mysql mising.

This can be downloaded from cpan.org

To install it, unzip it, then cd to the source folder, then run

# perl MakeFile.pl
# make
# make install

Comments off

/var/log/audit.d taking up too much space

On a Linux server, /var/log/audit.d is taking up more than 40 GB space. The folder contains lot of files with name save.*

You can delete these files

root@server1 [/var/log/audit.d]# rm -f save.*

Now you may disable audit service. To do this, first stop audit service.

root@server1 [/var/log/audit.d]# service audit stop
Shutting down audit subsystem [ OK ]
root@server1 [/var/log/audit.d]#

Now we can disable the service

root@server1 [/var/log/audit.d]# chkconfig audit off

Or you may use graphical interface to services

root@server1 [/var/log/audit.d]# ntsysv

and remove the selection for audit service.

Comments off

Securing MySQL database on Cpanel Servers

After you setup Cpanel, you have to do few things to secure MySQL on Cpanel server.

1. Delete the test database

This can be done with command

mysqladmin drop test

2. Change MySQL root Password

This can be done through WHM, login to WHM as root

WHM > SQL Services > MySQL Root Password
WHM > SQL Services > Reset Local MySQL Root Password

3. Disable MySQL login with out user and Password

By default mysql allow login to MySQL without entering user name or password.

To disable this, delete the empty user, this can be done with phpMyAdmin

WHM > SQL Services > phpMyAdmin

Select database “mysql”, browse the table “users”, in this you will see a user with no user name, just delete it, after doing this MySQL will now allow login with out user name and password.

On Cpanel Servers, you can just enter mysql to login as root, this is because, /root/.my.cnf contains user name and password.

[client]
user = root
password = password

Comments off

Cpanel phpMyAdmin shows “test” database

On Cpanel Server, test database shows on all users phpMyAdmin.

This create problem as some new users create their tables on this “test” database and some other users delete these tables.

To correct this problem, just delete this default database with name “test”.

Before deleting the mysql database, just take a backup of it, so if some clients ask for data, you can restore the tables to users database.

# cd /root
# mysqldump test >test.sql

Now lets delete the Database, so it won’t show in phpMyAdmin

server20# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 129273 to server version: 4.1.10a

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> drop database test;
Query OK, 80 rows affected (0.02 sec)

mysql> exit
Bye
server20#

Comments off

« Previous entries