Qmail supervise not running.

Problem:-

[superman@mail ~]# qmailctl start
Starting qmail…

qmail-send supervise not running
qmail-smtpd supervise not running
qmail-pop3d supervise not running

Solution :-

[superman@mail ~]# svscanboot &

[superman@mail ~]# qmailctl start

Advertisements
Posted in Qmail | Leave a comment

Common Apache compilation problems on Linux servers

1) “/usr/lib/libexpat.so: could not read symbols: File in wrong format
Solutions :
#make clean
# mv srclib/apr-util/configure srclib/apr-util/configure_old —- only in case of 64 bit os)
# mv configure configure_old
# ./buildconf
Run config again.

2) “configure: error: mod_deflate has been requested but can not be built due to prerequisite failures”
Solutions :
For redhat users # yum install zlib zlib-devel
For ubuntu users # aptitude install zlibc zlib1g-dev

3)”no SSL-C headers found configure: error: …No recognized SSL/TLS toolkit detected”        (This error occurs in case you added “–enable–ssl” in config.

Solutions :
For redhat users # yum install openssl openssl-devel
For ubuntu users # apt-get install libssl-dev

Posted in LAMP | Leave a comment

Common PHP compilation problems on Linux servers

1) Configure: error: xml2-config not found. Please check your libxml2 installation.

Solutions :

Quote:
#yum install libxml2 libxml2-devel (For Redhat & Fedora)# aptitude install libxml2-dev      (For ubuntu)

2) Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>

Solutions :

Quote:
#yum install openssl openssl-devel

3) Configure: error: Please reinstall the BZip2 distribution

Solutions :

Quote:
# yum install bzip2 bzip2-devel

4) Configure: error: Please reinstall the libcurl distribution –
easy.h should be in <curl-dir>/include/curl/

Solutions :

Quote:
# yum install curl curl-devel   (For Redhat & Fedora)# install libcurl4-gnutls-dev    (For Ubuntu)

5) Configure: error: libjpeg.(also) not found.

Solutions :

Quote:
# yum install libjpeg libjpeg-devel

6) Configure: error: libpng.(also) not found.

Solutions :

Quote:
# yum install libpng libpng-devel# apt-get install libpng12 libpng12-devel (For Ubuntu)

7) Configure: error: freetype.h not found.
Solutions :

Quote:
#yum install freetype-devel

8) Configure: error: Unable to locate gmp.h

Solutions :

Quote:
# yum install gmp-devel

9) Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!

Solutions :

Quote:
# yum install mysql-devel            (For Redhat & Fedora)# apt-get install libmysql++-dev      (For Ubuntu)

10) Configure: error: Please reinstall the ncurses distribution

Solutions :

Quote:
# yum install ncurses ncurses-devel

11) Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!

Solutions :

Quote:
# yum install unixODBC-devel

12) Configure: error: Cannot find pspell

Solutions :

Quote:
# yum install pspell-devel

13) configure: error: mcrypt.h not found. Please reinstall libmcrypt.

Solutions :

Quote:
# yum install libmcrypt libmcrypt-devel    (For Redhat & Fedora)# apt-get install libmcrypt-dev

14) Configure: error: snmp.h not found. Check your SNMP installation.

Solutions :

Quote:
# yum install net-snmp net-snmp-devel
Posted in LAMP | 3 Comments

Search & Delete using find command

Scenario:

I have configure log rotate on my apache access logs. It make zip file on end of day. Day by day its increasing n I don’t have space to keep all logs.

I want to delete 7 days old zip files from that folder.

# cd /usr/local/apache2/logs/

# find . -name “*.zip” -mtime +7| xargs rm -fv

Explanation of command.

find . — means find in present directory

-name “*.zip” — find files which ends with .zip extension

-mtime +7 —means search files before last 7 days

| xargs rm -fv — this means it will get the output of find command & process it using rm command

Posted in Linux_Tips_n_Tricks | Leave a comment

Libexpat Problem with Apache2 on 64 bit OS.

Libexpat Problem with Apache2 on 64 bit OS.

If you get the following error while installing Apache2 on 64bit linux.

/usr/lib/libexpat.so: could not read symbols: File in wrong format

Solution:

1. Delete file ‘srclib/apr-util/configure’ under ‘httpd-2.0.61’

2. Delete ‘configure’ file under ‘httpd-2.0.61’

3. rebuild the configure scripts, run

./buildconf

4. Now you have a 64 bit enabled apr-util. You have to specify it when configuring apache

e.g.
[root@superbox]#  ./configure –enable-lib64

make

make install

Your apache is ready to start….

Author: By me myself…….

Posted in LAMP | Leave a comment

How to delete or remove your qmail server queue?

Different Technics how to delete or remove your qmail server queue?

Qmail-Remove

This is definitely my first choice.Qmail-Remove will remove messages containing a particular string from your Qmail queue.

Mails are *not* deleted from the queue! They are only stored, temporarily, in $qmail-queue/yanked/, where you can view them individually and restore them back to the queue manually. There is currently no support for restoring them automatically.

By default, Qmail-Remove assumes that your Qmail queue is stored in /var/qmail/queue, but this can be changed with a command line option. Similarly, Qmail-Remove assumes that your queue “split” is 23 by default, among other things.

If you want to check your qmail queue using the following command

# /var/qmail/bin/qmail-qstat

Output looks like

messages in queue: 567154
messages in queue but not yet preprocessed: 3

Install Qmail-Remove

First you need to download latest version from here current version is Qmail-Remove 0.95

Download using the following command

#wget http://www.linuxmagic.com/opensource/qmail/qmail-remove/qmail-remove-0.95.tar.gz

Now you have qmail-remove-0.95.tar.gz file and now you need to extract using the following command

#tar -zxvf qmail-remove-0.95.tar.gz

Now you should have qmail-remove-0.95 folder go in to the directory and run the following commands

#make

#make install

This will complete the installation.

Now you need to create a directory named “yanked” in the qmail queue directory you intend to use before using this program.

#mkdir /var/qmail/queue/yanked

Using qmail-remove

Syntax

qmail-remove [options]

Available options

-e use extended POSIX regular expressions

-h, -? this help message

-i search case insensitively [default: case sensitive]

-n limit our search to the first bytes of each file

-p specify the pattern to search for

-q specify the base qmail queue dir [default: /var/qmail/queue]

-r actually remove files, without this we’ll only print them

-s specify your conf-split value if non-standard [default: 23]

-v increase verbosity (can be used more than once)

-y directory to put files yanked from the queue [default: /yanked]

-X modify timestamp on matching files, to make qmail expire mail is the number of seconds we want to move the file into the past.specifying a value of 0 causes this to default to (604800)

-x modify timestamp on matching files, to make qmail expire mail is a date/time string in the format of output of the “date” program.

Examples for qmail-remove

Before doing any thing related to qmail queue you need to stop the qmail service using the following command

#/etc/init.d/qmail stop

To delete mails from Que,

#qmail-remove -r -p

# qmail-remove -r -p gtre.ac.net

324001: yes
moved mess/0/324001 to yanked/324001.mess
moved remote/0/324001 to yanked/324001.remote
moved info/0/324001 to yanked/324001.info
324024: yes
moved mess/0/324024 to yanked/324024.mess
moved remote/0/324024 to yanked/324024.remote
moved info/0/324024 to yanked/324024.info

This will remove all emails in que with “gtre.ac.net” in it and place it in /var/qmail/queue/yanked folder.

qmhandle

qmHandle is a simple program which allows you to view and manage the qmail message queue.

qmHandle Advantages

You can read the qmail queue, like you do with the qmail-qread program.

However, the output of this program is improved over qmail-qread, with the output of the message subjects and color capabilities;

You can print queue statistics, like qmail-qstat, with color capabilities;

You can view a message in the queue;

You can remove one or more messages from the queue;

Written in Perl, and therefore easily customizable and truly multiplatform.

Install qmhandle

First you need to download latest version from here and the current version is qmhandle-1.2.0

Download using the following command

#wget http://mesh.dl.sourceforge.net/sourceforge/qmhandle/qmhandle-1.2.0.tar.gz

Now you have qmhandle-1.2.0.tar.gz file you need to extract using the following command

#tar xzvf qmhandle-1.2.0.tar.gz

You should be having qmhandle-1.2.0 folder go in to the folder and you need to edit the qmHandle file to configure the following settings

my ($queue) = ‘/var/qmail/queue/’;

my ($stopqmail) = ‘/etc/init.d/qmail stop’;

my ($startqmail) = “/etc/init.d/qmail start”;

my ($pidcmd) = ‘pidof qmail-send’;

Using qmHandle

Available options for qmHandle

Available parameters are:-a : try to send all queued messages now (qmail must be running)

-l : list message queues

-L : list local message queue

-R : list remote message queue

-s : show some statistics

-vN : display message number N

-dN : delete message number N

-Stext : delete all messages that have/contain text as Subject

-D : delete all messages in the queue (local & remote)

-V : print program version

Additional (optional) parameters are:

-c : display colored output

-N : list message numbers only (to be used either with -l, -L or -R)

Examples

list message queues

#qmHandle -l

delete all messages that have/contain text as Subject

#qmHandle -l -S yahoo.com.tw

Other Solutions

1)You can edit the /var/qmail/control/queuelifetime file this is the file to control how long a message stays in a queue.Just put a number (to represent seconds)in this file.By default 86400 sec Will keep the mail for 1 day and expire after that.Here you can change this value to 1 and restart your qmail server it should clear your qmail queue.

2)Deleting mails from qmail queue

Following commands can delete all mails from your qmail mail server queue.

qmailctl stop
find /var/qmail/queue/mess -type f -exec rm {} \;
find /var/qmail/queue/info -type f -exec rm {} \;
find /var/qmail/queue/local -type f -exec rm {} \;
find /var/qmail/queue/intd -type f -exec rm {} \;
find /var/qmail/queue/todo -type f -exec rm {} \;
find /var/qmail/queue/remote -type f -exec rm {} \;
qmailctl start

 

Posted in Qmail | Leave a comment

Installing AWSTATS in Linux

This is my owned installation file…I used it n its working.. You guys also keep habit of maintaining installation file.

Download installation from website

1. wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.7.tar.gz
2. tar -xvzf awstats-6.7.tar.gz
3. mv awstats-6.7 /usr/local/
4. cd /usr/local/
5. mv awstast-6.7 awstats
6. cd awstats/tools/
7. perl awstats_config.pl       — This will run the script, feel the details & note down final results.

8. mkdir /var/lib/awstats

9. chmod 655 /var/lib/awstats/

10. Take backup of yout httpd.conf file (If in case anything goes wrong)
11. vi /usr/local/apache2/conf/httpd.conf

Add following lines in httpd.conf

+++++++————————————————++++++++++
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses “/usr/local/awstats/wwwroot/classes/”
Alias /awstatscss “/usr/local/awstats/wwwroot/css/”
Alias /awstatsicons “/usr/local/awstats/wwwroot/icon/”
ScriptAlias /awstats/ “/usr/local/awstats/wwwroot/cgi-bin/”

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “/usr/local/awstats/wwwroot”>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
+++++++————————————————–+++++++++

12. vi /etc/awstats/awstats.your.server.com.conf

Change the log file location as per your configuration

##LogFile=”/usr/local/apache2/logs/access_log

13. /usr/local/apache2/bin/apachectl stop
14 ./usr/local/apache2/bin/apachectl start

15. Now run “/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=<server.name.com>” #This will take some time to complete this process.

15. DONE now check “http://domainname/awstats/awstats.pl?config=<servername&gt; #what you configured.

———————————————-

If wants to schedule this command then add the following line to crone tab

0 * * * * nice /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=<server.name.com>

________________________________

Author : VIJAY LAD

Posted in LAMP, Linux | Leave a comment