Online demo Privacy policy GoBD notes Blog

This is an old revision of the document!

Post install tasks

Edit the configuration file

If you use any antispam application, set the spam_header_line parameter, then piler can recognise when it receives a spam. If you use SpamAssassin, then you may use the following:

spam_header_line=X-Spam-Level: ********

Create a key for encryption

make key
cp piler.key /usr/local/etc/piler
chgrp piler /usr/local/etc/piler/piler.key
chmod 640 /usr/local/etc/piler/piler.key

This command will read 56 bytes from /dev/urandom and write to ./piler.key. Piler uses the key to encrypt archived files, and decrypt retrieved messages from the archive.

IMPORTANT! Make sure you never lose/overwrite the key otherwise you won't access your archive ever again. So whenever you upgrade be sure to keep your existing key file.

Create a database for piler

#mysql -u root -p
mysql>create database piler character set 'utf8mb4';
mysql>grant all privileges on piler.* to piler@localhost identified by 'verystrongpassword';
mysql>flush privileges;

mysql -u piler -p piler < util/db-mysql.sql

Install and configure sphinx search

Before installing sphinx (version prior to 2.0.6), I highly recommend to apply the fix to sphinxsearch-2.0.x/src/searchd.cpp mentioned in the FAQ at Q2.

After installing sphinx search, issue the following commands (be sure to check the sql_pass parameters) to overwrite the default sphinx config (be sure to use the correct path to sphinx.conf), set the mysql parameters (database, login, password), and initialize its database:

#cp etc/ /usr/local/etc
#su - piler
$indexer --all

Configure mail relay for piler

Your users may want to forward some of their archived email to themselves. In order to do that piler needs a mail relay server. It's your choice where you put it, eg. on the piler host (to localhost, or on another box.

Let's say you use postfix on, then edit /etc/postfix/      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       -       smtpd

Then you may define SMARTHOST as '' and SMARTHOST_PORT '25' in config.php, see below. You may use a high port (>1024) instead the usual 25/tcp port, see the following example:      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       -       smtpd

Set up cron jobs

For piler user:

*/5 * * * * LC_ALL=C mpstat | tail -1 | awk '{print $11}' > /var/piler/stat/cpu.stat
*/15 * * * * /usr/local/bin/indexer --quiet delta1 --rotate && sleep 2 && /usr/local/bin/indexer --quiet --merge main1 delta1 --merge-dst-range deleted 0 0 --rotate
*/15 * * * * /usr/local/bin/indexer --quiet tag1 --rotate
*/15 * * * * /usr/local/bin/indexer --quiet note1 --rotate
# optional
30 7 * * * /usr/bin/php /usr/local/libexec/piler/daily-report.php /var/piler/www

Create a dedicated virtual host for piler

Please make sure you turned on rewrite support

mv webui /var/piler/www

Give permission to the webserver to write the tmp/ directory (Do not confuse it with the system /tmp directory!)

chown www-data:www-data /var/piler/www/tmp

Create config-site.php (in the same directory where config.php resides), and add every site specific variables to config-site.php. Any variable that presents in config-site.php overrides the config.php default values. This way your local settings may survive a gui upgrade when the contents of config.php is changed.

On the demo site we use the following config-site.php file:


$config['SITE_NAME'] = '';
$config['SITE_URL'] = '';
$config['DIR_BASE'] = '/var/piler/www/';

$config['ENABLE_AUDIT'] = 0;
$config['MEMCACHED_ENABLED'] = 0;
$config['ENABLE_SYSLOG'] = 1;
$config['PILER_HOST'] = '';
$config['SMTP_DOMAIN'] = '';
$config['SMTP_FROMADDR'] = '';
$config['ADMIN_EMAIL'] = '';


Check out the contrib/webserver directory on how to setup a virtual host for apache and nginx.

Google Analytics Alternative