Showing posts with label cpanel. Show all posts
Showing posts with label cpanel. Show all posts

Wednesday, June 1, 2011

ClamAV Error On CPanel

Solution :

1. Install cpanel pro dahulu
2. baru install clamav
3. http://forums.cpanel.net/f5/cron-root-usr-bin-freshclam-quiet-no-warnings-117753.html#post681037

I went into ssh and did the following:

cd /usr/local/cpanel/modules-install/

ls -al|grep clam

cd clamavconnector-Linux-x86_64 #(your's may be different)

sh install

ls -al /usr/bin/freshclam

When I ran the installer from command line, I noticed it took quite a bit longer to run then it did in whm, and everything was installed correctly.

It's a bit early, so I've not investigated any further, but my hunch is that is has something to do with the path difference in shell over whm.

Hope this helps someone else too.

LINUX Security :

1. http://www.linux.org/docs/ldp/howto/Postfix-Cyrus-Web-cyradm-HOWTO/installing-anti-spam.html

2. http://geobaby.in

3. http://mysql-apache-php.com/basic-linux-security.htm

Load Monitoring Script For Linux #1

#!/bin/bash
#
# Script to notify admin user if Linux,FreeBSD load crossed certain limit
# It will send an email notification to admin.
#
# Copyright 2005 (c) nixCraft project
# This is free script under GNU GPL version 2.0 or above.
# Support/FeedBack/comment : http://cyberciti.biz/fb/
# Tested os:
# * RedHat Linux
# * Debain Linux
# * FreeBSD
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------

# Set up limit below
NOTIFY="4.0"

# admin user email id
EMAIL="yourmail@mail.com"

# Subject for email
SUBJECT="Alert $(hostname) Load Average Exceeded The Limit"

# -----------------------------------------------------------------

# Os Specifc tweaks do not change anything below ;)
OS="$(uname)"
TRUE="1"
if [ "$OS" == "FreeBSD" ]; then
TEMPFILE="$(mktemp /tmp/$(basename $0).tmp.XXX)"
FTEXT='load averages:'
elif [ "$OS" == "Linux" ]; then
TEMPFILE="$(mktemp)"
FTEXT='load average:'
fi

# get first 5 min load
F5M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f1)"
# 10 min
F10M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f2)"
# 15 min
F15M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f3)"

#Save the current running processes in a file
/bin/ps -auxf >> /root/ps_output

# mail message
# keep it short coz we may send it to page or as an short message (SMS)
echo "Load average Crossed allowed limit $NOTIFY." >> $TEMPFILE
echo "Hostname: $(hostname)" >> $TEMPFILE
echo "Local Date & Time : $(date)" >> $TEMPFILE
echo "Load Average :" >> $TEMPFILE
echo -e "\n" >> $TEMPFILE
echo "$(top -n 1 -b|head -20)" >> $TEMPFILE

# Look if it crossed limit
# compare it with last 15 min load average
RESULT=$(echo "$F15M > $NOTIFY" | bc)

# if so send an email
if [ "$RESULT" == "$TRUE" ]; then
mail -s "$SUBJECT" "$EMAIL" < $TEMPFILE
fi

# remove file
rm -f $TEMPFILE

Cpanel Logs

Log file is a file which stores all the information of all files that are accessed and they also have errors which help a system administrator to troubleshoot issues and fixing them. Few log file locations can be found below:

Apache web server :
/usr/local/apache/logs/access_log
/usr/local/apache/logs/error_log
/usr/local/apache/domlogs/domain.com

MySQL database server :
/var/lib/mysql/server.hostname.com.err

Exim mail server :
/var/log/exim_mainlog
/var/log/exim_paniclog
/var/log/exim_rejectlog

Courier-IMAP :
/var/log/maillog

cPanel control panel :
/usr/local/cpanel/logs/error_log
/usr/local/cpanel/logs/access_log
/usr/local/cpanel/logs/license_log
/usr/local/cpanel/logs/login_log
path: /usr/local/cpanel/logs/stats_log

FTP server :
/var/log/messages
/var/log/xferlog

System logs :
/var/log/messages
/var/log/boot.log
/var/log/cron
/var/log/dmesg

Security logs :
/var/log/secure
/var/log/messagesd