LiFe iS a bIt craZy……

Posted: April 28, 2010 in Uncategorized

Are you searching for a free hosting??

  • Love begins with a smile, grows with a kiss, ends with a tear. When you were born, you were crying and everyone around you was smiling. Live your life so that when you die,you’re the one smiling and everyone around you is crying…!! LiFe iS a bIt craZy…

CO.CC:Free Domain



//

Many-a-times we come across situations, where while trying to remove a mail from the mailqueue, a “Message lock error” will be generated. Considering Exim as the MTA running in the server, the generated error will be of the form :

————–
# exim -Mrm 1PN63s-0005r4-Oh
Message 1PN63s-0005r4-Oh is locked
————–

This happens because the mail id ‘1PN63s-0005r4-Oh’ is being processed by an exim process. As such it is required to first kill the corresponding exim process and then removing the mail from mail queue.

You can follow the below given steps to get rid of the such a situation:

1. Find the process id of the exim process which is presently dealing with the mail.

For example, the processes processing mail with mail id ‘1PN63s-0005r4-Oh’ can be obtained using command ‘ps aux‘, as shown below:

——————
# ps aux | grep 1PN63s-0005r4-Oh

root     22547  0.0  0.1  11608  2988 ?        S    16:54   0:00 /usr/sbin/exim -Mc 1PN63s-0005r4-Oh
exim     22548  0.0  0.0  11608  1540 ?        S    16:54   0:00 /usr/sbin/exim -Mc 1PN63s-0005r4-Oh
root     22774  0.0  0.0   3916   680 pts/0    R+   16:55   0:00 grep 1PN63s-0005r4-Oh
——————

3. Kill the corresponding exim process id using command ‘kill -9 id‘:

——————
# kill -9 22548
——————

Now try to remove the mail :

——————
# exim -Mrm 1PN63s-0005r4-Oh
Message 1PN63s-0005r4-Oh has been removed
——————

A bright smile will enlighten your face 😉 .

–soumi

Kernel Compilation

Posted: December 1, 2010 in Uncategorized

Many of us may be thinking, if already a machine is running with out any problem, then why is there need of compiling a kernel ??? . For them I hope these three points are more than enough to understand the importance of kernel compilation ;):

1. Your machine may be having some hardware for which there is no corresponding hardware module in the distribution CD.

2. The kernel at present in your server may be having some bugs, which would have been solved in a revision of the operating system.

3. You may want to install some new software in your machine which requires a newer version of operating system.

Clear right 😉 .

Let us assume that the present kernel version is 2.6.28.7. This can be obtained from command ‘uname -r

———–
$ uname -r
2.6.28.7
———–

A snippet of file  ‘/boot/grub/meny.lst’ [or /etc/grub.conf] before any changes are made in the server:

———————————————-
# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS 5.2
root (hd0,0)
kernel /boot/vmlinuz ro root=/dev/sda1
initrd /boot/initrd.img
———————————————-

The following are the steps to compile kernel:

1. Login to the machine [or server] with root privilege.

2. Download the latest kernel version:

For CentOS you can get the latest kernel versions from link ‘http://www.kernel.org/pub/linux/kernel/v2.6/’ [let us assume that we need to set kernel as 2.6.32.26, so download the corresponding tar file] :

$ cd /usr/src

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.26.tar.bz2

3. Untar the downloaded file:

$ tar -xjvf linux-2.6.32.26.tar.bz2

4. Change the directory to the untarred folder and do the following in command prompt:

$ cd linux-2.6.32.26

$ make menuconfig — this will poop up a blue screen which lists the kernel modules. Select the needed modules, save and exit.

$ make dep — this command builds the tree of interdependencies in the kernel sources. These dependencies may have been affected by the options you have choosen in the configure step.

$ make clean — purges any unwanted files left from the previous builds of the kernel.

$ make

$ make modules

$ make modules_install

Till now we have compiled kernel and kernel modules. Now it is required to install the kernel itself. Use following command to install kernel:

$ make install

After the above command is executed, the following changes will be depicted in server :

a.  Three new files will be created in /boot directory:

——————
* initrd-2.6.32.26.img
[is the initrd image corresponding to kernel 2.6.32.26]
* System.map-2.6.32.26
* vmlinuz-2.6.32.26
——————-

b. A new entry corresponding to new kernel will be added in /boot/grub/menu.lst [as shown below]:

———————————————-
# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32.26)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32.26 ro root=LABEL=/
initrd /boot/initrd-2.6.32.26.img

title CentOS 5.2
root (hd0,0)
kernel /boot/vmlinuz ro root=/dev/sda1
initrd /boot/initrd.img
———————————————-

Now change the value of ‘default’ in /boot/grub/menu.lst to 0, so that the kernel will boot from the new kernel.

Thus the finale /boot/grub/menu.lst will look like:

———————————————-
# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32.26)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32.26 ro root=LABEL=/
initrd /boot/initrd-2.6.32.26.img
title CentOS 5.2
root (hd0,0)
kernel /boot/vmlinuz ro root=/dev/sda1
initrd /boot/initrd.img
———————————————-

5. Reboot the machine.

———–
$ shutsown -r now
or
$ reboot
———–

6. When the server pings login to the server and find the kernel version using:

———–
$ uname -r
2.6.32.26
———–

Success !!! 😉 .

–soumi



Install RED5 on Centos 5.3

Posted: November 14, 2010 in Uncategorized
1) Download and Install Java

RED5 server depends on Java. CentOS 5.3 comes with OpenJDK 1.6 and install it using yum.

yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

Read the rest of this entry »

The following are the steps to upgrade ProFTPD to the latest version:

1. mkdir /usr/local/updatescript

2. cd /usr/local/updatescript

3. wget http://tools.web4host.net/update.script

4. chmod 755 update.script

5. ./update.script PROFTPMODCLAMAV

6. Check proftpd version:

$ proftpd -v

Thanks for the wonderful tips in link: http://www.web4host.net/forum/viewtopic.php?f=2&t=1

–soumi

A flaw has been identified in the popular ProFTPD FTP server. This flaw potentially allows unauthenticated attackers to compromise a server. The problem is caused by a buffer overflow in the pr_netio_telnet_gets() function for evaluating TELNET IAC sequences.

ProFTPD Bug Report: http://bugs.proftpd.org/show_bug.cgi?id=3521

Solution:

UPDATE ProFTPD TO THE LATEST VERSION [i.e. to version 1.3.3c].

–soumi

Installing phpSHIELD Loaders

Posted: November 8, 2010 in Uncategorized

Consider that phpSHIELD is to be installed in a linux 64-bit server with php version 5.2.

* Steps to install phpSHIELD Loader:

1. $  cd /usr/local/src

2. Download the appropriate phpSHIELD Loader from ‘http://www.phpshield.com/loaders/index.php‘:

$ wget http://phpshield.com/loaders/phpshield.loaders.linux-64.zip

In case of 32-bit servers, use the following command:

$ wget http://phpshield.com/loaders/phpshield.loaders.linux.zip

3. Unzip the downloaded file:

$ unzip phpshield.loaders.linux-64.zip

4. Find the phpshield loader corresponding to php version in the server. In this case  phpshield loader will be phpshield.5.2.lin.

5. Copy the loader file to php extension_dir location. Php extension_dir can be obtained from command:

$ php -i | grep extension_dir

6. Add the following in php.ini file:

extension=phpshield.5.2.lin

You can obtain php.ini file being used in server using the following command:

$ php -i | grep php.ini

7. Finally restart httpd service.

$ /etc/init.d/httpd restart

* Checking Methods:

1. Search for phpSHIELD in phpinfo page [phpSHIED should be present in the page]

2. Use  can also use the following command:

$ php -i | grep phpshield

–soumi

You can use the following MSSQL query to shrink the database log file:

USE “database”;
Read the rest of this entry »

Redirecting http to https

Posted: October 31, 2010 in Uncategorized

You can simply add the following rewrite rule in the .htaccess file present in document root of the site for this redirection. Read the rest of this entry »

1. Login to the windows server as administrator.

2. Go to Start >> Run >> mmc. Then you will get a new console.

Read the rest of this entry »

Split and join files in linux

Posted: October 30, 2010 in Uncategorized

Let’s see how to split and join files in linux:

Let us begin with an example. Consider a file “test.mkv” having size 10Mb. Read the rest of this entry »