How to setup BerkeleyDB with your ASSP (instead of MySQL)

 

note : at the end of this page you can find instructions to switch from BerkeleyDB to MySQL.

If you have big issues using MySQL with your ASSP , or if you would use BerkeleyDB instead of MySQL for your ASSP please follow this HOW TO

Only if you already setup MySQL for your ASSP be sure to fully disable it . Click MySQL SETUP and disable MySQL . Now go to console and execute this

rm -f /usr/local/assp/deluxe/mysql_created

Now you should install BerkeleyDB in your server, you should execute following steps

cd /usr/local/perls
wget http://www.grscripts.com/BerkeleyDB/db-5.3.28.tar.gz
tar -xzf db-5.3.28.tar.gz
rm -f db-5.3.28.tar.gz
cd db-5.3.28
cd build_unix
../dist/configure
make
make install

At end of the command above you should have BerkeleyDB installed in /usr/local/BerkeleyDB.5.3

Now you should compile BerkeleyDB module for Perl used by your ASSP , by default
/usr/local/perls/perl-5.26.1/bin/perl . If you have an older Perl version please apply this .

Now execute following steps

cd /usr/local/perls
wget http://www.grscripts.com/BerkeleyDB/BerkeleyDB-0.55.tar.gz
tar -xzf BerkeleyDB-0.55.tar.gz
rm -f BerkeleyDB-0.55.tar.gz
cd BerkeleyDB-0.55

now open with an editor like vi / nano  the file config.in and replace

INCLUDE = /usr/local/BerkeleyDB/include

with

INCLUDE =
 /usr/local/BerkeleyDB.5.3/include

and replace

LIB = /usr/local/BerkeleyDB/lib

with

LIB = /usr/local/BerkeleyDB.5.3/lib

Save the file  config.in

Now execute this

/usr/local/perls/perl-5.26.1/bin/perl Makefile.PL
make
make test
make install


Now execute this

cp /usr/local/assp/whitelist /usr/local/assp/mysql/dbimport/whitelist.add
rm -f /usr/local/assp/mysql/dbimport/whitelist.add.OK
 
cp /usr/local/assp/spamdb /usr/local/assp/mysql/dbimport/spamdb.add
rm -f /usr/local/assp/mysql/dbimport/spamdb.add.OK

cp /usr/local/assp/HMMdb /usr/local/assp/mysql/dbimport/HMMdb.add 
rm -f /usr/local/assp/mysql/dbimport/HMMdb.add.OK

Now open your ASSP WHM > Automation settings , search useBerkeleyDB , and set it OFF .

Now open your ASSP Web Interface

Go to
Module setup menu > and enable Use Module BerkeleyDB (useBerkeleyDB) .
Go to
File Paths and Database menu > and set

       
spamdb => DB:
        whitelistdb => DB:
        persblackdb => DB:
        delaydb => DB:
        useDB4griplist , set it enabled (check it)

Apply settings , close ASSP web interface, then open your ASSP WHM and STOP and START your ASSP .

Now open again your ASSP Web Interface , Go to File Paths and Database menu > and set

        DBdriver => BerkeleyDB

Apply settings , close ASSP web interface, then open your ASSP WHM and STOP and START your ASSP .

When you restart your ASSP you should see something like this below in your /usr/local/assp/maillog.txt



Jan-29-15 17:21:23 [init] BerkeleyDB module version 0.55 installed - Berkeley database usage available
Jan-29-15 17:21:23 [init] BerkeleyDB DB-version 5.3 / Berkeley DB 5.3: (September 20, 2006) is installed
Jan-29-15 17:21:23 [init] BerkeleyDB maximum cache size is set to 50MB


[..]

Jan-29-15 17:21:51 [init] Using BerkeleyDB Database /usr/local/assp/whitelist.bdb instead of file /usr/local/assp/whitelist
Jan-29-15 17:21:51 [init] Using BerkeleyDB Database /usr/local/assp/persblack.bdb instead of file /usr/local/assp/persblack
Jan-29-15 17:21:51 [init] Using BerkeleyDB Database /usr/local/assp/delaydb.bdb instead of file /usr/local/assp/delaydb
Jan-29-15 17:21:51 [init] Using BerkeleyDB Database /usr/local/assp/delaydb.white.bdb instead of file /usr/local/assp/delaydb.white
Jan-29-15 17:21:59 [init] Using BerkeleyDB Database /usr/local/assp/spamdb.bdb instead of file /usr/local/assp/spamdb
Jan-29-15 17:21:59 [init] Using BerkeleyDB Database /usr/local/assp/spamdb.helo.bdb instead of file /usr/local/assp/spamdb.helo
Jan-29-15 17:21:59 [init] Using BerkeleyDB Database /usr/local/assp/HMMdb.bdb instead of file /usr/local/assp/HMMdb

Your ASSP is now using BerkeleyDB ! Open your ASSP WHM and click "RebuildSPAMDB" to populate your HMM and spamdb BerkeleyDB databases.

 

How to switch from BerkeleyDB to MySQL #my

if you want switch back to MySQL please follow these steps.

- stop ASSP using your ASSP WHM interface.

- go to console and execute this 

# /usr/local/cpanel/3rdparty/bin/php-cgi /usr/local/assp/deluxe/berk_off.php

- start ASSP using your ASSP WHM interface if after the step above you see it stopped.

- add these rows to your /etc/my.cnf in [mysqld] section

# REQUIRED BY ASSP V2
#######################
#The number of seconds the server waits for activity on an interactive connection before closing it.
interactive_timeout=28800
#The number of seconds the server waits for activity on a connection before closing it
wait_timeout=28800
#######################


- Restart your MySQL using your WHM/cPanel or execute this

# service mysql restart


- Now open your ASSP WHM interface and click  "MYSQL"  and enable MySQL for ASSP .

- Now open ASSP Web interface , open the "File Paths and Database" menu, and "database driver name (DBdriver)" to    mysql      , and apply settings , and close your ASSP Web interface .

- Now STOP and START ASSP using your ASSP WHM interface.

- Now open again your ASSP Web interface and you should see a GREEN dot near
  "ASSP (as daemon) - Configuration (root)"

MySQL should be installed and working correctly .