Multiple popfile servers on Ubuntu
I could not find any good notes on how to enable multiple instances of the Popfile email and spam filtering software on my Ubuntu Server (14), so I thought I would type up how I did here. It seems to work fine so far!
The instance configuration files are located in /var/lib, so start with copying the existing popfile folder to a new popfile_newinstance, and make sure that the permissions are correct.
Here I moved the SQLite database and popfile.cfg from my Windows instance of Popfile (which I shut down first), updated the configuration and made sure that the permissions and ownership was correct.
To set up the startup script for the new instance, I copied start_popfile.sh to a new start_popfile_newinstance.sh in the /usr/share/popfile folder, again look at the permissions.
Here, update the PARAMS section to new folders, that we need to create later, and update the path to the cfg file. I set the POPFILE_USER variable towards the end to popfile_newinstance.
To set this up as a service to be started automatically, cd to /etc/init.d and copy the existing popfile script to popfile_newinstance and update all the environment variables in the first part.
Finally we need to create the folders /var/run/popfile_newinstance as well as /var/log/popfile_newinstance, make sure that these have the same permissions/owners as the original popfile folder.
Now enable this as a startup script: