Howto manage qmail queue in Plesk linux

You can use third party programs like qmail-remove http://www.linuxmagic.com/opensource/qmail/qmail-remove to accomplish queue management in plesk control panel managed qmail

The Plesk control panel itself provides a modified version od qmHandle ( http://qmhandle.sourceforge.net/ )along with it that can be used with ease to manage the queue

To see the statistics of the queue:

/usr/local/psa/admin/bin/mailqueuemng -s
Messages in local queue:  0
Messages in remote queue: 0
Messages in todo queue:   0
Messages total:           0
Messages found:           0
Timestamp: 1215870834

From this you can see the status of qmails local,remote and todo list

If you wish to do a delivery of the queued messages now run the following command

/usr/local/psa/admin/bin/mailqueuemng -a

To list remote message queue:

/usr/local/psa/admin/bin/mailqueuemng -R

list local message queue:

/usr/local/psa/admin/bin/mailqueuemng -L

To list message queue:

list message queues -l

To delete messages with a particular pattern in the subject line

/usr/local/psa/admin/bin/mailqueuemng -S”text”

eg: /usr/local/psa/admin/bin/mailqueuemng -S”failure notice”

will delete all delivery failed messages

To delete all messages in the queue (Use with caution - possible data loss )

/usr/local/psa/admin/bin/mailqueuemng -D

Posted under hosting, plesk, qmail

This post was written by Anoop Alias on July 12, 2008

Tags: , ,

Install ffmpeg with amr-nb and amr-wb support

ffmpeg is a popular audio/video encoder and decoder . If you are planning to roll out a website that does video conversion like the popular youtube this document is for you . Now if you allow your users to upload content shot using mobile phones inoder to decode the same you may need AMR codec support which unfortunately is not shipped with ffmpeg binary packages available on the internet as this is a proprietary software and the license does not allow you to distribute any software that use this codec!. So what we do is compile these codec support into ffmpeg by grabbing the ffmpeg sources and compiling and installing the various external codecs

From the ffmpeg FAQ : FFmpeg can be hooked up with a number of external libraries to add support for more formats. None of them are used by default, their use has to be explicitly requested by passing the appropriate flags to `./configure’.

Here is the full configure options

neutron:~# ffmpeg -v
FFmpeg version SVN-r14147, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: –enable-shared –enable-gpl –enable-nonfree –enable-liba52 –enable-liba52bin –enable-libamr-nb –enable-libamr-wb –enable-libfaac –enable-libfaad –enable-libfaadbin –enable-libgsm –enable-libmp3lame –enable-libtheora
libavutil version: 49.7.0
libavcodec version: 51.60.0
libavformat version: 52.17.0
libavdevice version: 52.0.0
built on Jul 11 2008 06:00:59, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Here is the step by step instruction to accomplish this configuration

Since the libraries are installed while compiling from source to /usr/local/lib ; we must include this in the linux loaders config file

neutron:~# vi /etc/ld.so.conf.d/usrlocal.conf

and add the following line in it

neutron:~# cat /etc/ld.so.conf.d/usrlocal.conf
/usr/local/lib
neutron:~#

1.Now you must download and install AMR codec libraries from

http://www.penguin.cz/~utx/amr

download amrnb ,amrwb and untar it

you must run

./configure && make && make install

inside the source directory inoder to install the amr(nb and wb) header files in /usr/local/include which is required by ffmpeg

!Please note that you do not have to install the codes from 3gp.org as this will be automatically downloaded in amr installation

2. Now you must download and nstall FAAC and FAAD2 from

http://www.audiocoding.com/downloads.html

And compile them in the same way

inside the source directory you must run

./bootstrap && ./configure && make && make install

3.Download and install liba52

http://liba52.sourceforge.net/downloads.html

install it in the same way using the following commands inside the source

./configure && make && make install

4.Now you have to install LAME

you can download the source from http://lame.sourceforge.net/index.php

instal lit using

./configure && make && make install

5.I needed the theora development libraries which was available in my apt repository.You can do a

apt-cache search theora or yum search theora according to the distribution you use

In debian sarge the folling command should be fine

apt-get install libtheora-dev

Done !.now its time to get ffmpeg sources. you can get the same from

http://lame.sourceforge.net/index.php . Please note that ffmpeg does not have a “official release”.So you must either checkout ffmpeg from svn or use the daily snapshot available at

http://ffmpeg.mplayerhq.hu/download.html

Untar the sources and cd to the source directory and run the following commands

./configure –enable-shared –enable-gpl –enable-nonfree –enable-liba52 –enable-liba52bin –enable-libamr-nb –enable-libamr-wb –enable-libfaac –enable-libfaad –enable-libfaadbin –enable-libgsm –enable-libmp3lame –enable-libtheora

make

make install

If everything goes well you must now have ffmpeg installed.If there is error check the file configure.err in the ffmpeg source directory for the cause of the error

Now as a final step you must check if all shared libraries are loaded fine

You must run the following commands to check this

neutron:~# which ffmpeg
/usr/local/bin/ffmpeg
neutron:~# ldd /usr/local/bin/ffmpeg
linux-gate.so.1 => (0×001b2000)
libavdevice.so.52 => /usr/local/lib/libavdevice.so.52 (0×005e2000)
libavformat.so.52 => /usr/local/lib/libavformat.so.52 (0×009a4000)
libavcodec.so.51 => /usr/local/lib/libavcodec.so.51 (0×00a43000)
libavutil.so.49 => /usr/local/lib/libavutil.so.49 (0×00110000)
libm.so.6 => /lib/tls/libm.so.6 (0×0011f000)
libc.so.6 => /lib/tls/libc.so.6 (0×007c7000)
libz.so.1 => /usr/lib/libz.so.1 (0×0026d000)
libdl.so.2 => /lib/tls/libdl.so.2 (0×00649000)
libamrnb.so.3 => /usr/local/lib/libamrnb.so.3 (0×00144000)
libamrwb.so.3 => /usr/local/lib/libamrwb.so.3 (0×00180000)
libfaac.so.0 => /usr/local/lib/libfaac.so.0 (0×001b3000)
libgsm.so.1 => /usr/lib/libgsm.so.1 (0×00582000)
libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0×001c4000)
libtheora.so.0 => /usr/lib/libtheora.so.0 (0×00281000)
/lib/ld-linux.so.2 (0×00737000)
libogg.so.0 => /usr/lib/libogg.so.0 (0×007ad000)
neutron:~#

Sometimes you will receive ” cannot load shared library ” error while running ffmpeg or library “no found” in the ldd output.This is caused because you have not created/ updates the necessary links and cache (for use by the run-time linker, ld.so) to the most recent shared libraries

you can fix this error simply by running the following command

neutron:~# ldconfig

Please do not forget to include /usr/local/lib in your ld.so.conf which i have mentioned at the start of this article by editing the file /etc/ld.so.conf.d/usrlocal.conf. you can also add /usr/local/lib directly to ld.so.conf in older versions of GNU/Linux that does not use the /etc/ld.so.conf.d/ directory scheme

Hope you enjoyed this article..If you need me to install this for you just send me a mail at anoop[at]gnusys.net

WARNING:

libamr is copyrighted without any sort of license grant. This means that you can use it if you legally obtained it but you are not allowed to redistribute it in any way. Any FFmpeg binaries with libamr support you create are non-free and unredistributable!

REFERENCES:

http://ffmpeg.mplayerhq.hu/general.html#SEC1

Posted under ffmpeg, hosting

This post was written by Anoop Alias on July 11, 2008

Tags: ,

how important is latency in hosting

Latency is network delay for a packet to reach from its source to the destination

Inoder for you to understand this ; i am comparing the time taken for an ICMP echo (ping) packet to 2 destinations that are geographically seperated

The source IP is located at KOCHI,INDIA (BSNL National Internet Bachbone) and the destination 1 is a server located at INDIAn subcontinent ,whereas destination 2 is a server located in the United States

Computer located in INDIA

————–

anoop@ubuntu:~$ ping 124.153.106.142
PING mobshare.in (124.153.106.142) 56(84) bytes of data.
64 bytes from 124.153.106.142: icmp_seq=1 ttl=56 time=84.7 ms
64 bytes from 124.153.106.142: icmp_seq=2 ttl=56 time=84.0 ms
64 bytes from 124.153.106.142: icmp_seq=3 ttl=56 time=83.2 ms
————–

Computer located in US

————-

anoop@ubuntu:~$ ping gnusys.net
PING gnusys.net (209.40.199.67) 56(84) bytes of data.
64 bytes from neutron.gnusys.net (209.40.199.67): icmp_seq=1 ttl=44 time=283 ms
64 bytes from neutron.gnusys.net (209.40.199.67): icmp_seq=2 ttl=44 time=284 ms
64 bytes from neutron.gnusys.net (209.40.199.67): icmp_seq=3 ttl=44 time=282 ms
————-

You can clearly see the difference!

Does latency matter to you? - the answer to the question depends on the type of application that you host.

For example if you are hosting a VoIP server;latency is very important to you and you must always choose a host with low latency. If you have a technology blog like what i have ..latency is not a big deal and since we have more internet users in developed countries like US;there is also a possibility that i have more visitors from US which makes hosting in the US a more better option.

Usually bandwidth and other internet resources are a lot cheaper in US and other developed countries and so money wise also hosting in the US is a good option

Another good option is to select a web-host tat have a CDN (content delivery network ) that is geographically dispersed

Posted under hosting

This post was written by Anoop Alias on June 30, 2008

Tags:

parallels plesk extras; script to extract plesk login and password

This script is useful in extracting the Parallels Plesk control panel client/reseller login ,password and email address.An quick script to aid in troubleshooting plesk login problems

wget http://gnusys.net/downloads/psaclientpass.bash

bash psaclientpass.bash

Posted under hosting, plesk

This post was written by Anoop Alias on June 17, 2008

Tags: ,

parallels plesk extras; script to extract ftp password from psa

This script comes handy to anyone who wants to extract the passwords for ftp users for a plesk domain.

OfCourse the username can be obtained from the Plesk control panel

The script also retrieves the home directory to which the user logs in when he authenticates successfully to the ftp daemon

wget http://gnusys.net/downloads/psaftppass.bash

bash  psaftppass.bash

Posted under hosting, plesk

This post was written by Anoop Alias on June 17, 2008

Tags: ,

Parallels plesk extra;script to extract database details of a client

The following script is very useful if you are planning to migrate or sync all database of a paticular reseller.I made it to aid in database recovery of a client from a failed Plesk Migration Manager (PMM) migration

Script has been tested to work on Parallels Plesk upto version 8.3.The output of the script is self explanatory

wget http://gnusys.net/downloads/psadbdetails.bash

bash psadbdetails.bash

Posted under hosting, plesk

This post was written by Anoop Alias on June 17, 2008

Tags: ,

cpanel script to extract reseller users and domain names

This bash script is very useful if you are planning to do cpanel account migrations purely from the commandline and automate the process of the migration . This scripts extracts the names of all reseller users in the server to the file

/opt/reseller_list

and correspondingly for all users in this list extract the cpanel usernames to the file /opt/reseller_users_<resellername>

and all domains under the reseller to

/opt/reseller_domains_<resellername>

Once done with your use you can clean out the files created by the script using the single command

rm -f /opt/reseller*

As always this script is not fool proof but was perfected after several tries of a very large account migration process.You are welcome to send modifications and ideas to enhance this script

*This script can be run on successfully only on Cpanel servers and is tested upto Cpanel version 11

wget http://gnusys.net/downloads/cpanelresellerdetails.bash

bash cpanelresellerdetails.bash

Posted under cpanel, hosting

This post was written by Anoop Alias on May 25, 2008

Tags: ,