ServerConfigurationTips?

Server Memory

In high volume environments, your server requires more memory than usual.

On Linux, edit file /usr/local/mailarchiva/server/startserver.sh

replace -Xmx768m with a higher value, such as -Xmx2048m

On Windows, right click task tray applet, click Configure..., select Java tab, enter 2048m for the maximum memory size.

Use of a Network Attached Storage Device

For performance reasons, we recommend keeping your indexes local to the machine running MailArchiva. The store data, however, is ideally suited to being stored in a NAS or a SAN.

Windows

On Windows, you need to specify the network path as a UNC path. Windows service applications do not have access to mapped drives. First, you need to make sure that the service is running under an account with sufficient privileges. To do this, from the Services Control Panel applet (not the MailArchiva task tray icon configuration!), select the service, right click, select Properties, select Logon Tab, enter your Administrator account login account details, save and restart the MailArchiva server.

In the Volumes tab of the MailArchiva configuration, click add new volume. Enter the UNC network path as the store directory (e.g. \\server\store\store0). Make sure the index path you enter is on a local drive (e.g. c:\index).

Linux

To use an external storage device, it is best to define a mount point to the root of the NAS device (e.g. \mnt\mailarchiva) using the Linux mount, smbmount or nfsmount commands. When adding multiple volumes in the MailArchiva configuration screen, in the store directory field, specify a sub directory of the mount point (e.g. \mnt\mailarchiva\store1). MailArchiva will automatically create the directory store1 (you do not need to do this yourself!). Using this configuration, one does not need to create multiple mount points for each volume. Be sure to add the mount point to fstab so that upon machine reboot, MailArchiva will continue to have access to the device.

Entry in to fstab for a smb mount:

//172.19.1.111/archive   /mnt/archive   smbfs   username=administrator,password=12345 
 

Using TLS to Secure the Web Console

To support TLS, one needs to install a server and CA cert. See TomcatConfiguration for more details.

Apache HTTP Server Proxy

For various reasons, you may want to configure the Apache HTTP server to forward requests to the Tomcat server embedded within MailArchiva.

We recommend using Apache's mod_ajp for this purpose.

Edit your Apache httpd.conf file with the following:

<VirtualHost *:80>
  ServerName www.mailarchiva.com
  ServerAlias mailarchiva.com
  ProxyPass /mailarchiva/ ajp://localhost:8009/mailarchiva/
  ProxyPassReverse /mailarchiva/ ajp://localhost:8009/mailarchiva/
</VirtualHost>

You must use the same web application name on both sides, otherwise session authentication won't work

Thereafter, in your Tomcat server.xml file, add the proxyName and proxyPort attributes to the Connector element.

<Connector port="8090" ...
              proxyName="www.mailarchiva.com"
              proxyPort="80"/>

Changing Listening Ports

8090 - http web console port (e.g. http://localhost:8090/mailarchiva)
8091 - smtp port
8092 - smtp milter port
8009 - tomcat ajp port
8010 - tomcat shutdown port

Port's 8090 (http), 8009 (ajp) and 8010 (shutdown) are modified in /usr/local/mailarchiva/server/conf/server.xml or C:\Program Files\MailArchiva\Server\Conf\server.xml. Port's 8090 (smtp) and 8091 (sendmail milter) are modified in the listening tab of the server console. Alternatively, you can edit them directly in the server's server.conf file.

Change Console Session Timeout

Edit the session timeout value in:

C:\Program Files\MailArchiva\Server\webapps\mailarchiva\WEB-INF\web.xml (Windows)

/usr/local/mailarchiva/server/webapps/mailarchiva/WEB-INF/web.xml (Linux)

Index Language

If your organization typically communicates in one language (e.g. English), it is highly recommended to set the following in server.conf:

index.language.detect=no

index.language=en

Large Emails

To process larger emails, the MailArchiva server will need more memory. If you find that larger emails are not archived, you will need to increase the server heap space (memory). To give the server more memory, on Windows, right click task tray icon, click Configure, click Java tab, increase the value in Maximum memory pool to 1024. On Linux, edit /usr/local/mailarchiva/server/startserver.sh and add the line:

export CATALINA_OPTS="-Xmx640m -Xms256m -XX:PermSize=64M -XX:MaxPermSize=128M"

Automatic MailArchiva Server Start on Reboot (For Linux)

Save the below as /usr/local/mailarchiva/server/mailarchiva

# MailArchiva auto-start
#
# description: Auto-starts mailarchiva
# processname: mailarchiva
# pidfile: /var/run/mailarchiva.pid

case $1 in
start)
        sh /usr/local/mailarchiva/server/startserver.sh
        ;;
stop)  
        sh /usr/local/mailarchiva/server/stopserver.sh
        ;;
restart)
        sh /usr/local/mailarchiva/server/startserver.sh
        sh /usr/local/mailarchiva/server/stopserver.sh
        ;;
esac   
exit 0

Then, type the following:

cp /usr/local/mailarchiva/server/mailarchiva /etc/init.d
chmod +x /etc/init.d/mailarchiva
sudo ln -s /etc/init.d/mailarchiva /etc/rc1.d/K99mailarchiva
sudo ln -s /etc/init.d/mailarchiva /etc/rc2.d/S99mailarchiva

Disk Space Checking

Every now and then, MailArchiva performs disk space checks to determine the remaining disk space available on a volume. If it reaches the maximum limit specified by you, then it will automatically close the volume and switch over to the next volume. If you have a very large disk and you dont really need this feature, it is a good idea to turn off disk space checking for performance reasons. You can do this by editing server.conf and setting "volume.diskspace.check=no".

You can also set the number of megabytes that must be remaining before MailArchiva issues a disk space warning, by setting the volume.diskspace.warn=10 configuration parameter. If you want to leave a little bit extra on your drive, the setting volume.diskspace.threshold=20, would leave an extra 20 MB available on your drive.

Bulk Message Operation Restrictions (Enterprise Edition Only)

The following server.conf properties restrict the maximum number of messages that can be exported, viewed and sent:

export.max.messages=100 view.max.messages=100 delete.max.messages=100 send.max.messages=100

Advanced Active Directory Role Mappings

If you enable debug logging, you will notice that when a user logs in, all the LDAP fields associated with the user are outputted to the debug log. You should see all the groups associated with a user appear. MailArchiva allows you to map any LDAP attribute listed in that debug output. It is possible to map others attributes not listed in the Admin Console to achieve your desired outcome. This is also very handy when implementing OpenLDAP? integration on UNIX based systems.

In the server.conf file there are two configuration parameters of interest:

role.assignment.role = your role name (e.g. Administrator) role.assignment.domain = your domain role.assignment.attribute = any LDAP / Active Directory attribute listed in the debug log role.assignment.criterion = can be any Java-based regular expression used for matching purposes

By adding additional attributes and patterns to the server.conf file, you can add as many additional mappings as you like. Just go role.assignment.attribute.2=xx, role.assignment.criterion.2=xxx, etc.

Advanced User to Email Address Mapping

You can also map any number of email address available in any LDAP field to a user. Just use the fields:

emailaddress.map.attribute.1 = proxyAddresses emailaddress.map.pattern.1 = SMTP:(.*)@(.*)

The emailaddress.map.attribute value refers to the attribute name, the emailaddress.map.pattern refers to a regular expression that is used for matching purposes. The first group i.e. (.*) in the regular expression is the username, while the last group (.*) is the domain name.

Smart Attachment Storage Minimum Size (Enterprise Edition Only)

The Smart Attachment Storage feature in the Enterprise Edition is extremely useful in saving chunk loads of disk space, since the archiving server only stores one copy of an attachment across an entire volume. By default, the server will strip out attachments that are larger than 32,768 bytes (32k). You can reduce this value to force the server to strip out smaller attachments and thereby save on additional disk space. Edit the server.conf property "smart.attachment.minimum.size" and reduce it to the desired value. Setting it to zero will strip out all attachments irrespective of the size.

Faster Searches

To speed up your email discovery searches, you can set the number of records that the MailArchiving? server returns by modifying the maxSearchResults value in server.conf. This should not affect the quality of your search results, only the maximum number of records returned. A typical user will likely never need to access any more than about 10000 records at a time in any one search.

You'll notice that in the store directory of your volume, you will see a volume.info file. This file is used by MailArchiva to determine the volume's status and its modified and created date. The dates are used by the search engine to determine whether it is worthwhile search a volume within a given search date range. The search engine will ignore volumes that fall outside the specified date range. By default, the Enterprise Edition sets the search date range to be within six months. Thus, if you keep your volumes to a maximum of six months worth of data in size, searches will be faster.

Please also refer to the DistributedSearch capability for information on how to configure MailArchiva to execute parallel searches across multiple machines.

Reopening Volumes

The MailArchiva GUI does not allow you to REOPEN volumes, and for good reason. See the Faster Searches discussion above. However, if you need to make a closed volume ACTIVE for what ever reason, you can do it by editing the volume.info file in the root of your store directory. Change the status value from CLOSED to either CLOSED, ACTIVE, UNUSED or UNMOUNTED. Note, you do this at your own risk! Make sure you only have one ACTIVE volume at a time.

Merging Volumes

(1) Locate the store directory of the largest volume e.g.

(2) Backup the volumeinfo file in the largest volume store directory

(3) Copy all files from other volume store directories into the largest volume store directory

(4) Restore the volumeinfo to the largest volume store directory

(5) Edit the restored volumeinfo file and change CLOSED to ACTIVE (if necessary) and delete closed date line

(4) Reindex from the MailArchiva Configuration GUI

Linux Example


This example merges the contents of all volumes to  /mnt/intelarchive/mailarchivastore9 

Make a backup of the volumeinfo file in /mnt/intelarchive/mailarchivastore9  
before running the command ./mergeallvolumes.sh

root@MailArchive:~/utilities/merge# cat cpfiles.sh

----- cpfiles.sh-----------------------------

#!/bin/bash
function large_cp ()
{       while read line1; do
               /bin/cp -rf $1/$line1 $2/
               echo /bin/cp -rf $1/$line1 $2/
       done
}
ls -1 $1/ | large_cp $1 $2

------ mergeallvolumes.sh------------------------


root@MailArchive:~/utilities/merge# cat mergeallvolumes.sh
#!/bin/bash
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore0 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore1 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore2 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore3 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore4 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore5 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore6 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore7 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore8 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore10 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore11 /mnt/intelarchive/mailarchivastore9 &
nohup nice -20 ./cpfiles.sh /mnt/intelarchive/mailarchivastore12 /mnt/intelarchive/mailarchivastore9 &
Topic revision: r14 - 2009-06-09 - 10:10:05 - JamieBand
 
.
Copyright Stimulus Software