On this page... (hide)
Multiserver Atmail, is where you can install more than one copy of the software product, for clustering the mail-server or to load the Webmail interface between multiple machines.
Atmail can be clustered for both the WebMail client and Email-server mode of the software. Since Atmail uses mySQL to store all user data, and a central maildir storage point for the email-server mode, the software can be setup across multiple machines to increase performance.

Example network configuration of Atmail
This part of the multiserver install will be identical to the installation of Atmail in a single instance, for more information on installation and configuration, please view the Installation Guide, http://support.atmail.com.
You will also need to configure the POP3/IMAP server, http://support.atmail.com/pop3.html and the SMTP server, which is automatically configured from the installation script.
First setup Atmail on one server, then replicate the installation directory to another machine.
tar -cvfz atmail.tgz /usr/local/atmail/
Next, move the archive to the second location via FTP/SCP
tar -xvfz atmail.tgz -C /
Next, run the install.php script for the installation of Atmail on the new server. This will setup the machine as another instance for Atmail.
It is recommended to use a central NFS directory to share the following directory:
The selected directory can be automatically symlinked to a mount point on an NFS server. This allows all the instances of Atmail to share a common configuration file and user-data
The next step is to configure mySQL to allow the new instance of Atmail to access the database.
Using the mySQL 'Grant' option you can allow the new server to access the database. Login to mySQL as root and run the following commands:
mysql> GRANT ALL PRIVILEGES ON atmail.* TO 'root'@'192.168.0.1' IDENTIFIED BY 'mypassword';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Replace atmail with the database name on your server, and 192.168.0.1 with the IP address of the new server
If you want the Maildir email message database to be stored on a remote server, the most practical means of doing this is to install it on a remote NFS mount. The webserver can access this mount everytime a user accesses an email; which can distribute the load over multiple servers.
The /usr/local/atmail/tmp/ directory must be shared via NFS. This is required for each frontend to access the single directory storage for attachments and temporary messages.
For this example, we will use the domains webserver.com (as the domain of the webserver) and database.com (for the database server).
First, add the following to the /etc/fstab file of the webserver:
database.com:/usr/local/atmail/users /usr/local/atmail/users nfs rw 0 0 database.com:/usr/local/atmail/tmp /usr/local/atmail/tmp nfs rw 0 0
Then, create an entry in the /etc/exports file of the database-server, which will give read/write permissions for that directory as an NFS mount:
/usr/local/atmail/users webserver.com(rw) /usr/local/atmail/tmp webserver.com(rw)
Then, on both servers, run the NFS service:
/etc/init.d/nfs restart
Then, mount the NFS drive in your webserver:
mount -t nfs database.com:/usr/local/atmail/users /usr/local/atmail/users nfs mount -t nfs database.com:/usr/local/atmail/tmp /usr/local/atmail/tmp nfs
You can then run the install.php file of Atmail, which will automatically create the Maildir directory.
The utility rsync
Rsync can be used to synchronize your servers, it can be set as a cron job, ensuring that changes made to your system are transferred to your other servers.
If for example a HTML template or PHP script is edited on the master Atmail directory /usr/local/atmail/webmail/*, these changes will be automatically copied to the other servers. Note, the /usr/local/atmail/users directory should not be synced for server installations. This should be on an NFS mount.
The principle is to have each copy of Atmail will reference the one MySQL server ( all database data is kept in the one MySQL database backend. ) . If using the Email-server mode of Atmail, a central NFS server can be setup as the mailbox storage for user accounts.
The following shell-script can be setup via Cron to sync the Atmail directory with other servers in the cluster:
/usr/bin/rsync -e ssh -avr --delete --exclude "users/" --exclude "tmp/" --exclude "spool/" --exclude "*.pid" root@master.yourserver.com:/usr/local/atmail /usr/local
Note Rsync must be successfully setup on both the Master server and the client machines.
If your hardware and OS are identical, you can also synchronize your httpd.conf and SMTP configuration files.
There are several changes that need to be made to the second ( and subsequent ), instances of the Atmail server, these include:
Browser related articles from our online Knowledge-base regarding the Multi-server guide