Online demo Privacy policy GoBD notes Blog

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/piler/sphinx.conf
# chmod +x /usr/local/etc/piler/sphinx.conf
# su - piler
$ indexer --all --config /usr/local/etc/piler/sphinx.conf

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,35 * * * * /usr/local/libexec/piler/
30   2 * * * /usr/local/libexec/piler/
40 3 * * * /usr/local/libexec/piler/
*/15 * * * * /usr/bin/indexer --config /usr/local/etc/piler/sphinx.conf --quiet tag1 --rotate
*/15 * * * * /usr/bin/indexer --config /usr/local/etc/piler/sphinx.conf --quiet note1 --rotate
*/5 * * * *  /usr/bin/find /var/piler/www/tmp -type f -name i.\* -exec rm -f {} \;
*/5 * * * * /usr/bin/find /var/piler/error -type f|wc -l > /var/piler/stat/error
3 * * * * /usr/local/libexec/piler/
2 0 * * * /usr/local/libexec/piler/

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 /usr/local/etc/piler/config-site.php, 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['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