<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>@Mail Knowledge Base</title>
	<link>http://atmail.com/kb</link>
	<description>@Mail hints and tips</description>
	<pubDate>Mon, 06 Sep 2010 04:38:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>LDAP Lookups with SMTP Authentication</title>
		<link>http://atmail.com/kb/2010/ldap-lookups-with-smtp-authentication/</link>
		<comments>http://atmail.com/kb/2010/ldap-lookups-with-smtp-authentication/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 01:00:07 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
	<category>Exim</category>
	<category>Atmail 5</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/ldap-lookups-with-smtp-authentication/</guid>
		<description><![CDATA[Some LDAP setups disallow the use of bind authentication for users - merely acting as storage mechanisms for passwords by access of the admin user. While this is not recommended, these steps outline how to enable authentication of this sort via Exim.
For the following setup, we will use the following parameters:
- the LDAP server is [...]]]></description>
			<content:encoded><![CDATA[<p>Some LDAP setups disallow the use of bind authentication for users - merely acting as storage mechanisms for passwords by access of the admin user. While this is not recommended, these steps outline how to enable authentication of this sort via Exim.</p>
<p>For the following setup, we will use the following parameters:</p>
<p>- the LDAP server is <strong>ldap.local</strong><br />
- the administrator DN is <strong>'uid=admin,ou=Admin,o=domain.com'</strong><br />
- the password is <strong>'password'</strong><br />
- the base DN for users is <strong>'ou=People,o=domain.com'</strong><br />
- the attribute for password is <strong>'userpass'</strong><br />
- the objectClass is <strong>'inetOrgPerson'</strong></p>
<p>1.) Open up /usr/local/atmail/mailserver/configure</p>
<p>2.) Find the following line:</p>
<p><em># AUTH LOGIN authentication method with MySQL support used by Outlook Express.<br />
#auth_login:<br />
#driver = plaintext<br />
#public_name = LOGIN<br />
#server_condition = ${if eq{$1}{${lookup mysql{SELECT Account FROM UserSession WHERE Account='$1' and Password='$2'}{$value}fail}}{1}{0}}<br />
#server_prompts = "Username:: : Password::"<br />
#server_set_id = $1</em></p>
<p>3.) Replace with:</p>
<p><em>auth_login:<br />
driver = plaintext<br />
public_name = LOGIN<br />
server_condition = ${if eq{$2}{${lookup ldap{user="uid=admin,ou=Admin,o=domain.com" pass=193af9q ldap://ldap.local/ou=People,o=domain.com?userpass?sub?(&(uid=$1)(objectclass=inetOrgPerson))}{$value}fail}}{1}{0}}<br />
server_prompts = "Username:: : Password::"<br />
server_set_id = $1</em></p>
<p>4.) Note the LDAP URL. it takes the following format:</p>
<p><em>ldap://[host name]/[base DN]?[attribute name]?[scope]?[filter]<br />
</em><br />
For our example, we use:<br />
<strong><br />
ldap://ldap.local:389/ou=People,o=domain.com?userpass?sub?(&(uid=$1)(objectclass=account))<br />
</strong><br />
Where:</p>
<p><strong>ldap.local:389</strong> is the <strong>hostname</strong> and port of the LDAP server</p>
<p><strong>ou=People,o=domain.com</strong> is our <strong>Base DN</strong>. This is the distinguished name that forms the base of the LDAP search. If entries have the LDAP format of '<em>uid=username,ou=People,o=domain.com</em>', the Base DN to use is '<em>ou=People,o=domain.com</em>'.</p>
<p><strong>userpass</strong> is the attribute we are looking for, for comparison</p>
<p><strong>sub</strong> is the scope of the search. <strong>sub</strong> retrieves information about entries at all levels below the distinguished name (base dn) specified in the URL. base retrieves information about the distinguished name (base dn) specified in the URL only.</p>
<p><strong>(&(uid=$1)(objectclass=inetOrgPerson))</strong> is the filter. Normally, a basic filter contains only one set - for example, <em>(objectclass=inetOrgPerson)</em>, which specifies that it should only show entries of the object class '<em>inetOrgPerson</em>'. Since we are looking for a specific object class AND <em>uid</em>, we need to specify both.</p>
<p>In this case, the filter is specified as:<br />
<strong><br />
(&(uid=$1)(objectclass=inetOrgPerson))<br />
</strong><br />
Which, roughly means:<br />
<strong><br />
((uid=$1) AND (objectclass=inetOrgPerson))</strong></p>
<p>The operator "&", standing for "AND", being appended at the front of the filter. This requires that both filter conditions are met.</p>
<p>5.) Restart Atmail.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/ldap-lookups-with-smtp-authentication/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Using SSL certificates with Atmail</title>
		<link>http://atmail.com/kb/2010/using-ssl-certificates-with-atmail/</link>
		<comments>http://atmail.com/kb/2010/using-ssl-certificates-with-atmail/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 04:05:32 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
	<category>Encryption</category>
	<category>Exim</category>
	<category>Atmail 5</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/using-ssl-certificates-with-atmail/</guid>
		<description><![CDATA[You can use SSL certificates to allow your users to access Atmail via SSL. This document will show you how to convert SSL certificates in a format that can be used by Apache, Exim and Dovecot.
1.) Upon getting your SSL certificates, you will receive them in two files: .crt and .key. For the purposes of [...]]]></description>
			<content:encoded><![CDATA[<p>You can use SSL certificates to allow your users to access Atmail via SSL. This document will show you how to convert SSL certificates in a format that can be used by Apache, Exim and Dovecot.</p>
<p>1.) Upon getting your SSL certificates, you will receive them in two files: .crt and .key. For the purposes of this document, we will put them in the directory: <strong>/usr/local/atmail/ssl/</strong> as two files <strong>domain.key</strong> and <strong>domain.crt</strong>.</p>
<p>2.) You will need to convert the crt file to .PEM. This command will do it:<br />
<strong><br />
% openssl x509 -inform der -in /usr/local/atmail/ssl/domain.crt -out /usr/local/atmail/ssl/domain.pem</strong></p>
<p>3.) Afterwards, you will need a password-less key file:<br />
<strong><br />
% openssl rsa -in /usr/local/atmail/ssl/domain.key -out /usr/local/atmail/ssl/domain-nopass.key</strong></p>
<p>4.) Define the pathnames of the key and cert files in <em>WebAdmin > Services > POP3/IMAP</em>.</p>
<p>5.) The SSL Certificate Path corresponds to your .pem file. For this example, the setting will be "<strong>/usr/local/atmail/ssl/domain.pem</strong>".</p>
<p>6.) The SSL key file corresponds to your passphrase-less key file. For this example, the setting will be "<strong>/usr/local/atmail/ssl/domain-nopass.key</strong>".</p>
<p>7.) Save changes.</p>
<p>8.) Should you want to verify this manually, open up /usr/local/atmail/mailserver/etc/dovecot.conf, and look for this line block:<br />
<strong><br />
ssl = yes<br />
protocols = pop3 imap pop3s imaps<br />
ssl_cert_file = /usr/local/atmail/ssl/domain.pem<br />
ssl_key_file = /usr/local/atmail/ssl/domain-nopass.key</strong></p>
<p>9.) And here is the corresponding entry for /usr/local/atmail/mailserver/configure:<br />
<strong><br />
tls_advertise_hosts = *<br />
log_selector = +tls_peerdn<br />
tls_certificate=/usr/local/atmail/ssl/domain.pem<br />
tls_privatekey=/usr/local/atmail/ssl/domain-nopass.key</strong></p>
<p>10.) Restart Atmail services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/using-ssl-certificates-with-atmail/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Custom Welcome Messages for Each Domain</title>
		<link>http://atmail.com/kb/2010/custom-welcome-messages-for-each-domain/</link>
		<comments>http://atmail.com/kb/2010/custom-welcome-messages-for-each-domain/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 05:35:43 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/custom-welcome-messages-for-each-domain/</guid>
		<description><![CDATA[You can set custom Welcome Messages for each domain you host in Atmail via this method:
- open up /usr/local/atmail/webmail/application/models/users.php
- find:
$messageBody = self::generateWelcome($userData, $this->_globalConfig['welcome_msg']);
- change this to:
$domainRef = $userData['UserSession']['Account'];
$domainRef = explode("@", $domainRef);
$welcomeMsg = "/usr/local/atmail/mailserver/etc/$domainRef[1].html";
if (!file_exists($welcomeMsg)) $welcomeMsg = "/usr/local/atmail/mailserver/etc/welcome-message.html";
$messageBody = self::generateWelcome($userData, $welcomeMsg); 
- save changes,
- create copies of the /usr/local/atmail/mailserver/etc/welcome-message.html with the filenames being the domain name [...]]]></description>
			<content:encoded><![CDATA[<p>You can set custom Welcome Messages for each domain you host in Atmail via this method:</p>
<p>- open up /usr/local/atmail/webmail/application/models/users.php</p>
<p>- find:</p>
<p><strong>$messageBody = self::generateWelcome($userData, $this->_globalConfig['welcome_msg']);</strong></p>
<p>- change this to:</p>
<p><strong>$domainRef = $userData['UserSession']['Account'];<br />
$domainRef = explode("@", $domainRef);<br />
$welcomeMsg = "/usr/local/atmail/mailserver/etc/$domainRef[1].html";<br />
if (!file_exists($welcomeMsg)) $welcomeMsg = "/usr/local/atmail/mailserver/etc/welcome-message.html";<br />
$messageBody = self::generateWelcome($userData, $welcomeMsg); </strong><br />
- save changes,</p>
<p>- create copies of the /usr/local/atmail/mailserver/etc/welcome-message.html with the filenames being the domain name you wish to have customized welcome messages for. For example, a domain called juno.com:</p>
<p><strong>% cp /usr/local/atmail/mailserver/etc/welcome-message.html /usr/local/atmail/mailserver/etc/juno.com.html</strong></p>
<p>This will then provide the appropriate welcome message for each domain.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/custom-welcome-messages-for-each-domain/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Importance of tuning MySQL with innodb_buffer_pool_size and key_buffer_size</title>
		<link>http://atmail.com/kb/2010/importance-of-tuning-mysql-with-innodb_buffer_pool_size-and-key_buffer_size/</link>
		<comments>http://atmail.com/kb/2010/importance-of-tuning-mysql-with-innodb_buffer_pool_size-and-key_buffer_size/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 23:44:01 +0000</pubDate>
		<dc:creator>info</dc:creator>
		
	<category>Database</category>
	<category>Data Mining/SQL Queries</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/importance-of-tuning-mysql-with-innodb_buffer_pool_size-and-key_buffer_size/</guid>
		<description><![CDATA[Out of the box, MySQL has very limited memory allocation for cache  use. If you are using Atmail with MySQL in production, it is imperative  you review and optimize MySQL for your hardware and memory. You can  increase performance dramatically and reduce I/O usage by tweaking MySQL  to use more of [...]]]></description>
			<content:encoded><![CDATA[<p>Out of the box, MySQL has very limited memory allocation for cache  use. If you are using Atmail with MySQL in production, it is imperative  you review and optimize MySQL for your hardware and memory. You can  increase performance dramatically and reduce I/O usage by tweaking MySQL  to use more of your system memory for the cache and buffers.</p>
<p>The two easy options for increasing performance for mysql are the <strong>innodb_buffer_pool_size</strong>  and <strong>key_buffer_size</strong> options. Atmail uses InnoDB tables for the  user authentication & log-files, and if you have a large userbase  performance can be dramatically improved by increasing the <strong>innodb_buffer_pool_size</strong>.  Other tables such as the UserSettings, Abook, use the MyISAM table  format which uses the <strong>key_buffer_size </strong>option.</p>
<p>For a production machine running all the Atmail services with 2GB of  RAM we'd recommend the following option:</p>
<p><em>/etc/my.cnf:</em></p>
<p><em>innodb_buffer_pool_size=256M<br />
key_buffer_size=256M<br />
</em></p>
<p>If you have 4GB RAM, double the above. Once enabled reboot MySQL, and  you will see via the process table the daemon will be allocated more  memory.</p>
<p>Tune and check for your environment, and remember not to use the  mysqld defaults for a production environment!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/importance-of-tuning-mysql-with-innodb_buffer_pool_size-and-key_buffer_size/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Testing SMTP AUTH using telnet</title>
		<link>http://atmail.com/kb/2010/testing-smtp-auth-using-telnet/</link>
		<comments>http://atmail.com/kb/2010/testing-smtp-auth-using-telnet/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 05:18:52 +0000</pubDate>
		<dc:creator>info</dc:creator>
		
	<category>Exim</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/testing-smtp-auth-using-telnet/</guid>
		<description><![CDATA[Sometimes you need to test SMTP Authentication is working on your server, and you may not have Outlook or another email client handy to test the connection.
You can verify SMTP authentication is working by using telnet and accessing the SMTP server directly. Below is a quick tutorial on how to test your server with Atmail [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to test SMTP Authentication is working on your server, and you may not have Outlook or another email client handy to test the connection.</p>
<p>You can verify SMTP authentication is working by using telnet and accessing the SMTP server directly. Below is a quick tutorial on how to test your server with Atmail for SMTP authentication details</p>
<p>1: First, make sure SMTP authentication is enabled via the Atmail Webadmin > Services > SMTP Settings > SMTP Authentication = On</p>
<p>2: Next, create or verify an existing username and password on the system</p>
<p>3: Build the Base64 username/password</p>
<p>SMTP AUTH LOGIN will encapsulate the username and password as a Base64 string. This is used to prevent sending the username/password plaintext via the network connection. Using Perl, you can issue the following command to encode the username and password as a base64 string, which can be sent to the SMTP server. Note the @ symbol is escaped to pass the string via Perl.<br />
# perl -MMIME::Base64 -e 'print encode_base64("myusername\@domain.com")'</p>
<p style="font-weight: bold">bXl1c2VybmFtZUBkb21haW4uY29t</p>
<p># perl -MMIME::Base64 -e 'print  encode_base64("weakpass")'<br />
<span style="font-weight: bold">d2Vha3Bhc3M=</span></p>
<p>4: Access the local system. Commands we issue are highlighted in bold.<br />
# telnet localhost 25<br />
Trying 127.0.0.1...<br />
Connected to localhost.localdomain (127.0.0.1).<br />
Escape character is '^]'.<br />
220 mydomain.com Welcome to the @Mail SMTP Server ( Exim )<br />
<strong>ehlo test.com</strong><br />
250-mydomain.com localhost [127.0.0.1]<br />
250-SIZE 52428800<br />
250-PIPELINING<br />
250-AUTH LOGIN<br />
250-STARTTLS<br />
250 HELP</p>
<p>The above command will verfiy AUTH LOGIN is enabled on  the server. Next, send the following command to start the SMTP Authentication process</p>
<p><span style="font-weight: bold">AUTH LOGIN</span><br style="font-weight: bold" />334 VXNlcm5hbWU6 ( Server returns username as a base64 string )</p>
<p style="font-weight: bold">bXl1c2VybmFtZUBkb21haW4uY29t</p>
<p>334 UGFzc3dvcmQ6 ( Server returns password as a base64 string )</p>
<p style="font-weight: bold">d2Vha3Bhc3M=</p>
<p>235 Authentication succeeded<br />
Congratulations, SMTP authentication is now enabled and confirmed working on your server. Note you must send the Base64 string of the username and password as two commands.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/testing-smtp-auth-using-telnet/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Auto-detect domain name in login page</title>
		<link>http://atmail.com/kb/2010/auto-detect-domain-name-in-login-page/</link>
		<comments>http://atmail.com/kb/2010/auto-detect-domain-name-in-login-page/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 03:40:30 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
	<category>Customization</category>
	<category>Interface</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/auto-detect-domain-name-in-login-page/</guid>
		<description><![CDATA[To make Atmail detect the hostname of your Atmail URL, and make it automatically detect the domain name for the login page, do the following:
- open up /usr/local/atmail/webmail/application/modules/mail/views/scripts/auth
index.phtml
- find this line block:
$("#loginPage").bind('submit', function() {
email = $("#email").val();
//alert(email);
emailArgs = email.split('@');
//alert(emailArgs[0] + ":" + emailArgs[1]);
$("input[name=emailName]").val(emailArgs[0]);
$("input[name=emailDomain]").val(emailArgs[1]);
Change this to:
$("#loginPage").bind('submit', function() {
email = $("#emailName").val() + "@" + $("#emailDomain").val();
emailArgs = email.split('@');
$("input[name=emailName]").val(emailArgs[0]);
$("input[name=emailDomain]").val(emailArgs[1]);
Then, find:
RememberMe();
Below [...]]]></description>
			<content:encoded><![CDATA[<p>To make Atmail detect the hostname of your Atmail URL, and make it automatically detect the domain name for the login page, do the following:</p>
<p>- open up /usr/local/atmail/webmail/application/modules/mail/views/scripts/auth<br />
index.phtml</p>
<p>- find this line block:</p>
<p><strong>$("#loginPage").bind('submit', function() {<br />
email = $("#email").val();<br />
//alert(email);<br />
emailArgs = email.split('@');<br />
//alert(emailArgs[0] + ":" + emailArgs[1]);<br />
$("input[name=emailName]").val(emailArgs[0]);<br />
$("input[name=emailDomain]").val(emailArgs[1]);</strong></p>
<p>Change this to:</p>
<p><strong>$("#loginPage").bind('submit', function() {<br />
email = $("#emailName").val() + "@" + $("#emailDomain").val();<br />
emailArgs = email.split('@');<br />
$("input[name=emailName]").val(emailArgs[0]);<br />
$("input[name=emailDomain]").val(emailArgs[1]);</strong></p>
<p>Then, find:</p>
<p><strong>RememberMe();</strong></p>
<p>Below this, add:<br />
<strong>emailDom = window.location.host.substring(8);<br />
$("#emailDomain").attr('value', emailDom);</strong></p>
<p>Note the number "8". This assumes that you use webmail.domain.com for your Atmail vhost. If you are using another Alias like mail.domain.com, the number will change from the number of the letters in the Alias plus one - making it:</p>
<p><strong>emailDom = window.location.host.substring(5);</strong></p>
<p>Then, find:</p>
<p><strong>&lt;tr&gt;<br />
&lt;td&gt;<br />
&lt;label class="user"&gt;&lt;?php print $this-&gt;translate('Email') ?&gt;:&lt;/label&gt; &lt;input id="email" class="input-email" type="text" name="email" tabindex="1" /&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;</strong></p>
<p>Change to:</p>
<p><strong>&lt;tr&gt;<br />
&lt;td&gt;<br />
&lt;label class="user"&gt;&lt;?php print $this-&gt;translate('Email') ?&gt;:&lt;/label&gt; &lt;input id="emailName" class="input-email" type="text" name="emailName" tabindex="1" /&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&lt;label class="user"&gt;&lt;?php print $this-&gt;translate('Domain') ?&gt;:&lt;/label&gt; &lt;input id="emailDomain" class="input-email" type="text" name="emailDomain" tabindex="1" /&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;</strong></p>
<p>This will then auto-fill the login page with the domain part of the URL entered.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/auto-detect-domain-name-in-login-page/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Apache and Varnish</title>
		<link>http://atmail.com/kb/2010/apache-and-varnish/</link>
		<comments>http://atmail.com/kb/2010/apache-and-varnish/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 07:28:51 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
	<category>OS</category>
	<category>Linux version</category>
	<category>Optimization</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/apache-and-varnish/</guid>
		<description><![CDATA[Varnish is a state-of-the-art, high-performance HTTP accelerator, used by sites such as Facebook and Twitter.
You can enable Varnish for your site by following these steps:
1.) Download Varnish from: http://sourceforge.net/projects/varnish/files/
% wget "http://downloads.sourceforge.net/project/varnish/varnish/2.1.2/varnish-2.1.2.tar.gz"
2.) Untar, install:

% tar xvfz varnish-2.1.2.tar.gz
% cd varnish-2.1.2
% ./configure --prefix=/usr/local/varnish/
% make &#038;& make install
3.) Open up your /usr/local/varnish/etc/varnish/default.vcl, and set this line block:
 backend default {
.host [...]]]></description>
			<content:encoded><![CDATA[<p>Varnish is a state-of-the-art, high-performance HTTP accelerator, used by sites such as Facebook and Twitter.</p>
<p>You can enable Varnish for your site by following these steps:</p>
<p>1.) Download Varnish from: http://sourceforge.net/projects/varnish/files/</p>
<p><strong>% wget "http://downloads.sourceforge.net/project/varnish/varnish/2.1.2/varnish-2.1.2.tar.gz"</strong></p>
<p>2.) Untar, install:<br />
<strong><br />
% tar xvfz varnish-2.1.2.tar.gz<br />
% cd varnish-2.1.2<br />
% ./configure --prefix=/usr/local/varnish/<br />
% make && make install</strong></p>
<p>3.) Open up your /usr/local/varnish/etc/varnish/default.vcl, and set this line block:</p>
<p><strong> backend default {<br />
.host = "127.0.0.1";<br />
.port = "8080";<br />
}<br />
</strong><br />
This will set the hostname and the port where your webserver will stay. This will be the connection details for your webserver. In this case, we will use a local webserver running on port 8080.</p>
<p>4.) Open up your Apache configuration file. Find:</p>
<p><strong>Listen 80</strong></p>
<p>5.) Change to your preferred alternate port:</p>
<p><strong>Listen 8080</strong></p>
<p>6.) Restart Apache:<br />
<strong><br />
% apachectl restart</strong></p>
<p>7.) Start Varnish:<br />
<strong><br />
% /usr/local/varnish/sbin/varnishd -a :80 -b localhost:8080 -T localhost:8090 -s file,/usr/local/varnish/varnish.cache,4G<br />
</strong><br />
To explain the settings briefly:</p>
<p>-a :80 defines the port for Varnish to run on.<br />
-b localhost:8080 defines the port and host of the webserver you want to cache<br />
-T localhost:8090 defines the port and host for the Varnish terminal to run in<br />
-s file,/usr/local/varnish/varnish.cache,4G defines the cache file, and the size limit.</p>
<p>Congratulations! You now have Varnish running.</p>
<p>For more information about Varnish Cache, see: <a href="http://varnish-cache.org">http://varnish-cache.org</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/apache-and-varnish/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Apache mod_deflate and mod_expires</title>
		<link>http://atmail.com/kb/2010/apache-mod_deflate-and-mod_expires/</link>
		<comments>http://atmail.com/kb/2010/apache-mod_deflate-and-mod_expires/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 01:16:18 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
	<category>OS</category>
	<category>Optimization</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/apache-mod_deflate-and-mod_expires/</guid>
		<description><![CDATA[With Apache, you can use the mod_expires and mod_deflate modules to gain a performance boost.  The mod_expires module provides caching, while the mod_deflate module compresses downloadable items to decrease bandwidth usage.
Before following this guide, make sure that mod_gzip and mod_expires are enabled for your Apache server. Most base installations of Apache 2.2 and higher are [...]]]></description>
			<content:encoded><![CDATA[<p>With Apache, you can use the mod_expires and mod_deflate modules to gain a performance boost.  The mod_expires module provides caching, while the mod_deflate module compresses downloadable items to decrease bandwidth usage.</p>
<p>Before following this guide, make sure that mod_gzip and mod_expires are enabled for your Apache server. Most base installations of Apache 2.2 and higher are likely to have these by default.</p>
<p>Open up your Apache configuration file. Then, download the configuration file from: <a href="http://atmail.com/download/expires-config.txt">http://atmail.com/download/expires-config.txt</a>:</p>
<p><em><strong>% wget http://atmail.com/download/expires-config.txt</strong></em></p>
<p>Add the contents of this file to the bottom of your Apache configuration file.</p>
<p>You may use a different Document Root for your Atmail installation; in implementations where you are using the webmail client version, this is usually the case. If this is so, you will need to modify the Directory declarations to suit your Apache root. The config file has the following line that you need to change:</p>
<p>< Directory /usr/local/atmail/webmail/></p>
<p>Change to your Atmail document root. An installation that uses /var/www/html/atmail/webmail would have the following:</p>
<p>< Directory /var/www/html/atmail/webmail/ ><br />
Save changes, and restart Apache.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/apache-mod_deflate-and-mod_expires/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Nginx and Atmail</title>
		<link>http://atmail.com/kb/2010/nginx-and-atmail/</link>
		<comments>http://atmail.com/kb/2010/nginx-and-atmail/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 06:46:59 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
	<category>Applications</category>
	<category>Optimization</category>
	<category>Atmail 5</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/nginx-and-atmail/</guid>
		<description><![CDATA[This document covers the steps you need to take to have Atmail working with the NginX platform.
Nginx is a free, open-source, high-performance HTTP server and reverse proxy. It uses an event-driven architecture that distingtuishes it from the likes of Apache. It uses low-resources, and is used for high-performance environments. See: http://wiki.nginx.org/Main for more info.
First, download [...]]]></description>
			<content:encoded><![CDATA[<p>This document covers the steps you need to take to have Atmail working with the NginX platform.</p>
<p>Nginx is a free, open-source, high-performance HTTP server and reverse proxy. It uses an event-driven architecture that distingtuishes it from the likes of Apache. It uses low-resources, and is used for high-performance environments. See: <a href="http://wiki.nginx.org/Main">http://wiki.nginx.org/Main</a> for more info.</p>
<p>First, download spawn-fcgi from <a href="http://redmine.lighttpd.net/projects/spawn-fcgi/news">http://redmine.lighttpd.net/projects/spawn-fcgi/news</a>:<br />
<strong><br />
% wget "http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz"</strong></p>
<p>Untar, install:<br />
<strong><br />
% tar xvfz spawn-fcgi-1.6.3.tar.gz<br />
% cd spawn-fcgi-1.6.3<br />
% ./configure && make && make install<br />
</strong><br />
Then, download nginx from <a href="http://nginx.org/en/download.html">http://nginx.org/en/download.html</a>:<br />
<strong><br />
% wget "http://nginx.org/download/nginx-0.8.40.tar.gz"<br />
</strong><br />
Untar, install:</p>
<p><strong>% tar xvfz nginx-0.8.40.tar.gz<br />
% cd nginx-0.8.40<br />
% ./configure && make && make install<br />
</strong><br />
This will install nginx in /usr/local/nginx/. You will then need to move the /usr/local/nginx/conf/nginx.conf file, and replace it with the file from: <a href="http://atmail.com/download/nginx.conf.txt">http://atmail.com/download/nginx.conf.txt</a><br />
<strong><br />
% mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.old<br />
% cd /usr/local/nginx/conf<br />
% wget "http://atmail.com/download/nginx.conf.txt"<br />
% mv nginx.conf.txt nginx.conf<br />
</strong><br />
Spawn the FastCGI process afterwards. For this example, we will run it in port 34480:</p>
<p><strong>% /usr/local/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 34480 -P /var/run/fastcgi-php.pid -C 2<br />
</strong><br />
You will then need to edit the /usr/local/nginx/conf/nginx.conf file. It will contain this line:</p>
<p><em>  fastcgi_pass   127.0.0.1:34480;  # IP and Port of your spawn-fcgi process<br />
</em><br />
If you change the spawn-fcgi port, you will need to edit it in the nginx.conf file as well. For example, a spawn-fcgi port of 51000 will have this command:<br />
<em><br />
/usr/local/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 51000 -P /var/run/fastcgi-php.pid -C 2<br />
</em><br />
And this configuration line:</p>
<p><em>  fastcgi_pass   127.0.0.1:51000;  # IP and Port of your spawn-fcgi process<br />
</em><br />
The configuration file will also contain the following lines of interest:<br />
<em><br />
root   /usr/local/atmail/webmail/;  </em></p>
<p>This defines the document root you wish to have.<br />
<em><br />
user  atmail;</em></p>
<p>This defines the username you want to run nginx as.<br />
<em><br />
worker_processes  2;</em></p>
<p>This sets the number of processes that nginx spawns. We recommend it to be set to the number of CPU cores you have available.</p>
<p>When you are satisfied, run the nginx process:<br />
<strong><br />
% /usr/local/nginx/sbin/nginx</strong>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/nginx-and-atmail/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Speed up Atmail with eAccelerator</title>
		<link>http://atmail.com/kb/2010/speed-up-atmail-with-eaccelerator/</link>
		<comments>http://atmail.com/kb/2010/speed-up-atmail-with-eaccelerator/#comments</comments>
		<pubDate>Mon, 31 May 2010 06:25:48 +0000</pubDate>
		<dc:creator>John Contad</dc:creator>
		
	<category>Uncategorized</category>
	<category>Optimization</category>
	<category>Improvements and Fixes</category>
	<category>Atmail 5</category>
	<category>Atmail 6</category>
		<guid isPermaLink="false">http://atmail.com/kb/2010/speed-up-atmail-with-eaccelerator/</guid>
		<description><![CDATA[This guide covers the steps you need to take to install EAccelerator (http://eaccelerator.net). eAccelerator is a free open-source PHP accelerator and optimizer. It optimizes scripts to speed up their execution, typically reducing server load and increasing the speed of your PHP code by up to ten times.
First, download the latest version of EAccelerator from: http://bart.eaccelerator.net/source/
% [...]]]></description>
			<content:encoded><![CDATA[<p>This guide covers the steps you need to take to install EAccelerator (<a href="http://eaccelerator.net">http://eaccelerator.net</a>). eAccelerator is a free open-source PHP accelerator and optimizer. It optimizes scripts to speed up their execution, typically reducing server load and increasing the speed of your PHP code by up to ten times.</p>
<p>First, download the latest version of EAccelerator from: <a target="_blank" href="http://bart.eaccelerator.net/source/">http://bart.eaccelerator.net/source/</a><br />
<br style="font-weight: bold" /><span style="font-weight: bold">% wget "http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2"</span></p>
<p>Untar, then go to the unpacked directory:<br />
<br style="font-weight: bold" /><span style="font-weight: bold">% tar xvfj eaccelerator-0.9.6.tar.bz2</span><br style="font-weight: bold" /><span style="font-weight: bold">% cd eaccelerator-0.9.6</span></p>
<p>Find the base directory of your PHP installation. Typically, this resides two directories down from where your PHP binary is. For this guide, we will assume that php is installed in "<span style="font-weight: bold">/usr/local/bin/php</span>" - therefore, making the base directory <span style="font-weight: bold">"/usr/local"</span>.</p>
<p>Execute the following commands inside the eAccelerator directory:<br />
<br style="font-weight: bold" /><span style="font-weight: bold">% export PHP_PREFIX="/usr/local/"</span><br style="font-weight: bold" /><span style="font-weight: bold">% $PHP_PREFIX/bin/phpize</span><br style="font-weight: bold" /><br />
Then, run the configure script:<br />
<br style="font-weight: bold" /><span style="font-weight: bold">% ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config</span><br style="font-weight: bold" /><span style="font-weight: bold">% make</span><br style="font-weight: bold" /><span style="font-weight: bold">% make install</span></p>
<p>The last command will output a path. Take note of this. For our example, the path will look like:<br />
<br style="font-style: italic" /><span style="font-style: italic">Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/</span></p>
<p>Find your php.ini file. It is commonly under /etc/php.ini or /usr/local/lib/php.ini. Add these lines to your php.ini file:<br />
<br style="font-style: italic" /><span style="font-style: italic">[eaccelerator]</span><br style="font-style: italic" /><br style="font-style: italic; font-weight: bold" /><span style="font-style: italic; font-weight: bold">zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.shm_size="16"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.cache_dir="/tmp/eaccelerator"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.enable="1"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.optimizer="1"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.check_mtime="1"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.debug="0"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.filter=""</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.shm_max="0"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.shm_ttl="0"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.shm_prune_period="0"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.shm_only="0"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.compress="1"</span><br style="font-style: italic" /><span style="font-style: italic">eaccelerator.compress_level="9"</span></p>
<p>Make sure that the line in bold (zend_extension) is defined as the same path you took note of earlier in the installation. Restart Apache afterwards:<br />
<br style="font-weight: bold" /><span style="font-weight: bold">% apachectl restart</span></p>
<p>To test if eAccelerator is active, execute the following command:<br />
<br style="font-weight: bold" /><span style="font-weight: bold">% php -v</span><br style="font-weight: bold" /><br />
This should output something similar to:<br />
<br style="font-style: italic" /><span style="font-style: italic">PHP 5.3.1 (cli) (built: Jan 14 2010 22:06:44) </span><br style="font-style: italic" /><span style="font-style: italic">Copyright (c) 1997-2009 The PHP Group</span><br style="font-style: italic" /><span style="font-style: italic">Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies</span><br style="font-style: italic" /><span style="font-style: italic">    with eAccelerator v0.9.6, Copyright (c) 2004-2010 eAccelerator, by eAccelerator</span></p>
<p>Congratulations! You now have eAccelerator active.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://atmail.com/kb/2010/speed-up-atmail-with-eaccelerator/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
