/sbin/hotplug: no runnable /etc/hotplug/aaaa.agent is installed in /var/log/messages

February 21, 2010 on 11:32 am | In Centos, Linux, Ubuntu | No Comments

Hi guys,

You might have been facing the error getting logged in /var/log/messages. Deeper research in Google gave the result that it is the issue with the loaded Kernel.

Before going for and upgrade, just confirm the following.

Check whether the following files are present.

/lib/modules/*/modules.*map      depmod output
/proc/sys/kernel/hotplug         specifies hotplug program path
/sbin/hotplug                    hotplug program (default path name)
/etc/hotplug/*                   hotplug files
/etc/hotplug/NAME.agent          hotplug subsystem-specific agents
/etc/hotplug/NAME*               subsystem-specific files, for agents
/etc/hotplug/usb/                   depmod data for user-mode drivers
chmod 755 /etc/hotplug/*.agent
check tail -f /var/log/messages

Now try the following before kernel upgrade.

The issue should have been fixed by now. If the message is still coming up in /var/log/messages, you will need to go for Kernel upgrade.

Thank you guys..

How to change Mysql database directory to another partition in cPanel. /var patition full

January 7, 2010 on 1:09 pm | In Centos, Cpanel, Linux, Mysql | No Comments

Hi guys,

you might have faced the issue of /var partition gettting full regularly due to database directory. If you have a larger partition with free space, then it is possible to move the database directory to the larger partition.

Here are the steps

Switch off the database server while we are moving the databases.

/etc/rc.d/init.d/mysql stop

I am considering that I have enough space in /home partition. Here goes my new database data directory as /home/mysql

Now it is better to copy the database first, rather than move.

cp -pr /var/lib/mysql /home
mv /var/lib/mysql /var/lib/mysql-bk

We are copying the database to the new location since it is better to revert back the settings with minimum downtime, if anything goes wrong.

move to /tmp

cd /tmp
unlink mysql.sock
ln -s /home/mysql/mysql.sock /tmp/mysql.sock

Take a backup of /etc/my.cnf

Now edit /etc/my.cnf

vi /etc/my.cnf

add the line
datadir=/home/mysql

If the socket file is specified, comment it out.

Now move to /var/lib/mysql and create a symblink

ln -s /home/mysql /var/lib/mysql

(Please note that you don’t specify the socket file location in my.cnf since it causes issues with phpMyadmin)

For, cPanel server, edit the phpMyadmin configuration
take a backup of “/usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php”

edit this file /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php

add the following lines. If they already exist, edit as below.
(the connect_type usually exist at “tcp” change it to “socket”)

$cfg['Servers'][$i]['socket'] = ‘/home/mysql/mysql.sock’;
$cfg['Servers'][$i]['connect_type'] = ’socket’;

Now start the database server.

/etc/rc.d/ini.d/mysql start

If it starts fine, you are done. Check the database connections of your site.
You can now remove the directory /var/lib/mysql-bk

Suggestions, questions are welcome.

Starting sshd:PRNG is not seeded

March 23, 2009 on 4:51 am | In Centos, Linux | 2 Comments

You might have received this error when restarting SSHD.

#/etc/rc.d/init.d/sshd restart

Stopping sshd: [ OK ]

Starting sshd:PRNG is not seeded

[FAILED]

Here is the fix.

cd /dev/

./MAKEDEV generic

Now try starting SSH. :)

Error : tty device not owned by group ‘tty’

March 20, 2009 on 2:07 am | In Centos, Cpanel, Linux | No Comments

You might receive this error when your try to restart services in CPanel.

This is because the group of the tty devices are not “tty”

Change it to tty.

chgrp tty /dev/ttyp* /dev/ptyp* /dev/vcs* /dev/ptmx /dev/pts/0

as simple as that.:)

/usr/java/jdkX.X.X_Xbin/java: not found + Install Java on Linux servers

October 19, 2008 on 8:20 pm | In Apache, Centos, Cpanel, Installation, Linux | No Comments

In some cases, the 3rd parts scripts in server requires java to be installed. It may not work properly if the binary of java installed in the server. You need to install JavaSDK

So we present here the installation of Java in Linux server.

Its as easy as you run upcp in a Cpanel server.

Download the installation binary from Sun’s Java site

J2SE for Linux http://java.sun.com/j2se/1.4.2/download.html.( Download J2SE SDK)

You may need to register at the site and then they will send you the download link. Download the non-rpm binary

cd /usr/local/src/

wget thebinary

mv j2sdk-1_4_2_18-linux-i586.bin /usr/local/

cd /usr/local/

chmod 755 j2sdk-1_4_2_18-linux-i586.bin

./j2sdk-1_4_2_18-linux-i586.bin

Now setup the environment variables.

JAVA_HOME=/usr/local/j2sdk1.4.2_18

export JAVA_HOME

Also, you need to add these in the file /etc/profile.

JAVA_HOME=/usr/local/j2sdk1.4.2_18

export JAVA_HOME

How to install BFD

October 11, 2008 on 9:36 am | In APF, Centos, Linux | No Comments

What is BFD (Brute Force Detection)?


BFD is a modular shell script for parsing applicable logs and checking for authentication failures. There is not much complexity or detail to BFD yet and likewise it is very straight-forward in its installation, configuration and usage. The reason behind BFD is very simple; the fact there is little to no authentication and brute force auditing programs in the linux community that work in conjunction with a firewall or real-time facility to place bans. BFD is available at: http://www.rfxnetworks.com/bfd.php

This guide will show you how to install and configure BFD to protect your system from brute force hack attempts.

Requirements:
- You MUST have APF Firewall Installed before installing BFD – it works with APF and requires some APF files to operate.
- Root SSH access to your server


Login to your server through SSH and su to the root user.

1. cd /usr/local/src/.

Article provided by WebHostGear.com

2. wget http://www.rfxnetworks.com/downloads/bfd-current.tar.gz

3. tar -xvzf bfd-current.tar.gz

4. cd bfd-*

5. Run the install file: ./install.sh
You will receive a message saying it has been installed

.: BFD installed
Install path:    /usr/local/bfd
Config path:     /usr/local/bfd/conf.bfd
Executable path: /usr/local/sbin/bfd

6. Edit the configuration file: vi /usr/local/bfd/conf.bfd

7. Enable brute force hack attempt alerts:

Find: EMAIL_USR=”root” CHANGE TO: EMAIL_USR=”your@yourdomain.com”

Save the changes

8. Prevent locking yourself out!
vi /usr/local/bfd/ignore.hosts and add your own trusted IPs
Save the changes

9. Run the program!
/usr/local/sbin/bfd -s

10. Customize your applicatoins brute force configuration
Check out the rules directory in your /usr/local/bfd

Here you’ll find all kinds of pre-made rules for popular services such as Apache, and ProFTPD w00t!
If you have any clue about shell scripting you can customize them or create new rules for enhanced brute force detection and prevent attacks.

top: error while loading shared libraries: libncurses.so.4: cannot open shared object file: Error 40

May 14, 2008 on 3:44 am | In Centos, Linux | 1 Comment

This error is received when top command is executed.

top
top: error while loading shared libraries: libncurses.so.4: cannot open shared object file: Error 40

Fix.

locate libncurses.so.5

lib/libncurses.so.5
/usr/lib/libncurses.so.5
/usr/lib/libncurses.so.5.5

create symblinks
ln -s /lib/libncurses.so.5 /lib/libncurses.so.4
ln -s /usr/lib/libncurses.so.5 /usr/lib/libncurses.so.4

the location may be different. Just create symblink from libncurses.so.4 to libncurses.so.5

load the configuration
ldconfig

yum.conf for Centos 4.6

April 24, 2008 on 9:11 am | In Centos, Linux | No Comments

Here is the yum.conf entry for Centos 4.6. Copy all the lines below.

############################

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
installonlypkgs=kernel kernel-smp kernel-devel kernel-smp-devel kernel-largesmp kernel-largesmp-devel kernel-hugemem kernel-hugemem-devel
distroverpkg=centos-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1
plugins=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

############################

Here is the repo for Centos 4.4.

CentOS-Base.repo

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#released updates
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4