Skip to content

Production Server Best Practices

sebbacon edited this page Oct 11, 2011 · 11 revisions

Hosting options

  • Cloud Server
  • Virtual Private Server

General Server configuration

Cron job

Web server configuration

Security

Email configuration

Application-specific email configuration for exim is covered in doc/INSTALL-exim4.md. It is possible to use other MTAs; the documentation for exim should provide you with enough information to get started with a different MTA. If you do use a different one, please add to the documentation!

On a live server, you should also consider the following, to increase the deliverability of your email:

  • Set up SPF records for your domain
  • Set up feedback loops with the main email providers (Hotmail and Yahoo! are recommended)
  • Especially if deploying from Amazon EC2, use an external SMTP relay for sending outgoing mail. See Alaveteli EC2 AMI for more suggestions.

Backup

Most of the data for the site lives in the production database. The exception is the raw incoming email data, which is stored on the filesystem, as specified in the setting RAW_EMAILS_LOCATION of config/general.yml.

Refer to the Postgres documentation for database backup strategies. The most common method is to use pg_dump to create a SQL dump of the database, and backup a zipped copy of this.

Raw emails would be best backed up using an incremental strategy. Rsync is one way of doing this.

Another belt-and-braces backup strategy is to set up your MTA to copy all incoming and outgoing mail to a backup mailbox. One way of doing this with exim is to put the following in your exim config:

system_filter = ALAVETELI_HOME/config/exim.filter
system_filter_user = ALAVETELI_USER

And then create a filter file at ALAVETELI_HOME/config/exim.filter, with something like:

if error_message then finish endif
if $header_to: contains "mydomain.org"
then
unseen deliver "backup@mybackupdomain.org"
endif 

if $sender_address: contains "test.alaveteli.org"
then
unseen deliver "backup@mybackupdomain.org"
endif
Clone this wiki locally