Friday, July 20, 2012

CloudLinux and r1soft

If your server is running r1soft after upgrading your kernel you need to install r1soft module using the command  r1soft-cki

If you are having difficulties to run r1soft-cki.

[~]# /etc/init.d/buagent status
/etc/init.d/buagent status: buagent (no pid file) not running
root@hyrule [~]# /etc/init.d/buagent restart

/etc/init.d/buagent restart: buagent not running, trying to start
/etc/init.d/buagent restart: buagent could not be started
root@hyrule [~]# r1soft-cki
Checking for binary module
Waiting                       |         
No binary module found
Gathering kernel information
Gathering kernel information complete.
Creating kernel headers package
Checking '/lib/modules/2.6.18-408.el5.lve0.8.61.1/source/' for kernel headers
Checking '/usr/src/kernels/2.6.18-408.el5.lve0.8.61.1-x86_64/' for kernel headers
Checking '/lib/modules/2.6.18-408.el5.lve0.8.61.1/build/' for kernel headers
Unable to find a valid source directory.
Please install the kernel headers for your operating system.

root@hyrule [~]# uname -a
Linux server.ajeeshbkannan.com 2.6.18-408.el5.lve0.8.61.1 #1 SMP Wed Apr 18 07:47:15 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

Here you can see iam using  el5.lve0.8.61.1

So the solution is
 [~]# yum install kernel-devel
Installing:
 kernel-devel                        x86_64                        2.6.18-408.el5.lve0.8.61.1                          cloudlinux-x86_64-server-5                        5.4 M

After this

[~]# r1soft-cki

Compressing...
uploading kernel package                                                                                                                      99% 4879KB   4.8MB/s   00:00 ETA
Starting module build...
Complete.                               
Saving kernel module to '/lib/modules/buagent/backupdriver-cki-2.6.18-408.el5.lve0.8.61.1.ko'
Kernel module is now installed.




And if your kernel is PAE

Then yum install kernel-PAE-devel






Monday, July 16, 2012

Discard spam emails in Exim

no spam!no spam! (Photo credit: Wikipedia)

We can discard spam emails from and to our server(Both incoming and outgoing emails). Using this we can stop spam emails like citibank, paypal, hsbc any spamming activities.
Login to your cpanel server.
Main >> Service Configuration >> Exim Configuration Manager
Under Filter Section
/etc/cpanel_exim_system_filter_ajeesh by default this will be /etc/cpanel_exim_system_filter but this filter will be gone once you do a exim upgrade. So that I have used a custom name.
 
Exim filters based on Subject:

if
$header_subject: contains "viagra"
then
seen finish
endif
-------
if
$header_subject: contains "***SPAM***"
then
seen finish
endif
============
Exim Filter Based on to Address
if (
$received_protocol is "local" or
$received_protocol is "esmtpa"
) and (
$header_from contains "@ebay.co.uk")
then
seen finish
endif
-------
if (
$received_protocol is "local" or
$received_protocol is "esmtpa"
) and (
$header_from contains "@paypal.com")
then
seen finish
endif  
---------------




Enhanced by Zemanta

Semaphore issues

When we get a semaphore error while trying to restart apache like the following

critical_create(): semget() failed: No space left on device.

 # ipcs

From here you can see the sephore process running on the server.
 You will get a output like this:
Message Queues:
T ID KEY MODE OWNER GROUP

Semaphores:
T ID KEY MODE OWNER GROUP
s 524288 0 --rw------- apache apache
s 9240577 0 --rw------- apache apache
s 6684674 0 --rw------- apache apache
s 393219 0 --rw------- apache apache

If apache's not up and running, you can "ipcrm" them like this:
ipcrm -s 524288
Or execute a loop to ipcrm all apache
for i in `ipcs -s | grep apache | awk '{ print $2; }'`; do ipcrm -s $i; done

To increase semaphore value
sysctl kernel.sem //check current value
echo "kernel.sem=500 128000 64 256" >>/etc/sysctl.conf // append settings #pacifichost example
sysctl -f /etc/sysctl.conf //to load the new parameters

cagefs - Image magick module error

Image magick module was attempted to be installed on a cpanel server as usual,but it didn't show up on the phpinfo page and error log showed as.
++++++++++++
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/imagick.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
++++++++++++

Fix:-
cagefsctl --update

So moral of the story is to run cagefsctl --update after any new php module installation for it to take effect in a cpanel server with cagefs support

Monday, July 2, 2012

Downloading jdk package

We are facing downloading issues for jdk packages from oracle web site

http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html

The downloaded file should be in the form of some html file and which is not useful for our installation.

Example:
root@server [/usr/local/src]# wget http://download.oracle.com/otn-pub/java/jdk/6u33-b03/jdk-6u33-linux-x64.bin

100%[====================================================================================================================>] 5,307       --.-K/s   in 0s     

2012-07-01 14:57:24 (298 MB/s) - `download-fail-1505220.html' saved [5307/5307]

Here you can see that our downloaded file is a .html file.

Oracle web site is asking for license agreement and we need to confirm this , then only we can upload the original file to our server.

Here is the steps to direct jdk package from oracle web site to your server.

1.  root@server [/usr/local/src]# wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-7u3-download-1501626.html;" http://download.oracle.com/otn-pub/java/jdk/6u33-b03/jdk-6u33-linux-x64.bin


Saving to: `jdk-6u33-linux-x64.bin?AuthParam=1341167305_9b2519bdbfdd528c07670b1edf6b1762'

100%[====================================================================================================================>] 72,029,591   144K/s   in 10m 25s

2012-07-01 13:37:27 (113 KB/s) - `jdk-6u33-linux-x64.bin?AuthParam=1341167305_9b2519bdbfdd528c07670b1edf6b1762' saved [72029591/72029591]

2. root@server [/usr/local/src]# mv jdk-6u33-linux-x64.bin\?AuthParam\=1341167305_9b2519bdbfdd528c07670b1edf6b1762 jdk-6u33-linux-x64.bin


Thats it now you have downloaded the latest jdk file from oracle web site to your server.

 wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com"    ----> without ssl