How do I enable innoDB storage engine?

You can enable InnoDB by accessing your server via SSH as root ( or another account then use su or sudo to gain root access). Once that is done, check /etc/my.cnd for an entry like:

skip-inndob

If such an entry exists, remove or comment out the entry and restart MySQL.

If such an entry does not exist, then there are other problems for which we will need more information.


Once InnoDB is enabled, you can make it the default table type by specifying the following in /etc/my.cnf:

default-table-type=innodb

Enjoy:)

Setup Your Nameservers on Directadmin

To setup your nameservers, simply do the following:

- Login to your DirectAdmin panel as "admin"
- Go to your IP Management section, and add two new IP addresses
- Once they are added, click the check boxes next to the two IPs that you've just submitted. Assign these IPs to "admin"
- Now go to your Reseller panel, and navigate to your Nameserver section
- On this page, create your two nameservers, generally ns1. and ns2.
- Finally, go back to your Admin panel and go to your Administrator Settings page. Set your nameservers to the ones you have just created and save your changes.

Enjoy:)

Checking the configuration of named.conf and zone files

It is sometimes easy to make changes in named.conf file or in any zone files manually though the control panel has options to modify them. If the changes are being made manually, we should also make sure that the configuration as well as the zone files are not being messed up.

The bind package has utilities to check the syntax of named.conf and any zone files. We can make use of those binaries to check our modifications done to those files before reloading or restarting named service.

To check the sytax of zone file /var/named/kb.com.db for the domain kb.com,

[root@bash ~]# named-checkzone kb.com /var/named/kb.com.db
zone kb.com/IN: loaded serial 2006032401
OK
[root@ bash~]#


If everything is correct, it will show the serial number with which the zone file is loaded. Otherwise, it will give error message indicating the line number at which the error occured.

To check the syntax of named.conf file,

[root@bash ~]# named-checkconf /etc/named.conf
[root@bash~]#

You may also load the configuration of all master zones listed in named.conf at the time of checking the syntax as,

[root@bash ~]# named-checkconf -z /etc/named.conf
zone localdomain/IN: loaded serial 42
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
zone 255.in-addr.arpa/IN: loaded serial 42

zone 0.in-addr.arpa/IN: loaded serial 42
zone kb.com/IN: loaded serial 2006032401
[root@bash ~]#

The command will show a detailed output in case any error in named.conf file.

This way we can make sure that we are not editing the configuration file wrongly.

Enjoy:)

Script for deleting all the mails in Qmail

create a file with the following statements, say frozen

service qmail 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 {} \;
service qmail start

You may also include the directories like /var/qmail/queue/mess/bounce... etc.
2. Give executable permission to this file

chmod 755 frozen

3. Execute the script

sh frozen

Enjoy:)

Qmail error 'qmail: alert: cannot start: unable to open mutex'

If an error "qmail: alert: cannot start: unable to open mutex" is encountered while starting qmail.

Proceed with the following steps to fixing the error:-

1. Check the result of tail -f /var/log/messages as well as tail -f /var/log/maillog

If you can't trace the error from log files, please run the binary from /var/qmail/bin.

[root@serv ~]#cd /var/qmail/bin
[root@serv ~]#./qmail-send


2. If the error is something like "alert: cannot start: unable to open mutex"

[root@serv ~]# touch /var/qmail/queue/lock/sendmutex
[root@serv ~]# chown qmails:qmail /var/qmail/queue/lock/sendmutex


3.Restart qmail using the command

[root@serv ~]# /etc/rc.d/init.d/qmail start

Enjoy:)

IMAP Error (Connection dropped by IMAP server)

To troubleshoot the IMAP error(Inbox lock errors) while accessing mailbox via any webmail clients(Horde, SquirrelMail, NeoMail, Round Cube etc.):

The error will be shown as below,

Connection dropped by IMAP server

ERROR: Connection dropped by IMAP server.
Query: SELECT "INBOX"
Reason Given: Unable to open this mailbox.

The error usually occurs when there is inbox.lock file in the mailbox.
Here the inbox gets locked and hence the mailbox can't be accessed and
you will get the above said error.

1. Remove the "inbox.lock" file from the particular mailbox.

Eventhough the "inbox.lock" file is deleted, it will be created when
the mailbox is accessed again. Hence after removing the file, we need
to copy the inbox to a new file name so as to fix the issue which can
be done as follows,
2. cat inbox > inbox.new
3. rm inbox
4. mv inbox.new inbox
5. Then fix ownership and permissions.

This fixes the issue.

Enjoy:)

Spamd Failing

If you find the "spamd" failing error on an exim restart.

root@server [~]# /etc/init.d/exim restart

Shutting down exim: [ OK ]

Shutting down antirelayd: [ OK ]

Shutting down spamd: [ FAILED ]

Starting exim-26: [ OK ]

Starting exim: [ OK ]

Starting exim-smtps: [ OK ]

Starting antirelayd: [ OK ]

Then use he following steps

When disabling "spamd", the Cpanel create a file named "/etc/spamdisable" which may not get deleted on enabling the "spamd" feature again. Check the presence of the above said file.

The issue may also arise due to unavailability of the perl module "Mail::SpamAssassin" by installing the the same and on restarting the exim, the issue will be fixed.

# /scripts/perlinstaller --force Mail::SpamAssassin

#/etc/init.d/exim restart

Enjoy:)