Howto manage Mail queue in qmail using Qmhandle?

October 23, 2009    |   Posted by admin   |    Category: Plesk Management

Qmhandle is a 3rd party application to manage mail queue of Qmail. Though Qmail has it’s own commands but it’s worth using Qmhandle.

1) Download the package in a temporary directory:

# cd /usr/local/src
# wget http://sourceforge.net/projects/qmhandle/files/qmhandle-1.3/qmhandle-\
1.3.0/qmhandle-1.3.0.tar.gz/download

2) Unpack it and goto the directory

# tar -zxf qmhandle-1.3.0.tar.gz
# cd qmhandle-1.3.0

You will notice a “qmHandle” file inside the directory using which you can manage the Qmail mail queue.

1. To check the number of emails in the queue

 # ./qmHandle -s

2. Force Qmail to process the mail queue

 # ./qmHandle -a

3. List emails with all the details like, Subject, From and To address

 # ./qmHandle -l

4. List emails sorted by Subject, From address etc

 # ./qmHandle -l | grep Subject | sort
 # ./qmHandle -l | grep From | sort 

5. Delete all emails having a specific subject, for example ‘test’

 # ./qmHandle -Stest

6. Delete all messages

 # ./qmHandle -D

Note: The 1.3 version of Qmhandle have problems deleting emails, in such a case download an older version i.e. qmhandle-1.2.3 to delete the emails.

Comments Off on Howto manage Mail queue in qmail using Qmhandle?

/usr/bin/phpize /bin/sh: bad interpreter: Permission denied

October 21, 2009    |   Posted by admin   |    Category: Linux Administration

Error Message:

/usr/bin/phpize: /tmp/tmpjMvBZg/package.x.x/build/shtool: /bin/sh: bad interpreter: Permission denied

If you receive the above error message while installing a package using “pecl”, it meant that the /tmp partition is mounted in “noexec” mode and that you do not have permissions to execute anything under /tmp partition.

Execute the “mount” command and you will see something like:

root@server [~]# mount
/dev/sdax on /tmp type ext3 (rw,noexec,nosuid)

To mount the /tmp partition in rw mode, execute:

root@server [~]# mount -o remount rw /tmp

Now, you can execute the “pecl” command to install the package you like. Once done, you can remount /tmp with noexec mode again:

root@server [~]# mount -o remount rw,noexec,nosuid /tmp

Howto: Install ImageMagick on Plesk

October 21, 2009    |   Posted by admin   |    Category: Plesk Management

How to install ImageMagick on Linux/Plesk server? Follow the below steps to install ImageMagick on a Plesk server. Login to your server as root and execute the following commands:

1. Install “ImageMagick” package via YUM.

yum install ImageMagick

2. Now install “ImageMagick-devel”

yum install ImageMagick-devel

3. Install “php-pear” required for “pecl”. It will install and compile ImageMagick with PHP for you.

yum install php-pear

4. Now, you need to install ImageMagick using pecl

pecl install imagick

A imagick.so file will be created under /usr/lib/php/modules/ directory. Now, edit the php configuration file /etc/php.ini and add the following line after the “extension_dir” directive

extension = “imagick.so”

Save the file and restart the httpd service. That is it. You can verify using the command:

php -i | grep imagick

Comments Off on Howto: Install ImageMagick on Plesk

ODBC support on a cPanel server

October 19, 2009    |   Posted by admin   |    Category: cPanel Management

How to compile unix odbc on a cPanel server? On a cPanel server, the /scripts/easyapache script almost provides all the modules that are required to host the websites but the modules such as odbc has to be installed manually. You first have to install the devel packages for unixodbc, then add a line in rawopts file and rebuild Apache+PHP. That is it.

1. Install the UnixODBC devel packages:

yum install unixODBC unixODBC-devel

2. You now need to create a file “all_php5” to add a line to enable odbc so that apache build will pick it up from there. File all_php5 is for PHP5 and all_php4 is for PHP4.

pico /var/cpanel/easy/apache/rawopts/all_php5

3. Add the following line:

--with-unixODBC=/usr

4. Rebuild Apache/PHP using the “easyapache” script and the above file will be picked up automatically:

/scripts/easyapache

Once the compilation completes, you should have odbc module compiled with PHP. You can check the module either using a phpinfo() file OR through shell by executing:

php -i | grep odbc

-bash: locate: command not found

October 19, 2009    |   Posted by admin   |    Category: Linux Administration

Error Message:

[root@server ~]# locate filename
-bash: locate: command not found

You may receive the above error message while searching a file using locate command and the error indicates that the package “slocate” required for the locate command is not installed. To install the package, execute:

yum -y install slocate

You will now be able to use the locate command but before that, execute the command “updatedb” so that the locate database is updated.

Comments Off on -bash: locate: command not found