<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://alteeve.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dak1n1</id>
	<title>Alteeve Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://alteeve.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dak1n1"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/Special:Contributions/Dak1n1"/>
	<updated>2026-06-25T02:18:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4420</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4420"/>
		<updated>2012-08-20T01:31:57Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Basic Postfix Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=0&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=1&amp;lt;/span&amp;gt; to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/CentOS-Base.repo.orig /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/CentOS-Base.repo.orig	2012-05-07 01:07:47.688145406 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/CentOS-Base.repo	2012-05-07 01:08:15.915322496 -0400&lt;br /&gt;
@@ -18,0 +19 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -26,0 +28 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -34,0 +37 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -43,0 +47 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -52,0 +57 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/epel.repo.orig /etc/yum.repos.d/epel.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/epel.repo.orig	2012-05-07 01:08:58.279379860 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/epel.repo	2012-05-07 01:09:18.144157701 -0400&lt;br /&gt;
@@ -8,0 +9 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -17,0 +19 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -26,0 +29 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/denyhosts.conf /etc/denyhosts.conf.orig&lt;br /&gt;
vim /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/denyhosts.conf.orig /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/denyhosts.conf.orig	2012-05-13 02:33:05.584566483 -0400&lt;br /&gt;
+++ /etc/denyhosts.conf	2012-05-13 02:34:19.386558503 -0400&lt;br /&gt;
@@ -96 +96 @@&lt;br /&gt;
-#BLOCK_SERVICE = ALL&lt;br /&gt;
+BLOCK_SERVICE = ALL&lt;br /&gt;
@@ -98 +98 @@&lt;br /&gt;
-BLOCK_SERVICE  = sshd&lt;br /&gt;
+#BLOCK_SERVICE  = sshd&lt;br /&gt;
@@ -547 +547 @@&lt;br /&gt;
-#SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
+SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
@@ -582 +582 @@&lt;br /&gt;
-#SYNC_DOWNLOAD = yes&lt;br /&gt;
+SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/hosts.allow /etc/hosts.allow.orig&lt;br /&gt;
vim /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/hosts.allow.orig /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/hosts.allow.orig	2012-05-13 02:36:02.613767847 -0400&lt;br /&gt;
+++ /etc/hosts.allow	2012-05-13 02:40:37.473523845 -0400&lt;br /&gt;
@@ -10,0 +11,2 @@&lt;br /&gt;
+127.0.0.1&lt;br /&gt;
+206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig denyhosts on&lt;br /&gt;
/etc/init.d/denyhosts start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting denyhosts:                                        [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional software to install ===&lt;br /&gt;
To view neatly-summarized daily logs, and system resource usage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind \&lt;br /&gt;
            acpid bind-utils syslinux screen man bzip2 zip unzip php-pgsql php yum-utils&lt;br /&gt;
chkconfig acpid on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg perl-Digest-Perl-MD5 mod_auth_pgsql perl-Digest-SHA perl-CGI perl-Time-HiRes &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
Apache is configured first with a global configuration, which also defines the &amp;quot;default&amp;quot; website which is shown when the server is called by it&#039;s IP address (or by a domain that is not configured). Then with per-domain configurations known as &amp;quot;virtual host containers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
First, the global configuration and default domain. We will put our default website in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/default/&amp;lt;/span&amp;gt;. So the first step is to create the needed directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/default/{html,cgi-bin,logs}&lt;br /&gt;
chown -R apache:apache /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to edit the configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig&lt;br /&gt;
vim /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/httpd/conf/httpd.conf.orig	2012-05-13 19:32:07.718570148 -0400&lt;br /&gt;
+++ /etc/httpd/conf/httpd.conf	2012-05-13 21:48:18.439736244 -0400&lt;br /&gt;
@@ -103,6 +103,6 @@&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
@@ -119,5 +119,5 @@&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
@@ -262 +262 @@&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
@@ -276,0 +277 @@&lt;br /&gt;
+ServerName omiya.alteeve.ca:80&lt;br /&gt;
@@ -292 +293 @@&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
@@ -317 +318 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
@@ -551 +552 @@&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
@@ -553 +554 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
@@ -576 +577 @@&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
@@ -582 +583 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
@@ -855 +856 @@&lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
@@ -859 +860 @@&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
@@ -990 +991 @@&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
@@ -1004,5 +1005,5 @@&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
@@ -1009,0 +1011 @@&lt;br /&gt;
+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&amp;lt;/span&amp;gt; is expected at this stage as we&#039;ve not yet configured any virtual hosts.&lt;br /&gt;
&lt;br /&gt;
All virtual host configuration files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf.d&amp;lt;/span&amp;gt; directory and the file must have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.conf&amp;lt;/span&amp;gt; suffix in order to be read by apache. These files will be read in order, so if you want to ensure that one file is read before another, as we will do shortly, you can prefix the configuration file with an integer to ensure read order.&lt;br /&gt;
&lt;br /&gt;
I like to redirect all unknown server requests to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://unknown.alteeve.ca&amp;lt;/span&amp;gt;. For this, I will create an initial configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00_default.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/00_default.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerAdmin admin@alteeve.ca&lt;br /&gt;
        DocumentRoot /var/www/default/html&lt;br /&gt;
        ServerName unknown.alteeve.com&lt;br /&gt;
        ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
        CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will do two kinds of checks; One for syntax and one to check the configuration of virtual host containers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We no longer see the warning from before as we now have our first virtual host configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now start the web server for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting httpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Time to configure some real domains.&lt;br /&gt;
&lt;br /&gt;
== Common Virtual Host Configurations ==&lt;br /&gt;
&lt;br /&gt;
All domains on this server will be housed under either:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, for [[SSL]] encrypted domains;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/ssl_domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The four directories found under the domain are used for hosting executable scripts (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cgi-bin&amp;lt;/span&amp;gt;), standard [[HTML]] websites or websites with in-line code like [[PHP]] (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;html&amp;lt;/span&amp;gt;), log files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logs&amp;lt;/span&amp;gt;) and an optional temporary directory used for staging files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;temp&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Standard Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
This section covers the configuration on standard virtual host containers (using [[TCP]] port 80).&lt;br /&gt;
&lt;br /&gt;
In this example, we will setup the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://mizu-bu.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First, create the directories for the domain&#039;s files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/mizu-bu.org/{cgi-bin,html,logs,temp}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the virtual host container&#039;s configuration file. Note that in this example, it is a [http://www.mediawiki.org/ MediaWiki] website, so we will tell apache to look for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.php&amp;lt;/span&amp;gt; files by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/mizu-bu.org.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
	ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
	ServerName mizu-bu.org&lt;br /&gt;
        ServerAlias www.mizu-bu.org&lt;br /&gt;
&lt;br /&gt;
	DirectoryIndex index.html&lt;br /&gt;
    	&lt;br /&gt;
	DocumentRoot /var/www/mizu-bu.org/html/&lt;br /&gt;
	&amp;lt;Directory /var/www/mizu-bu.org/html&amp;gt;&lt;br /&gt;
		Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
		AllowOverride Options&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ScriptAlias /cgi-bin/ /var/www/mizu-bu.org/cgi-bin/&lt;br /&gt;
	&amp;lt;Directory &amp;quot;/var/www/mizu-bu.org/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
		AllowOverride None&lt;br /&gt;
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		Allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ErrorLog /var/www/mizu-bu.org/logs/error.log&lt;br /&gt;
&lt;br /&gt;
	# Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
	# alert, emerg.&lt;br /&gt;
	LogLevel debug&lt;br /&gt;
&lt;br /&gt;
	CustomLog /var/www/mizu-bu.org/logs/access.log combined&lt;br /&gt;
	ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, test the syntax and virtual host configurations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost mizu-bu.org (/etc/httpd/conf.d/mizu-bu.org.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
== Common apachectl -t Configuration Problems ==&lt;br /&gt;
&lt;br /&gt;
=== httpd: apr_sockaddr_info_get() failed for &amp;lt;domain&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Make sure that the hostname for the server resolves to an IP address. This is done by ensuring that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hostname&amp;lt;/span&amp;gt; has a [[DNS]] entry or has an entry in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== [warn] NameVirtualHost *:80 has no VirtualHosts ===&lt;br /&gt;
&lt;br /&gt;
This will be shown when no virtual host containers have been configured ye.&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
baseurl=http://vault.centos.org/6.3/os/Source/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
message_size_limit = 36700160 # increase max message size to 35MB to allow for ~25MB attachments&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RoundCube Web Mail ==&lt;br /&gt;
&lt;br /&gt;
Install the packages (these require the [[EPEL]] repo);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install roundcubemail php-pear-MDB2-Driver-pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to set the timezone in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/php.ini&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/php.ini /etc/php.ini.orig&lt;br /&gt;
vim /etc/php.ini&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;date.timezone&amp;lt;/span&amp;gt; value. If you aren&#039;t sure of the format or name of your timezone, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tzselect&amp;lt;/span&amp;gt; and follow the prompts. We want &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;America/Toronto&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/php.ini.orig /etc/php.ini&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/php.ini.orig	2012-08-18 22:27:05.244670258 -0400&lt;br /&gt;
+++ /etc/php.ini	2012-08-18 21:49:37.926938864 -0400&lt;br /&gt;
@@ -943,7 +943,7 @@&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone&lt;br /&gt;
-;date.timezone = &lt;br /&gt;
+date.timezone = America/Toronto&lt;br /&gt;
 &lt;br /&gt;
 ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.default-latitude&lt;br /&gt;
 ;date.default_latitude = 31.7667&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the database for roundcube&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createdb -O alteeve -E UNICODE roundcubemail&lt;br /&gt;
psql -U alteeve -D roundcubemail&lt;br /&gt;
\i /usr/share/doc/roundcubemail-0.5.4/SQL/postgres.initial.sql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit main configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/roundcubemail/main.inc.php &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$rcmail_config[&#039;default_host&#039;] = &#039;localhost&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_server&#039;] = &#039;tls://mail.alteeve.ca&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_user&#039;] = &#039;%u&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_pass&#039;] = &#039;%p&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;CRAM-MD5&#039;;&lt;br /&gt;
$rcmail_config[&#039;force_https&#039;] = true;&lt;br /&gt;
$rcmail_config[&#039;use_https&#039;] = true;&lt;br /&gt;
$rcmail_config[&#039;login_autocomplete&#039;] = 1;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup roundcube for connecting to our DB;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/roundcubemail/db.inc.php /etc/roundcubemail/db.inc.php.orig&lt;br /&gt;
vim /etc/roundcubemail/db.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now set the connection string. Note to switch the DB driver to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pgsql&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/roundcubemail/db.inc.php.orig /etc/roundcubemail/db.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/roundcubemail/db.inc.php.orig	2012-05-06 13:53:52.000000000 -0400&lt;br /&gt;
+++ /etc/roundcubemail/db.inc.php	2012-05-06 15:45:30.000000000 -0400&lt;br /&gt;
@@ -18,7 +18,7 @@&lt;br /&gt;
 // format is db_provider://user:password@host/database &lt;br /&gt;
 // For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php&lt;br /&gt;
 &lt;br /&gt;
-$rcmail_config[&#039;db_dsnw&#039;] = &#039;mysql://roundcube:pass@localhost/roundcubemail&#039;;&lt;br /&gt;
+$rcmail_config[&#039;db_dsnw&#039;] = &#039;pgsql://alteeve:secret@localhost/roundcubemail&#039;;&lt;br /&gt;
 // postgres example: &#039;pgsql://roundcube:pass@localhost/roundcubemail&#039;;&lt;br /&gt;
 // Warning: for SQLite use absolute path in DSN:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup roundcube to communicate with the mail server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/roundcubemail/main.inc.php /etc/roundcubemail/main.inc.php.orig&lt;br /&gt;
vim /etc/roundcubemail/main.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several variables to set. Our server will talk to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[tls]]&amp;lt;/span&amp;gt; on port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;587&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CRAM_MD5]]&amp;lt;/span&amp;gt; encryption. We use, and require, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[https]]&amp;lt;/span&amp;gt; connections. There are a couple special values for querying the user&#039;s name and password from the database. Finally, we want to enable the user&#039;s browser&#039;s auto-complete functions and set the name shown to the users. Once all set, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should be similar to the one below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/roundcubemail/main.inc.php.orig /etc/roundcubemail/main.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/roundcubemail/main.inc.php.orig	2012-05-06 13:53:59.000000000 -0400&lt;br /&gt;
+++ /etc/roundcubemail/main.inc.php	2012-07-06 14:59:07.000000000 -0400&lt;br /&gt;
@@ -65,7 +65,7 @@&lt;br /&gt;
 // %n - http hostname ($_SERVER[&#039;SERVER_NAME&#039;])&lt;br /&gt;
 // %d - domain (http hostname without the first part)&lt;br /&gt;
 // For example %n = mail.domain.tld, %d = domain.tld&lt;br /&gt;
-$rcmail_config[&#039;default_host&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;default_host&#039;] = &#039;localhost&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // TCP port used for IMAP connections&lt;br /&gt;
 $rcmail_config[&#039;default_port&#039;] = 143;&lt;br /&gt;
@@ -121,22 +121,22 @@&lt;br /&gt;
 // %d - domain (http hostname without the first part)&lt;br /&gt;
 // %z - IMAP domain (IMAP hostname without the first part)&lt;br /&gt;
 // For example %n = mail.domain.tld, %d = domain.tld&lt;br /&gt;
-$rcmail_config[&#039;smtp_server&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_server&#039;] = &#039;tls://mail.alteeve.ca&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP port (default is 25; 465 for SSL)&lt;br /&gt;
-$rcmail_config[&#039;smtp_port&#039;] = 25;&lt;br /&gt;
+$rcmail_config[&#039;smtp_port&#039;] = 587;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP username (if required) if you use %u as the username Roundcube&lt;br /&gt;
 // will use the current username for login&lt;br /&gt;
-$rcmail_config[&#039;smtp_user&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_user&#039;] = &#039;%u&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP password (if required) if you use %p as the password Roundcube&lt;br /&gt;
 // will use the current user&#039;s password for login&lt;br /&gt;
-$rcmail_config[&#039;smtp_pass&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_pass&#039;] = &#039;%p&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use&lt;br /&gt;
 // best server supported one)&lt;br /&gt;
-$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;CRAM-MD5&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // Optional SMTP authentication identifier to be used as authorization proxy&lt;br /&gt;
 $rcmail_config[&#039;smtp_auth_cid&#039;] = null;&lt;br /&gt;
@@ -179,16 +179,16 @@&lt;br /&gt;
 // enforce connections over https&lt;br /&gt;
 // with this option enabled, all non-secure connections will be redirected.&lt;br /&gt;
 // set the port for the ssl connection as value of this option if it differs from the default 443&lt;br /&gt;
-$rcmail_config[&#039;force_https&#039;] = false;&lt;br /&gt;
+$rcmail_config[&#039;force_https&#039;] = true;&lt;br /&gt;
 &lt;br /&gt;
 // tell PHP that it should work as under secure connection&lt;br /&gt;
 // even if it doesn&#039;t recognize it as secure ($_SERVER[&#039;HTTPS&#039;] is not set)&lt;br /&gt;
 // e.g. when you&#039;re running Roundcube behind a https proxy&lt;br /&gt;
-$rcmail_config[&#039;use_https&#039;] = false;&lt;br /&gt;
+$rcmail_config[&#039;use_https&#039;] = true;&lt;br /&gt;
 &lt;br /&gt;
 // Allow browser-autocompletion on login form.&lt;br /&gt;
 // 0 - disabled, 1 - username and host only, 2 - username, host, password&lt;br /&gt;
-$rcmail_config[&#039;login_autocomplete&#039;] = 0;&lt;br /&gt;
+$rcmail_config[&#039;login_autocomplete&#039;] = 1;&lt;br /&gt;
 &lt;br /&gt;
 // If users authentication is not case sensitive this must be enabled.&lt;br /&gt;
 // You can also use it to force conversion of logins to lower case.&lt;br /&gt;
@@ -261,7 +261,7 @@&lt;br /&gt;
 $rcmail_config[&#039;useragent&#039;] = &#039;Roundcube Webmail/&#039;.RCMAIL_VERSION;&lt;br /&gt;
 &lt;br /&gt;
 // use this name to compose page titles&lt;br /&gt;
-$rcmail_config[&#039;product_name&#039;] = &#039;Roundcube Webmail&#039;;&lt;br /&gt;
+$rcmail_config[&#039;product_name&#039;] = &#039;AN!Mail&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // try to load host-specific configuration&lt;br /&gt;
 // see http://trac.roundcube.net/wiki/Howto_Config for more details&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it.&lt;br /&gt;
&lt;br /&gt;
==== Adding a password-reset link to the login page ====&lt;br /&gt;
&lt;br /&gt;
Edit the login page template to insert the AN!Console password recovery link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /usr/share/roundcubemail/skins/default/templates/login.html&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The part we&#039;re adding is the &#039;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&#039;. Other parts of the template file are included here as a reference.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;login-form&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxtitle&amp;quot;&amp;gt;&amp;lt;roundcube:label name=&amp;quot;welcome&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxcontent&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form name=&amp;quot;form&amp;quot; action=&amp;quot;./&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;roundcube:object name=&amp;quot;loginform&amp;quot; form=&amp;quot;form&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align:center;&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; class=&amp;quot;button mainaction&amp;quot; value=&amp;quot;&amp;lt;roundcube:label name=&#039;login&#039; /&amp;gt;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;../../cgi-bin/t/password.cgi&amp;quot;&amp;gt;Forgot your password?&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4416</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4416"/>
		<updated>2012-08-19T13:27:51Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* RoundCube Web Mail */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=0&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=1&amp;lt;/span&amp;gt; to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/CentOS-Base.repo.orig /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/CentOS-Base.repo.orig	2012-05-07 01:07:47.688145406 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/CentOS-Base.repo	2012-05-07 01:08:15.915322496 -0400&lt;br /&gt;
@@ -18,0 +19 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -26,0 +28 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -34,0 +37 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -43,0 +47 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -52,0 +57 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/epel.repo.orig /etc/yum.repos.d/epel.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/epel.repo.orig	2012-05-07 01:08:58.279379860 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/epel.repo	2012-05-07 01:09:18.144157701 -0400&lt;br /&gt;
@@ -8,0 +9 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -17,0 +19 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -26,0 +29 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/denyhosts.conf /etc/denyhosts.conf.orig&lt;br /&gt;
vim /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/denyhosts.conf.orig /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/denyhosts.conf.orig	2012-05-13 02:33:05.584566483 -0400&lt;br /&gt;
+++ /etc/denyhosts.conf	2012-05-13 02:34:19.386558503 -0400&lt;br /&gt;
@@ -96 +96 @@&lt;br /&gt;
-#BLOCK_SERVICE = ALL&lt;br /&gt;
+BLOCK_SERVICE = ALL&lt;br /&gt;
@@ -98 +98 @@&lt;br /&gt;
-BLOCK_SERVICE  = sshd&lt;br /&gt;
+#BLOCK_SERVICE  = sshd&lt;br /&gt;
@@ -547 +547 @@&lt;br /&gt;
-#SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
+SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
@@ -582 +582 @@&lt;br /&gt;
-#SYNC_DOWNLOAD = yes&lt;br /&gt;
+SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/hosts.allow /etc/hosts.allow.orig&lt;br /&gt;
vim /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/hosts.allow.orig /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/hosts.allow.orig	2012-05-13 02:36:02.613767847 -0400&lt;br /&gt;
+++ /etc/hosts.allow	2012-05-13 02:40:37.473523845 -0400&lt;br /&gt;
@@ -10,0 +11,2 @@&lt;br /&gt;
+127.0.0.1&lt;br /&gt;
+206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig denyhosts on&lt;br /&gt;
/etc/init.d/denyhosts start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting denyhosts:                                        [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional software to install ===&lt;br /&gt;
To view neatly-summarized daily logs, and system resource usage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind \&lt;br /&gt;
            acpid bind-utils syslinux screen man bzip2 zip unzip php-pgsql php yum-utils&lt;br /&gt;
chkconfig acpid on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg perl-Digest-Perl-MD5 mod_auth_pgsql perl-Digest-SHA perl-CGI perl-Time-HiRes &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
Apache is configured first with a global configuration, which also defines the &amp;quot;default&amp;quot; website which is shown when the server is called by it&#039;s IP address (or by a domain that is not configured). Then with per-domain configurations known as &amp;quot;virtual host containers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
First, the global configuration and default domain. We will put our default website in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/default/&amp;lt;/span&amp;gt;. So the first step is to create the needed directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/default/{html,cgi-bin,logs}&lt;br /&gt;
chown -R apache:apache /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to edit the configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig&lt;br /&gt;
vim /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/httpd/conf/httpd.conf.orig	2012-05-13 19:32:07.718570148 -0400&lt;br /&gt;
+++ /etc/httpd/conf/httpd.conf	2012-05-13 21:48:18.439736244 -0400&lt;br /&gt;
@@ -103,6 +103,6 @@&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
@@ -119,5 +119,5 @@&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
@@ -262 +262 @@&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
@@ -276,0 +277 @@&lt;br /&gt;
+ServerName omiya.alteeve.ca:80&lt;br /&gt;
@@ -292 +293 @@&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
@@ -317 +318 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
@@ -551 +552 @@&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
@@ -553 +554 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
@@ -576 +577 @@&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
@@ -582 +583 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
@@ -855 +856 @@&lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
@@ -859 +860 @@&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
@@ -990 +991 @@&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
@@ -1004,5 +1005,5 @@&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
@@ -1009,0 +1011 @@&lt;br /&gt;
+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&amp;lt;/span&amp;gt; is expected at this stage as we&#039;ve not yet configured any virtual hosts.&lt;br /&gt;
&lt;br /&gt;
All virtual host configuration files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf.d&amp;lt;/span&amp;gt; directory and the file must have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.conf&amp;lt;/span&amp;gt; suffix in order to be read by apache. These files will be read in order, so if you want to ensure that one file is read before another, as we will do shortly, you can prefix the configuration file with an integer to ensure read order.&lt;br /&gt;
&lt;br /&gt;
I like to redirect all unknown server requests to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://unknown.alteeve.ca&amp;lt;/span&amp;gt;. For this, I will create an initial configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00_default.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/00_default.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerAdmin admin@alteeve.ca&lt;br /&gt;
        DocumentRoot /var/www/default/html&lt;br /&gt;
        ServerName unknown.alteeve.com&lt;br /&gt;
        ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
        CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will do two kinds of checks; One for syntax and one to check the configuration of virtual host containers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We no longer see the warning from before as we now have our first virtual host configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now start the web server for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting httpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Time to configure some real domains.&lt;br /&gt;
&lt;br /&gt;
== Common Virtual Host Configurations ==&lt;br /&gt;
&lt;br /&gt;
All domains on this server will be housed under either:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, for [[SSL]] encrypted domains;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/ssl_domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The four directories found under the domain are used for hosting executable scripts (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cgi-bin&amp;lt;/span&amp;gt;), standard [[HTML]] websites or websites with in-line code like [[PHP]] (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;html&amp;lt;/span&amp;gt;), log files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logs&amp;lt;/span&amp;gt;) and an optional temporary directory used for staging files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;temp&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Standard Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
This section covers the configuration on standard virtual host containers (using [[TCP]] port 80).&lt;br /&gt;
&lt;br /&gt;
In this example, we will setup the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://mizu-bu.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First, create the directories for the domain&#039;s files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/mizu-bu.org/{cgi-bin,html,logs,temp}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the virtual host container&#039;s configuration file. Note that in this example, it is a [http://www.mediawiki.org/ MediaWiki] website, so we will tell apache to look for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.php&amp;lt;/span&amp;gt; files by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/mizu-bu.org.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
	ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
	ServerName mizu-bu.org&lt;br /&gt;
        ServerAlias www.mizu-bu.org&lt;br /&gt;
&lt;br /&gt;
	DirectoryIndex index.html&lt;br /&gt;
    	&lt;br /&gt;
	DocumentRoot /var/www/mizu-bu.org/html/&lt;br /&gt;
	&amp;lt;Directory /var/www/mizu-bu.org/html&amp;gt;&lt;br /&gt;
		Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
		AllowOverride Options&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ScriptAlias /cgi-bin/ /var/www/mizu-bu.org/cgi-bin/&lt;br /&gt;
	&amp;lt;Directory &amp;quot;/var/www/mizu-bu.org/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
		AllowOverride None&lt;br /&gt;
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		Allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ErrorLog /var/www/mizu-bu.org/logs/error.log&lt;br /&gt;
&lt;br /&gt;
	# Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
	# alert, emerg.&lt;br /&gt;
	LogLevel debug&lt;br /&gt;
&lt;br /&gt;
	CustomLog /var/www/mizu-bu.org/logs/access.log combined&lt;br /&gt;
	ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, test the syntax and virtual host configurations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost mizu-bu.org (/etc/httpd/conf.d/mizu-bu.org.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
== Common apachectl -t Configuration Problems ==&lt;br /&gt;
&lt;br /&gt;
=== httpd: apr_sockaddr_info_get() failed for &amp;lt;domain&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Make sure that the hostname for the server resolves to an IP address. This is done by ensuring that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hostname&amp;lt;/span&amp;gt; has a [[DNS]] entry or has an entry in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== [warn] NameVirtualHost *:80 has no VirtualHosts ===&lt;br /&gt;
&lt;br /&gt;
This will be shown when no virtual host containers have been configured ye.&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
baseurl=http://vault.centos.org/6.3/os/Source/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RoundCube Web Mail ==&lt;br /&gt;
&lt;br /&gt;
Install the packages (these require the [[EPEL]] repo);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install roundcubemail php-pear-MDB2-Driver-pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to set the timezone in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/php.ini&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/php.ini /etc/php.ini.orig&lt;br /&gt;
vim /etc/php.ini&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;date.timezone&amp;lt;/span&amp;gt; value. If you aren&#039;t sure of the format or name of your timezone, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tzselect&amp;lt;/span&amp;gt; and follow the prompts. We want &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;America/Toronto&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/php.ini.orig /etc/php.ini&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/php.ini.orig	2012-08-18 22:27:05.244670258 -0400&lt;br /&gt;
+++ /etc/php.ini	2012-08-18 21:49:37.926938864 -0400&lt;br /&gt;
@@ -943,7 +943,7 @@&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone&lt;br /&gt;
-;date.timezone = &lt;br /&gt;
+date.timezone = America/Toronto&lt;br /&gt;
 &lt;br /&gt;
 ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.default-latitude&lt;br /&gt;
 ;date.default_latitude = 31.7667&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the database for roundcube&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createdb -O alteeve -E UNICODE roundcubemail&lt;br /&gt;
psql -U alteeve -D roundcubemail&lt;br /&gt;
\i /usr/share/doc/roundcubemail-0.5.4/SQL/postgres.initial.sql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit main configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/roundcubemail/main.inc.php &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$rcmail_config[&#039;default_host&#039;] = &#039;localhost&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_server&#039;] = &#039;tls://mail.alteeve.ca&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_user&#039;] = &#039;%u&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_pass&#039;] = &#039;%p&#039;;&lt;br /&gt;
$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;CRAM-MD5&#039;;&lt;br /&gt;
$rcmail_config[&#039;force_https&#039;] = true;&lt;br /&gt;
$rcmail_config[&#039;use_https&#039;] = true;&lt;br /&gt;
$rcmail_config[&#039;login_autocomplete&#039;] = 1;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup roundcube for connecting to our DB;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/roundcubemail/db.inc.php /etc/roundcubemail/db.inc.php.orig&lt;br /&gt;
vim /etc/roundcubemail/db.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now set the connection string. Note to switch the DB driver to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pgsql&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/roundcubemail/db.inc.php.orig /etc/roundcubemail/db.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/roundcubemail/db.inc.php.orig	2012-05-06 13:53:52.000000000 -0400&lt;br /&gt;
+++ /etc/roundcubemail/db.inc.php	2012-05-06 15:45:30.000000000 -0400&lt;br /&gt;
@@ -18,7 +18,7 @@&lt;br /&gt;
 // format is db_provider://user:password@host/database &lt;br /&gt;
 // For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php&lt;br /&gt;
 &lt;br /&gt;
-$rcmail_config[&#039;db_dsnw&#039;] = &#039;mysql://roundcube:pass@localhost/roundcubemail&#039;;&lt;br /&gt;
+$rcmail_config[&#039;db_dsnw&#039;] = &#039;pgsql://alteeve:secret@localhost/roundcubemail&#039;;&lt;br /&gt;
 // postgres example: &#039;pgsql://roundcube:pass@localhost/roundcubemail&#039;;&lt;br /&gt;
 // Warning: for SQLite use absolute path in DSN:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup roundcube to communicate with the mail server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/roundcubemail/main.inc.php /etc/roundcubemail/main.inc.php.orig&lt;br /&gt;
vim /etc/roundcubemail/main.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several variables to set. Our server will talk to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[tls]]&amp;lt;/span&amp;gt; on port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;587&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CRAM_MD5]]&amp;lt;/span&amp;gt; encryption. We use, and require, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[https]]&amp;lt;/span&amp;gt; connections. There are a couple special values for querying the user&#039;s name and password from the database. Finally, we want to enable the user&#039;s browser&#039;s auto-complete functions and set the name shown to the users. Once all set, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should be similar to the one below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/roundcubemail/main.inc.php.orig /etc/roundcubemail/main.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/roundcubemail/main.inc.php.orig	2012-05-06 13:53:59.000000000 -0400&lt;br /&gt;
+++ /etc/roundcubemail/main.inc.php	2012-07-06 14:59:07.000000000 -0400&lt;br /&gt;
@@ -65,7 +65,7 @@&lt;br /&gt;
 // %n - http hostname ($_SERVER[&#039;SERVER_NAME&#039;])&lt;br /&gt;
 // %d - domain (http hostname without the first part)&lt;br /&gt;
 // For example %n = mail.domain.tld, %d = domain.tld&lt;br /&gt;
-$rcmail_config[&#039;default_host&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;default_host&#039;] = &#039;localhost&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // TCP port used for IMAP connections&lt;br /&gt;
 $rcmail_config[&#039;default_port&#039;] = 143;&lt;br /&gt;
@@ -121,22 +121,22 @@&lt;br /&gt;
 // %d - domain (http hostname without the first part)&lt;br /&gt;
 // %z - IMAP domain (IMAP hostname without the first part)&lt;br /&gt;
 // For example %n = mail.domain.tld, %d = domain.tld&lt;br /&gt;
-$rcmail_config[&#039;smtp_server&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_server&#039;] = &#039;tls://mail.alteeve.ca&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP port (default is 25; 465 for SSL)&lt;br /&gt;
-$rcmail_config[&#039;smtp_port&#039;] = 25;&lt;br /&gt;
+$rcmail_config[&#039;smtp_port&#039;] = 587;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP username (if required) if you use %u as the username Roundcube&lt;br /&gt;
 // will use the current username for login&lt;br /&gt;
-$rcmail_config[&#039;smtp_user&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_user&#039;] = &#039;%u&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP password (if required) if you use %p as the password Roundcube&lt;br /&gt;
 // will use the current user&#039;s password for login&lt;br /&gt;
-$rcmail_config[&#039;smtp_pass&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_pass&#039;] = &#039;%p&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use&lt;br /&gt;
 // best server supported one)&lt;br /&gt;
-$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;CRAM-MD5&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // Optional SMTP authentication identifier to be used as authorization proxy&lt;br /&gt;
 $rcmail_config[&#039;smtp_auth_cid&#039;] = null;&lt;br /&gt;
@@ -179,16 +179,16 @@&lt;br /&gt;
 // enforce connections over https&lt;br /&gt;
 // with this option enabled, all non-secure connections will be redirected.&lt;br /&gt;
 // set the port for the ssl connection as value of this option if it differs from the default 443&lt;br /&gt;
-$rcmail_config[&#039;force_https&#039;] = false;&lt;br /&gt;
+$rcmail_config[&#039;force_https&#039;] = true;&lt;br /&gt;
 &lt;br /&gt;
 // tell PHP that it should work as under secure connection&lt;br /&gt;
 // even if it doesn&#039;t recognize it as secure ($_SERVER[&#039;HTTPS&#039;] is not set)&lt;br /&gt;
 // e.g. when you&#039;re running Roundcube behind a https proxy&lt;br /&gt;
-$rcmail_config[&#039;use_https&#039;] = false;&lt;br /&gt;
+$rcmail_config[&#039;use_https&#039;] = true;&lt;br /&gt;
 &lt;br /&gt;
 // Allow browser-autocompletion on login form.&lt;br /&gt;
 // 0 - disabled, 1 - username and host only, 2 - username, host, password&lt;br /&gt;
-$rcmail_config[&#039;login_autocomplete&#039;] = 0;&lt;br /&gt;
+$rcmail_config[&#039;login_autocomplete&#039;] = 1;&lt;br /&gt;
 &lt;br /&gt;
 // If users authentication is not case sensitive this must be enabled.&lt;br /&gt;
 // You can also use it to force conversion of logins to lower case.&lt;br /&gt;
@@ -261,7 +261,7 @@&lt;br /&gt;
 $rcmail_config[&#039;useragent&#039;] = &#039;Roundcube Webmail/&#039;.RCMAIL_VERSION;&lt;br /&gt;
 &lt;br /&gt;
 // use this name to compose page titles&lt;br /&gt;
-$rcmail_config[&#039;product_name&#039;] = &#039;Roundcube Webmail&#039;;&lt;br /&gt;
+$rcmail_config[&#039;product_name&#039;] = &#039;AN!Mail&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // try to load host-specific configuration&lt;br /&gt;
 // see http://trac.roundcube.net/wiki/Howto_Config for more details&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it.&lt;br /&gt;
&lt;br /&gt;
==== Adding a password-reset link to the login page ====&lt;br /&gt;
&lt;br /&gt;
Edit the login page template to insert the AN!Console password recovery link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /usr/share/roundcubemail/skins/default/templates/login.html&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The part we&#039;re adding is the &#039;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&#039;. Other parts of the template file are included here as a reference.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;login-form&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxtitle&amp;quot;&amp;gt;&amp;lt;roundcube:label name=&amp;quot;welcome&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxcontent&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form name=&amp;quot;form&amp;quot; action=&amp;quot;./&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;roundcube:object name=&amp;quot;loginform&amp;quot; form=&amp;quot;form&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align:center;&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; class=&amp;quot;button mainaction&amp;quot; value=&amp;quot;&amp;lt;roundcube:label name=&#039;login&#039; /&amp;gt;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;../../cgi-bin/t/password.cgi&amp;quot;&amp;gt;Forgot your password?&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4415</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4415"/>
		<updated>2012-08-19T13:25:32Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* RoundCube Web Mail */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=0&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=1&amp;lt;/span&amp;gt; to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/CentOS-Base.repo.orig /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/CentOS-Base.repo.orig	2012-05-07 01:07:47.688145406 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/CentOS-Base.repo	2012-05-07 01:08:15.915322496 -0400&lt;br /&gt;
@@ -18,0 +19 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -26,0 +28 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -34,0 +37 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -43,0 +47 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -52,0 +57 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/epel.repo.orig /etc/yum.repos.d/epel.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/epel.repo.orig	2012-05-07 01:08:58.279379860 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/epel.repo	2012-05-07 01:09:18.144157701 -0400&lt;br /&gt;
@@ -8,0 +9 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -17,0 +19 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -26,0 +29 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/denyhosts.conf /etc/denyhosts.conf.orig&lt;br /&gt;
vim /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/denyhosts.conf.orig /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/denyhosts.conf.orig	2012-05-13 02:33:05.584566483 -0400&lt;br /&gt;
+++ /etc/denyhosts.conf	2012-05-13 02:34:19.386558503 -0400&lt;br /&gt;
@@ -96 +96 @@&lt;br /&gt;
-#BLOCK_SERVICE = ALL&lt;br /&gt;
+BLOCK_SERVICE = ALL&lt;br /&gt;
@@ -98 +98 @@&lt;br /&gt;
-BLOCK_SERVICE  = sshd&lt;br /&gt;
+#BLOCK_SERVICE  = sshd&lt;br /&gt;
@@ -547 +547 @@&lt;br /&gt;
-#SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
+SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
@@ -582 +582 @@&lt;br /&gt;
-#SYNC_DOWNLOAD = yes&lt;br /&gt;
+SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/hosts.allow /etc/hosts.allow.orig&lt;br /&gt;
vim /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/hosts.allow.orig /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/hosts.allow.orig	2012-05-13 02:36:02.613767847 -0400&lt;br /&gt;
+++ /etc/hosts.allow	2012-05-13 02:40:37.473523845 -0400&lt;br /&gt;
@@ -10,0 +11,2 @@&lt;br /&gt;
+127.0.0.1&lt;br /&gt;
+206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig denyhosts on&lt;br /&gt;
/etc/init.d/denyhosts start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting denyhosts:                                        [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional software to install ===&lt;br /&gt;
To view neatly-summarized daily logs, and system resource usage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind \&lt;br /&gt;
            acpid bind-utils syslinux screen man bzip2 zip unzip php-pgsql php yum-utils&lt;br /&gt;
chkconfig acpid on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg perl-Digest-Perl-MD5 mod_auth_pgsql perl-Digest-SHA perl-CGI perl-Time-HiRes &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
Apache is configured first with a global configuration, which also defines the &amp;quot;default&amp;quot; website which is shown when the server is called by it&#039;s IP address (or by a domain that is not configured). Then with per-domain configurations known as &amp;quot;virtual host containers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
First, the global configuration and default domain. We will put our default website in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/default/&amp;lt;/span&amp;gt;. So the first step is to create the needed directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/default/{html,cgi-bin,logs}&lt;br /&gt;
chown -R apache:apache /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to edit the configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig&lt;br /&gt;
vim /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/httpd/conf/httpd.conf.orig	2012-05-13 19:32:07.718570148 -0400&lt;br /&gt;
+++ /etc/httpd/conf/httpd.conf	2012-05-13 21:48:18.439736244 -0400&lt;br /&gt;
@@ -103,6 +103,6 @@&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
@@ -119,5 +119,5 @@&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
@@ -262 +262 @@&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
@@ -276,0 +277 @@&lt;br /&gt;
+ServerName omiya.alteeve.ca:80&lt;br /&gt;
@@ -292 +293 @@&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
@@ -317 +318 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
@@ -551 +552 @@&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
@@ -553 +554 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
@@ -576 +577 @@&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
@@ -582 +583 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
@@ -855 +856 @@&lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
@@ -859 +860 @@&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
@@ -990 +991 @@&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
@@ -1004,5 +1005,5 @@&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
@@ -1009,0 +1011 @@&lt;br /&gt;
+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&amp;lt;/span&amp;gt; is expected at this stage as we&#039;ve not yet configured any virtual hosts.&lt;br /&gt;
&lt;br /&gt;
All virtual host configuration files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf.d&amp;lt;/span&amp;gt; directory and the file must have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.conf&amp;lt;/span&amp;gt; suffix in order to be read by apache. These files will be read in order, so if you want to ensure that one file is read before another, as we will do shortly, you can prefix the configuration file with an integer to ensure read order.&lt;br /&gt;
&lt;br /&gt;
I like to redirect all unknown server requests to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://unknown.alteeve.ca&amp;lt;/span&amp;gt;. For this, I will create an initial configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00_default.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/00_default.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerAdmin admin@alteeve.ca&lt;br /&gt;
        DocumentRoot /var/www/default/html&lt;br /&gt;
        ServerName unknown.alteeve.com&lt;br /&gt;
        ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
        CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will do two kinds of checks; One for syntax and one to check the configuration of virtual host containers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We no longer see the warning from before as we now have our first virtual host configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now start the web server for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting httpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Time to configure some real domains.&lt;br /&gt;
&lt;br /&gt;
== Common Virtual Host Configurations ==&lt;br /&gt;
&lt;br /&gt;
All domains on this server will be housed under either:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, for [[SSL]] encrypted domains;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/ssl_domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The four directories found under the domain are used for hosting executable scripts (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cgi-bin&amp;lt;/span&amp;gt;), standard [[HTML]] websites or websites with in-line code like [[PHP]] (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;html&amp;lt;/span&amp;gt;), log files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logs&amp;lt;/span&amp;gt;) and an optional temporary directory used for staging files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;temp&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Standard Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
This section covers the configuration on standard virtual host containers (using [[TCP]] port 80).&lt;br /&gt;
&lt;br /&gt;
In this example, we will setup the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://mizu-bu.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First, create the directories for the domain&#039;s files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/mizu-bu.org/{cgi-bin,html,logs,temp}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the virtual host container&#039;s configuration file. Note that in this example, it is a [http://www.mediawiki.org/ MediaWiki] website, so we will tell apache to look for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.php&amp;lt;/span&amp;gt; files by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/mizu-bu.org.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
	ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
	ServerName mizu-bu.org&lt;br /&gt;
        ServerAlias www.mizu-bu.org&lt;br /&gt;
&lt;br /&gt;
	DirectoryIndex index.html&lt;br /&gt;
    	&lt;br /&gt;
	DocumentRoot /var/www/mizu-bu.org/html/&lt;br /&gt;
	&amp;lt;Directory /var/www/mizu-bu.org/html&amp;gt;&lt;br /&gt;
		Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
		AllowOverride Options&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ScriptAlias /cgi-bin/ /var/www/mizu-bu.org/cgi-bin/&lt;br /&gt;
	&amp;lt;Directory &amp;quot;/var/www/mizu-bu.org/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
		AllowOverride None&lt;br /&gt;
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		Allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ErrorLog /var/www/mizu-bu.org/logs/error.log&lt;br /&gt;
&lt;br /&gt;
	# Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
	# alert, emerg.&lt;br /&gt;
	LogLevel debug&lt;br /&gt;
&lt;br /&gt;
	CustomLog /var/www/mizu-bu.org/logs/access.log combined&lt;br /&gt;
	ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, test the syntax and virtual host configurations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost mizu-bu.org (/etc/httpd/conf.d/mizu-bu.org.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
== Common apachectl -t Configuration Problems ==&lt;br /&gt;
&lt;br /&gt;
=== httpd: apr_sockaddr_info_get() failed for &amp;lt;domain&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Make sure that the hostname for the server resolves to an IP address. This is done by ensuring that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hostname&amp;lt;/span&amp;gt; has a [[DNS]] entry or has an entry in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== [warn] NameVirtualHost *:80 has no VirtualHosts ===&lt;br /&gt;
&lt;br /&gt;
This will be shown when no virtual host containers have been configured ye.&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
baseurl=http://vault.centos.org/6.3/os/Source/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RoundCube Web Mail ==&lt;br /&gt;
&lt;br /&gt;
Install the packages (these require the [[EPEL]] repo);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install roundcubemail php-pear-MDB2-Driver-pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to set the timezone in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/php.ini&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/php.ini /etc/php.ini.orig&lt;br /&gt;
vim /etc/php.ini&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;date.timezone&amp;lt;/span&amp;gt; value. If you aren&#039;t sure of the format or name of your timezone, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tzselect&amp;lt;/span&amp;gt; and follow the prompts. We want &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;America/Toronto&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/php.ini.orig /etc/php.ini&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/php.ini.orig	2012-08-18 22:27:05.244670258 -0400&lt;br /&gt;
+++ /etc/php.ini	2012-08-18 21:49:37.926938864 -0400&lt;br /&gt;
@@ -943,7 +943,7 @@&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone&lt;br /&gt;
-;date.timezone = &lt;br /&gt;
+date.timezone = America/Toronto&lt;br /&gt;
 &lt;br /&gt;
 ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.default-latitude&lt;br /&gt;
 ;date.default_latitude = 31.7667&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the database for roundcube&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createdb -O alteeve -E UNICODE roundcubemail&lt;br /&gt;
psql -U alteeve -D roundcubemail&lt;br /&gt;
\i /usr/share/doc/roundcubemail-0.5.4/SQL/postgres.initial.sql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup roundcube for connecting to our DB;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/roundcubemail/db.inc.php /etc/roundcubemail/db.inc.php.orig&lt;br /&gt;
vim /etc/roundcubemail/db.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now set the connection string. Note to switch the DB driver to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pgsql&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/roundcubemail/db.inc.php.orig /etc/roundcubemail/db.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/roundcubemail/db.inc.php.orig	2012-05-06 13:53:52.000000000 -0400&lt;br /&gt;
+++ /etc/roundcubemail/db.inc.php	2012-05-06 15:45:30.000000000 -0400&lt;br /&gt;
@@ -18,7 +18,7 @@&lt;br /&gt;
 // format is db_provider://user:password@host/database &lt;br /&gt;
 // For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php&lt;br /&gt;
 &lt;br /&gt;
-$rcmail_config[&#039;db_dsnw&#039;] = &#039;mysql://roundcube:pass@localhost/roundcubemail&#039;;&lt;br /&gt;
+$rcmail_config[&#039;db_dsnw&#039;] = &#039;pgsql://alteeve:secret@localhost/roundcubemail&#039;;&lt;br /&gt;
 // postgres example: &#039;pgsql://roundcube:pass@localhost/roundcubemail&#039;;&lt;br /&gt;
 // Warning: for SQLite use absolute path in DSN:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup roundcube to communicate with the mail server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/roundcubemail/main.inc.php /etc/roundcubemail/main.inc.php.orig&lt;br /&gt;
vim /etc/roundcubemail/main.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several variables to set. Our server will talk to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[tls]]&amp;lt;/span&amp;gt; on port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;587&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CRAM_MD5]]&amp;lt;/span&amp;gt; encryption. We use, and require, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[https]]&amp;lt;/span&amp;gt; connections. There are a couple special values for querying the user&#039;s name and password from the database. Finally, we want to enable the user&#039;s browser&#039;s auto-complete functions and set the name shown to the users. Once all set, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should be similar to the one below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/roundcubemail/main.inc.php.orig /etc/roundcubemail/main.inc.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/roundcubemail/main.inc.php.orig	2012-05-06 13:53:59.000000000 -0400&lt;br /&gt;
+++ /etc/roundcubemail/main.inc.php	2012-07-06 14:59:07.000000000 -0400&lt;br /&gt;
@@ -65,7 +65,7 @@&lt;br /&gt;
 // %n - http hostname ($_SERVER[&#039;SERVER_NAME&#039;])&lt;br /&gt;
 // %d - domain (http hostname without the first part)&lt;br /&gt;
 // For example %n = mail.domain.tld, %d = domain.tld&lt;br /&gt;
-$rcmail_config[&#039;default_host&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;default_host&#039;] = &#039;localhost&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // TCP port used for IMAP connections&lt;br /&gt;
 $rcmail_config[&#039;default_port&#039;] = 143;&lt;br /&gt;
@@ -121,22 +121,22 @@&lt;br /&gt;
 // %d - domain (http hostname without the first part)&lt;br /&gt;
 // %z - IMAP domain (IMAP hostname without the first part)&lt;br /&gt;
 // For example %n = mail.domain.tld, %d = domain.tld&lt;br /&gt;
-$rcmail_config[&#039;smtp_server&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_server&#039;] = &#039;tls://mail.alteeve.ca&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP port (default is 25; 465 for SSL)&lt;br /&gt;
-$rcmail_config[&#039;smtp_port&#039;] = 25;&lt;br /&gt;
+$rcmail_config[&#039;smtp_port&#039;] = 587;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP username (if required) if you use %u as the username Roundcube&lt;br /&gt;
 // will use the current username for login&lt;br /&gt;
-$rcmail_config[&#039;smtp_user&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_user&#039;] = &#039;%u&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP password (if required) if you use %p as the password Roundcube&lt;br /&gt;
 // will use the current user&#039;s password for login&lt;br /&gt;
-$rcmail_config[&#039;smtp_pass&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_pass&#039;] = &#039;%p&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use&lt;br /&gt;
 // best server supported one)&lt;br /&gt;
-$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;&#039;;&lt;br /&gt;
+$rcmail_config[&#039;smtp_auth_type&#039;] = &#039;CRAM-MD5&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // Optional SMTP authentication identifier to be used as authorization proxy&lt;br /&gt;
 $rcmail_config[&#039;smtp_auth_cid&#039;] = null;&lt;br /&gt;
@@ -179,16 +179,16 @@&lt;br /&gt;
 // enforce connections over https&lt;br /&gt;
 // with this option enabled, all non-secure connections will be redirected.&lt;br /&gt;
 // set the port for the ssl connection as value of this option if it differs from the default 443&lt;br /&gt;
-$rcmail_config[&#039;force_https&#039;] = false;&lt;br /&gt;
+$rcmail_config[&#039;force_https&#039;] = true;&lt;br /&gt;
 &lt;br /&gt;
 // tell PHP that it should work as under secure connection&lt;br /&gt;
 // even if it doesn&#039;t recognize it as secure ($_SERVER[&#039;HTTPS&#039;] is not set)&lt;br /&gt;
 // e.g. when you&#039;re running Roundcube behind a https proxy&lt;br /&gt;
-$rcmail_config[&#039;use_https&#039;] = false;&lt;br /&gt;
+$rcmail_config[&#039;use_https&#039;] = true;&lt;br /&gt;
 &lt;br /&gt;
 // Allow browser-autocompletion on login form.&lt;br /&gt;
 // 0 - disabled, 1 - username and host only, 2 - username, host, password&lt;br /&gt;
-$rcmail_config[&#039;login_autocomplete&#039;] = 0;&lt;br /&gt;
+$rcmail_config[&#039;login_autocomplete&#039;] = 1;&lt;br /&gt;
 &lt;br /&gt;
 // If users authentication is not case sensitive this must be enabled.&lt;br /&gt;
 // You can also use it to force conversion of logins to lower case.&lt;br /&gt;
@@ -261,7 +261,7 @@&lt;br /&gt;
 $rcmail_config[&#039;useragent&#039;] = &#039;Roundcube Webmail/&#039;.RCMAIL_VERSION;&lt;br /&gt;
 &lt;br /&gt;
 // use this name to compose page titles&lt;br /&gt;
-$rcmail_config[&#039;product_name&#039;] = &#039;Roundcube Webmail&#039;;&lt;br /&gt;
+$rcmail_config[&#039;product_name&#039;] = &#039;AN!Mail&#039;;&lt;br /&gt;
 &lt;br /&gt;
 // try to load host-specific configuration&lt;br /&gt;
 // see http://trac.roundcube.net/wiki/Howto_Config for more details&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That should be it.&lt;br /&gt;
&lt;br /&gt;
==== Adding a password-reset link to the login page ====&lt;br /&gt;
&lt;br /&gt;
Edit the login page template to insert the AN!Console password recovery link.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /usr/share/roundcubemail/skins/default/templates/login.html&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The part we&#039;re adding is the &#039;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&#039;. Other parts of the template file are included here as a reference.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;login-form&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxtitle&amp;quot;&amp;gt;&amp;lt;roundcube:label name=&amp;quot;welcome&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxcontent&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form name=&amp;quot;form&amp;quot; action=&amp;quot;./&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;roundcube:object name=&amp;quot;loginform&amp;quot; form=&amp;quot;form&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align:center;&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; class=&amp;quot;button mainaction&amp;quot; value=&amp;quot;&amp;lt;roundcube:label name=&#039;login&#039; /&amp;gt;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;../../cgi-bin/t/password.cgi&amp;quot;&amp;gt;Forgot your password?&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4343</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4343"/>
		<updated>2012-06-15T22:11:43Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Adding a password-reset link to the login page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=0&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=1&amp;lt;/span&amp;gt; to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/CentOS-Base.repo.orig /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/CentOS-Base.repo.orig	2012-05-07 01:07:47.688145406 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/CentOS-Base.repo	2012-05-07 01:08:15.915322496 -0400&lt;br /&gt;
@@ -18,0 +19 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -26,0 +28 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -34,0 +37 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -43,0 +47 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -52,0 +57 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/epel.repo.orig /etc/yum.repos.d/epel.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/epel.repo.orig	2012-05-07 01:08:58.279379860 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/epel.repo	2012-05-07 01:09:18.144157701 -0400&lt;br /&gt;
@@ -8,0 +9 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -17,0 +19 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -26,0 +29 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/denyhosts.conf /etc/denyhosts.conf.orig&lt;br /&gt;
vim /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/denyhosts.conf.orig /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/denyhosts.conf.orig	2012-05-13 02:33:05.584566483 -0400&lt;br /&gt;
+++ /etc/denyhosts.conf	2012-05-13 02:34:19.386558503 -0400&lt;br /&gt;
@@ -96 +96 @@&lt;br /&gt;
-#BLOCK_SERVICE = ALL&lt;br /&gt;
+BLOCK_SERVICE = ALL&lt;br /&gt;
@@ -98 +98 @@&lt;br /&gt;
-BLOCK_SERVICE  = sshd&lt;br /&gt;
+#BLOCK_SERVICE  = sshd&lt;br /&gt;
@@ -547 +547 @@&lt;br /&gt;
-#SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
+SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
@@ -582 +582 @@&lt;br /&gt;
-#SYNC_DOWNLOAD = yes&lt;br /&gt;
+SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/hosts.allow /etc/hosts.allow.orig&lt;br /&gt;
vim /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/hosts.allow.orig /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/hosts.allow.orig	2012-05-13 02:36:02.613767847 -0400&lt;br /&gt;
+++ /etc/hosts.allow	2012-05-13 02:40:37.473523845 -0400&lt;br /&gt;
@@ -10,0 +11,2 @@&lt;br /&gt;
+127.0.0.1&lt;br /&gt;
+206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig denyhosts on&lt;br /&gt;
/etc/init.d/denyhosts start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting denyhosts:                                        [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional software to install ===&lt;br /&gt;
To view neatly-summarized daily logs, and system resource usage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind \&lt;br /&gt;
            acpid bind-utils syslinux&lt;br /&gt;
chkconfig acpid on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg perl-Digest-Perl-MD5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
Apache is configured first with a global configuration, which also defines the &amp;quot;default&amp;quot; website which is shown when the server is called by it&#039;s IP address (or by a domain that is not configured). Then with per-domain configurations known as &amp;quot;virtual host containers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
First, the global configuration and default domain. We will put our default website in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/default/&amp;lt;/span&amp;gt;. So the first step is to create the needed directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/default/{html,cgi-bin,logs}&lt;br /&gt;
chown -R apache:apache /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to edit the configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig&lt;br /&gt;
vim /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/httpd/conf/httpd.conf.orig	2012-05-13 19:32:07.718570148 -0400&lt;br /&gt;
+++ /etc/httpd/conf/httpd.conf	2012-05-13 21:48:18.439736244 -0400&lt;br /&gt;
@@ -103,6 +103,6 @@&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
@@ -119,5 +119,5 @@&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
@@ -262 +262 @@&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
@@ -276,0 +277 @@&lt;br /&gt;
+ServerName omiya.alteeve.ca:80&lt;br /&gt;
@@ -292 +293 @@&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
@@ -317 +318 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
@@ -551 +552 @@&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
@@ -553 +554 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
@@ -576 +577 @@&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
@@ -582 +583 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
@@ -855 +856 @@&lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
@@ -859 +860 @@&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
@@ -990 +991 @@&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
@@ -1004,5 +1005,5 @@&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
@@ -1009,0 +1011 @@&lt;br /&gt;
+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&amp;lt;/span&amp;gt; is expected at this stage as we&#039;ve not yet configured any virtual hosts.&lt;br /&gt;
&lt;br /&gt;
All virtual host configuration files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf.d&amp;lt;/span&amp;gt; directory and the file must have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.conf&amp;lt;/span&amp;gt; suffix in order to be read by apache. These files will be read in order, so if you want to ensure that one file is read before another, as we will do shortly, you can prefix the configuration file with an integer to ensure read order.&lt;br /&gt;
&lt;br /&gt;
I like to redirect all unknown server requests to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://unknown.alteeve.ca&amp;lt;/span&amp;gt;. For this, I will create an initial configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00_default.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/00_default.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerAdmin admin@alteeve.ca&lt;br /&gt;
        DocumentRoot /var/www/default/html&lt;br /&gt;
        ServerName unknown.alteeve.com&lt;br /&gt;
        ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
        CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will do two kinds of checks; One for syntax and one to check the configuration of virtual host containers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We no longer see the warning from before as we now have our first virtual host configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now start the web server for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting httpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Time to configure some real domains.&lt;br /&gt;
&lt;br /&gt;
== Common Virtual Host Configurations ==&lt;br /&gt;
&lt;br /&gt;
All domains on this server will be housed under either:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, for [[SSL]] encrypted domains;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/ssl_domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The four directories found under the domain are used for hosting executable scripts (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cgi-bin&amp;lt;/span&amp;gt;), standard [[HTML]] websites or websites with in-line code like [[PHP]] (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;html&amp;lt;/span&amp;gt;), log files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logs&amp;lt;/span&amp;gt;) and an optional temporary directory used for staging files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;temp&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Standard Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
This section covers the configuration on standard virtual host containers (using [[TCP]] port 80).&lt;br /&gt;
&lt;br /&gt;
In this example, we will setup the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://mizu-bu.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First, create the directories for the domain&#039;s files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/mizu-bu.org/{cgi-bin,html,logs,temp}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the virtual host container&#039;s configuration file. Note that in this example, it is a [http://www.mediawiki.org/ MediaWiki] website, so we will tell apache to look for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.php&amp;lt;/span&amp;gt; files by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/mizu-bu.org.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
	ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
	ServerName mizu-bu.org&lt;br /&gt;
        ServerAlias www.mizu-bu.org&lt;br /&gt;
&lt;br /&gt;
	DirectoryIndex index.html&lt;br /&gt;
    	&lt;br /&gt;
	DocumentRoot /var/www/mizu-bu.org/html/&lt;br /&gt;
	&amp;lt;Directory /var/www/mizu-bu.org/html&amp;gt;&lt;br /&gt;
		Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
		AllowOverride Options&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ScriptAlias /cgi-bin/ /var/www/mizu-bu.org/cgi-bin/&lt;br /&gt;
	&amp;lt;Directory &amp;quot;/var/www/mizu-bu.org/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
		AllowOverride None&lt;br /&gt;
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		Allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ErrorLog /var/www/mizu-bu.org/logs/error.log&lt;br /&gt;
&lt;br /&gt;
	# Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
	# alert, emerg.&lt;br /&gt;
	LogLevel debug&lt;br /&gt;
&lt;br /&gt;
	CustomLog /var/www/mizu-bu.org/logs/access.log combined&lt;br /&gt;
	ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, test the syntax and virtual host configurations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost mizu-bu.org (/etc/httpd/conf.d/mizu-bu.org.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
== Common apachectl -t Configuration Problems ==&lt;br /&gt;
&lt;br /&gt;
=== httpd: apr_sockaddr_info_get() failed for &amp;lt;domain&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Make sure that the hostname for the server resolves to an IP address. This is done by ensuring that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hostname&amp;lt;/span&amp;gt; has a [[DNS]] entry or has an entry in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== [warn] NameVirtualHost *:80 has no VirtualHosts ===&lt;br /&gt;
&lt;br /&gt;
This will be shown when no virtual host containers have been configured ye.&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RoundCube Web Mail ==&lt;br /&gt;
Poke dak1n1 to document this!&lt;br /&gt;
&lt;br /&gt;
==== Adding a password-reset link to the login page ====&lt;br /&gt;
Edit the login page template to insert the link.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /usr/share/roundcubemail/skins/default/templates/login.html&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The part we&#039;re adding is the &#039;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&#039;. Other parts of the template file are included here as a reference.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;login-form&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxtitle&amp;quot;&amp;gt;&amp;lt;roundcube:label name=&amp;quot;welcome&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxcontent&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form name=&amp;quot;form&amp;quot; action=&amp;quot;./&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;roundcube:object name=&amp;quot;loginform&amp;quot; form=&amp;quot;form&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align:center;&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; class=&amp;quot;button mainaction&amp;quot; value=&amp;quot;&amp;lt;roundcube:label name=&#039;login&#039; /&amp;gt;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;../../cgi-bin/t/password.cgi&amp;quot;&amp;gt;Forgot your password?&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4342</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4342"/>
		<updated>2012-06-15T22:10:31Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Postgrey Greylisting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=0&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=1&amp;lt;/span&amp;gt; to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/CentOS-Base.repo.orig /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/CentOS-Base.repo.orig	2012-05-07 01:07:47.688145406 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/CentOS-Base.repo	2012-05-07 01:08:15.915322496 -0400&lt;br /&gt;
@@ -18,0 +19 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -26,0 +28 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -34,0 +37 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -43,0 +47 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -52,0 +57 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/epel.repo.orig /etc/yum.repos.d/epel.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/epel.repo.orig	2012-05-07 01:08:58.279379860 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/epel.repo	2012-05-07 01:09:18.144157701 -0400&lt;br /&gt;
@@ -8,0 +9 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -17,0 +19 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -26,0 +29 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/denyhosts.conf /etc/denyhosts.conf.orig&lt;br /&gt;
vim /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/denyhosts.conf.orig /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/denyhosts.conf.orig	2012-05-13 02:33:05.584566483 -0400&lt;br /&gt;
+++ /etc/denyhosts.conf	2012-05-13 02:34:19.386558503 -0400&lt;br /&gt;
@@ -96 +96 @@&lt;br /&gt;
-#BLOCK_SERVICE = ALL&lt;br /&gt;
+BLOCK_SERVICE = ALL&lt;br /&gt;
@@ -98 +98 @@&lt;br /&gt;
-BLOCK_SERVICE  = sshd&lt;br /&gt;
+#BLOCK_SERVICE  = sshd&lt;br /&gt;
@@ -547 +547 @@&lt;br /&gt;
-#SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
+SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
@@ -582 +582 @@&lt;br /&gt;
-#SYNC_DOWNLOAD = yes&lt;br /&gt;
+SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/hosts.allow /etc/hosts.allow.orig&lt;br /&gt;
vim /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/hosts.allow.orig /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/hosts.allow.orig	2012-05-13 02:36:02.613767847 -0400&lt;br /&gt;
+++ /etc/hosts.allow	2012-05-13 02:40:37.473523845 -0400&lt;br /&gt;
@@ -10,0 +11,2 @@&lt;br /&gt;
+127.0.0.1&lt;br /&gt;
+206.108.5.162&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig denyhosts on&lt;br /&gt;
/etc/init.d/denyhosts start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting denyhosts:                                        [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional software to install ===&lt;br /&gt;
To view neatly-summarized daily logs, and system resource usage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind \&lt;br /&gt;
            acpid bind-utils syslinux&lt;br /&gt;
chkconfig acpid on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg perl-Digest-Perl-MD5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
Apache is configured first with a global configuration, which also defines the &amp;quot;default&amp;quot; website which is shown when the server is called by it&#039;s IP address (or by a domain that is not configured). Then with per-domain configurations known as &amp;quot;virtual host containers&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
First, the global configuration and default domain. We will put our default website in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/default/&amp;lt;/span&amp;gt;. So the first step is to create the needed directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/default/{html,cgi-bin,logs}&lt;br /&gt;
chown -R apache:apache /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to edit the configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.orig&lt;br /&gt;
vim /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -U 0 /etc/httpd/conf/httpd.conf.orig /etc/httpd/conf/httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/httpd/conf/httpd.conf.orig	2012-05-13 19:32:07.718570148 -0400&lt;br /&gt;
+++ /etc/httpd/conf/httpd.conf	2012-05-13 21:48:18.439736244 -0400&lt;br /&gt;
@@ -103,6 +103,6 @@&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
@@ -119,5 +119,5 @@&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
@@ -262 +262 @@&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
@@ -276,0 +277 @@&lt;br /&gt;
+ServerName omiya.alteeve.ca:80&lt;br /&gt;
@@ -292 +293 @@&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
@@ -317 +318 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
@@ -551 +552 @@&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
@@ -553 +554 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
@@ -576 +577 @@&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
@@ -582 +583 @@&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
@@ -855 +856 @@&lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
@@ -859 +860 @@&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
@@ -990 +991 @@&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
@@ -1004,5 +1005,5 @@&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
@@ -1009,0 +1011 @@&lt;br /&gt;
+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[Sun May 13 21:48:11 2012] [warn] NameVirtualHost *:80 has no VirtualHosts&amp;lt;/span&amp;gt; is expected at this stage as we&#039;ve not yet configured any virtual hosts.&lt;br /&gt;
&lt;br /&gt;
All virtual host configuration files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf.d&amp;lt;/span&amp;gt; directory and the file must have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.conf&amp;lt;/span&amp;gt; suffix in order to be read by apache. These files will be read in order, so if you want to ensure that one file is read before another, as we will do shortly, you can prefix the configuration file with an integer to ensure read order.&lt;br /&gt;
&lt;br /&gt;
I like to redirect all unknown server requests to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://unknown.alteeve.ca&amp;lt;/span&amp;gt;. For this, I will create an initial configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00_default.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/00_default.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
        ServerAdmin admin@alteeve.ca&lt;br /&gt;
        DocumentRoot /var/www/default/html&lt;br /&gt;
        ServerName unknown.alteeve.com&lt;br /&gt;
        ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
        CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will do two kinds of checks; One for syntax and one to check the configuration of virtual host containers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We no longer see the warning from before as we now have our first virtual host configured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now start the web server for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting httpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Time to configure some real domains.&lt;br /&gt;
&lt;br /&gt;
== Common Virtual Host Configurations ==&lt;br /&gt;
&lt;br /&gt;
All domains on this server will be housed under either:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, for [[SSL]] encrypted domains;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/ssl_domain.tld/{cgi-bin,html,logs,temp}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The four directories found under the domain are used for hosting executable scripts (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cgi-bin&amp;lt;/span&amp;gt;), standard [[HTML]] websites or websites with in-line code like [[PHP]] (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;html&amp;lt;/span&amp;gt;), log files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logs&amp;lt;/span&amp;gt;) and an optional temporary directory used for staging files (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;temp&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Standard Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
This section covers the configuration on standard virtual host containers (using [[TCP]] port 80).&lt;br /&gt;
&lt;br /&gt;
In this example, we will setup the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://mizu-bu.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
First, create the directories for the domain&#039;s files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/mizu-bu.org/{cgi-bin,html,logs,temp}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the virtual host container&#039;s configuration file. Note that in this example, it is a [http://www.mediawiki.org/ MediaWiki] website, so we will tell apache to look for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.php&amp;lt;/span&amp;gt; files by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/mizu-bu.org.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
	ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
	ServerName mizu-bu.org&lt;br /&gt;
        ServerAlias www.mizu-bu.org&lt;br /&gt;
&lt;br /&gt;
	DirectoryIndex index.html&lt;br /&gt;
    	&lt;br /&gt;
	DocumentRoot /var/www/mizu-bu.org/html/&lt;br /&gt;
	&amp;lt;Directory /var/www/mizu-bu.org/html&amp;gt;&lt;br /&gt;
		Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
		AllowOverride Options&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ScriptAlias /cgi-bin/ /var/www/mizu-bu.org/cgi-bin/&lt;br /&gt;
	&amp;lt;Directory &amp;quot;/var/www/mizu-bu.org/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
		AllowOverride None&lt;br /&gt;
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
		Order allow,deny&lt;br /&gt;
		Allow from all&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	ErrorLog /var/www/mizu-bu.org/logs/error.log&lt;br /&gt;
&lt;br /&gt;
	# Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
	# alert, emerg.&lt;br /&gt;
	LogLevel debug&lt;br /&gt;
&lt;br /&gt;
	CustomLog /var/www/mizu-bu.org/logs/access.log combined&lt;br /&gt;
	ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, test the syntax and virtual host configurations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -S&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
VirtualHost configuration:&lt;br /&gt;
wildcard NameVirtualHosts and _default_ servers:&lt;br /&gt;
_default_:443          omiya.alteeve.ca (/etc/httpd/conf.d/ssl.conf:74)&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost unknown.alteeve.com (/etc/httpd/conf.d/00_default.conf:1)&lt;br /&gt;
         port 80 namevhost mizu-bu.org (/etc/httpd/conf.d/mizu-bu.org.conf:1)&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
== Common apachectl -t Configuration Problems ==&lt;br /&gt;
&lt;br /&gt;
=== httpd: apr_sockaddr_info_get() failed for &amp;lt;domain&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Make sure that the hostname for the server resolves to an IP address. This is done by ensuring that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hostname&amp;lt;/span&amp;gt; has a [[DNS]] entry or has an entry in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== [warn] NameVirtualHost *:80 has no VirtualHosts ===&lt;br /&gt;
&lt;br /&gt;
This will be shown when no virtual host containers have been configured ye.&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RoundCube Web Mail ==&lt;br /&gt;
Poke dak1n1 to document this!&lt;br /&gt;
&lt;br /&gt;
==== Adding a password-reset link to the login page ====&lt;br /&gt;
Edit the login page template to insert the link.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /usr/share/roundcubemail/skins/default/templates/login.html&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The part we&#039;re adding is the &#039;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&#039;. Other parts of the template file are included here as a reference.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;login-form&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxtitle&amp;quot;&amp;gt;&amp;lt;roundcube:label name=&amp;quot;welcome&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;boxcontent&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form name=&amp;quot;form&amp;quot; action=&amp;quot;./&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;roundcube:object name=&amp;quot;loginform&amp;quot; form=&amp;quot;form&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align:center;&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; class=&amp;quot;button mainaction&amp;quot; value=&amp;quot;&amp;lt;roundcube:label name=&#039;login&#039; /&amp;gt;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;../../cgi-bin/t/password.cgi&amp;quot;&amp;gt;Forgot your password?&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4313</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4313"/>
		<updated>2012-05-07T18:19:16Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Post OS Install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=0&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;protect=1&amp;lt;/span&amp;gt; to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/CentOS-Base.repo.orig /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/CentOS-Base.repo.orig	2012-05-07 01:07:47.688145406 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/CentOS-Base.repo	2012-05-07 01:08:15.915322496 -0400&lt;br /&gt;
@@ -18,0 +19 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -26,0 +28 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -34,0 +37 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -43,0 +47 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
@@ -52,0 +57 @@&lt;br /&gt;
+protect=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.orig&lt;br /&gt;
vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each paragraph&lt;br /&gt;
diff -U 0 /etc/yum.repos.d/epel.repo.orig /etc/yum.repos.d/epel.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.repos.d/epel.repo.orig	2012-05-07 01:08:58.279379860 -0400&lt;br /&gt;
+++ /etc/yum.repos.d/epel.repo	2012-05-07 01:09:18.144157701 -0400&lt;br /&gt;
@@ -8,0 +9 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -17,0 +19 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
@@ -26,0 +29 @@&lt;br /&gt;
+protect=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/denyhosts.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts.allow&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig denyhosts on&lt;br /&gt;
service denyhosts start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional software to install ===&lt;br /&gt;
To view neatly-summarized daily logs, and system resource usage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4310</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4310"/>
		<updated>2012-05-06T17:51:55Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Protecting against malicious users with Denyhosts. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &#039;protect=0&#039; or protect=1 to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each section&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each section&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/denyhosts.conf&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including localhost.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/hosts.allow&lt;br /&gt;
127.0.0.1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;service denyhosts start&lt;br /&gt;
chkconfig denyhosts on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional software to install ===&lt;br /&gt;
To view neatly-summarized daily logs, and system resource usage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4309</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4309"/>
		<updated>2012-05-06T17:50:05Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Protecting against malicious users with Denyhosts. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &#039;protect=0&#039; or protect=1 to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each section&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each section&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/denyhosts.conf&lt;br /&gt;
BLOCK_SERVICE = ALL&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including localhost.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/hosts.allow&lt;br /&gt;
127.0.0.1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;service denyhosts start&lt;br /&gt;
chkconfig denyhosts on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additional useful software. (For neatly summarizing daily logs and viewing system resource usage.)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install logwatch htop&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4308</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4308"/>
		<updated>2012-05-06T17:46:26Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Post OS Install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, some post-install preparation. We&#039;ll need to set up some basic security, a program to report server statistics, and some 3rd-party yum repositories for additional software.&lt;br /&gt;
&lt;br /&gt;
Yum repo install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install yum-protectbase&lt;br /&gt;
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt # import keys &lt;br /&gt;
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # verify package integrity &lt;br /&gt;
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm # install &lt;br /&gt;
# install EPEL &lt;br /&gt;
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The yum-protectbase plugin will ensure that the 3rd-party repos play nicely and never overwrite the Base repos.  To use this plugin with a specific repo, add &#039;protect=0&#039; or protect=1 to the repo&#039;s config file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/yum.repos.d/CentOS-Base.repo&lt;br /&gt;
# add protect=1 to each section&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/yum.repos.d/epel.repo&lt;br /&gt;
# add protect=0 to each section&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protecting against malicious users with Denyhosts. ===&lt;br /&gt;
Denyhosts is a daemon that watches for too many failed logins via ssh. It uses TCP-wrappers to deny the user access to ssh (or any service) on the server after X failed logins. It has the option to download a list of known malicious IPs and add them to /hosts.deny, making possible to block attackers before they attack the server.&lt;br /&gt;
&lt;br /&gt;
Install denyhosts&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install denyhosts&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the config to your preferences.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/denyhosts.conf&lt;br /&gt;
SYNC_SERVER = http://xmlrpc.denyhosts.net:9911&lt;br /&gt;
SYNC_DOWNLOAD = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
White-list any trusted machines, including localhost.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/hosts.allow&lt;br /&gt;
127.0.0.1&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the service.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;service denyhosts start&lt;br /&gt;
chkconfig denyhosts on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Packages for web server and wiki install.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4301</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4301"/>
		<updated>2012-03-25T17:47:44Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Setup Postfix SMTP Authentication using Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&lt;br /&gt;
# general smtpd settings&lt;br /&gt;
# - reject clients that speak too early&lt;br /&gt;
# - reject mail from a null address to many recipients (usually spam)&lt;br /&gt;
smtpd_data_restrictions =&lt;br /&gt;
        reject_unauth_pipelining&lt;br /&gt;
        reject_multi_recipient_bounce&lt;br /&gt;
        permit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4300</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4300"/>
		<updated>2012-03-25T17:46:14Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Postgrey Greylisting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. This will delay mail from untrusted sources by 6 minutes. A legitimate mailserver will resend the request after that time, and be allowed through. But spam is generally sent out only once, so those messages will drop.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4299</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4299"/>
		<updated>2012-03-25T17:41:28Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Postgrey Greylisting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to check SMTP requests through Postgrey. Postgrey will decide if the mail should be blocked or accepted.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4298</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4298"/>
		<updated>2012-03-25T17:38:40Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Postgrey Greylisting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4297</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4297"/>
		<updated>2012-03-25T17:37:39Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Postgrey Greylisting ==&lt;br /&gt;
&lt;br /&gt;
Enabling postgrey for anti-spam greylisting.&lt;br /&gt;
&lt;br /&gt;
First install the RPMForge repos. (See [http://dak1n1.com/blog/3-getting-more-from-yum-with-rpmforge-and-epel-repos Dakini&#039;s blog] for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source=&amp;quot;bash&amp;quot;&amp;gt;yum -y install postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the config file with the following options. &lt;br /&gt;
&amp;lt;source=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/sysconfig/postgrey&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source=&amp;quot;bash&amp;quot;&amp;gt;OPTIONS=&amp;quot;--unix=/var/spool/postfix/postgrey/socket --delay=360&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that Postgrey starts on boot.&lt;br /&gt;
&amp;lt;source=&amp;quot;bash&amp;quot;&amp;gt;chkconfig --levels 345 postgrey on&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source=&amp;quot;bash&amp;quot;&amp;gt;/etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
        check_policy_service unix:postgrey/socket&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Postgrey to take affect.&lt;br /&gt;
&amp;lt;source=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgrey start&lt;br /&gt;
service postfix restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4296</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4296"/>
		<updated>2012-03-25T17:27:40Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = yes&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4295</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4295"/>
		<updated>2012-03-25T17:24:26Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* User Password Encryption */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot;\&lt;br /&gt;
 | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4294</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4294"/>
		<updated>2012-03-25T17:23:34Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* User Password Encryption */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot; | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4293</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4293"/>
		<updated>2012-03-25T17:23:04Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* User Password Encryption */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
To automate this process for all users in the database, you can look at the number of userid&#039;s there are and loop through them, encrypting and replacing each password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# a script to encrypt the users.usr_password values of the an_tools database&lt;br /&gt;
&lt;br /&gt;
export PGUSER=&amp;quot;alteeve&amp;quot;&lt;br /&gt;
export PGPASSWORD=&#039;secret&#039;&lt;br /&gt;
&lt;br /&gt;
for usrid in {1..219}; do&lt;br /&gt;
&lt;br /&gt;
    # grab the user&#039;s password, removing whitespace&lt;br /&gt;
    usrpass=$(psql -d an_tools -c &amp;quot;SELECT users.usr_password FROM users WHERE users.usr_id=$usrid;&amp;quot; | sed -n 3p | sed -e &#039;s/^[ ]*//&#039;)&lt;br /&gt;
&lt;br /&gt;
    if [[ &amp;quot;$usrpass&amp;quot; == *CRAM* ]]; then&lt;br /&gt;
        echo &amp;quot;Password for user #$usrid is already encrypted; skipping.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
        # encrypt and surround in single quotes for psql&lt;br /&gt;
        encrypted=\&#039;$(doveadm -v pw -s CRAM-MD5 -p &amp;quot;$usrpass&amp;quot;)\&#039;&lt;br /&gt;
        echo &amp;quot;old password: [$usrpass] ; encrypted: $encrypted&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # set password to encrypted value&lt;br /&gt;
        psql -d an_tools -c &amp;quot;UPDATE users SET usr_password=$encrypted WHERE usr_id=$usrid;&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
unset PGUSER&lt;br /&gt;
unset PGPASSWORD&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4292</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4292"/>
		<updated>2012-03-25T17:20:25Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart Postfix and Dovecot, then change your Thunderbird server options to &#039;STARTTLS&#039;. If you&#039;re still able to connect to the mail server and send mail, proceed to the next section.&lt;br /&gt;
&lt;br /&gt;
== User Password Encryption ==&lt;br /&gt;
&lt;br /&gt;
In addition to SSL/TSL, which only encrypts the transport of user credentials, we&#039;re also  going to encrypt the passwords themselves. This will avoid storing any plaintext passwords in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-auth.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
Remove the &amp;quot;plain&amp;quot; authentication, and replace with cram-md5.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
auth_mechanisms = cram-md5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any user credentials that were previously stored in plaintext will no longer work. To encrypt your password in a way that Dovecot recognizes, use the following command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;doveadm -v pw -s CRAM-MD5 -p mypassword&amp;lt;/source&amp;gt;&lt;br /&gt;
It will return a hash like this.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
{CRAM-MD5}de5924752ad74e36bc271a8dc7fad4b2d341f21f05382f20dedf1fdfbd5a1717&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take the entire hash, including the &#039;{CRAM-MD5}&#039; portion, and use it to replace the password entry in the database for that user. This will allow Dovecot to authenticate the user using the CRAM-MD5 auth mechanism.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4291</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4291"/>
		<updated>2012-03-25T17:08:52Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* SSL/TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4290</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4290"/>
		<updated>2012-03-25T17:07:55Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* SSL/TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add SSL to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TLS support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4289</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4289"/>
		<updated>2012-03-25T17:07:25Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* SSL/TLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add SSL to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TSL support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
# This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4288</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4288"/>
		<updated>2012-03-25T17:06:16Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s a good idea to restart the Postfix and Dovecot services, and test out the basic configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postfix restart&lt;br /&gt;
service dovecot restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watch the maillog while attempting to authenticate with an email client like Thunderbird.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/log/maillog&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If basic authentication is working, we can go ahead and add another layer of complexity on top of it: SSL.&lt;br /&gt;
&lt;br /&gt;
== SSL/TLS ==&lt;br /&gt;
&lt;br /&gt;
Add SSL to Postfix, to encrypt SMTP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_use_tls = yes&lt;br /&gt;
smtpd_tls_auth_only = yes&lt;br /&gt;
smtpd_tls_cert_file = /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
smtpd_tls_key_file = /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
smtpd_tls_loglevel = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add TSL support to Dovecot, to encrypt IMAP authentication traffic.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-ssl.conf &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssl = yes&lt;br /&gt;
&lt;br /&gt;
# PEM encoded X.509 SSL/TLS certificate and private key.&lt;br /&gt;
ssl_cert = &amp;lt;/etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
ssl_key = &amp;lt;/etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
&lt;br /&gt;
# PEM encoded trusted certificate authority. Otherwise your CA will be untrusted.&lt;br /&gt;
This is the intermediary certificate.&lt;br /&gt;
ssl_ca = &amp;lt;/etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot prefers the following permissions for SSL certs, so set them accordingly.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 0444 /etc/pki/CA/ssl_mail.alteeve.ca.crt&lt;br /&gt;
chmod 0400 /etc/pki/CA/private/mail.alteeve.ca.key&lt;br /&gt;
chmod 0400 /etc/pki/CA/RapidSSL_CA_bundle_alteeve.ca.pem&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4287</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4287"/>
		<updated>2012-03-25T16:47:41Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Configuring Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4286</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4286"/>
		<updated>2012-03-25T16:46:53Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Configuring Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Dovecot Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. This will allow Dovecot to access the user authentication socket.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Dovecot Logging ===&lt;br /&gt;
&lt;br /&gt;
This is very useful for debugging an initial setup. It will place details about login attempts in /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-logging.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
log_path = syslog&lt;br /&gt;
auth_verbose = yes&lt;br /&gt;
auth_debug = yes&lt;br /&gt;
mail_debug = yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4285</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4285"/>
		<updated>2012-03-25T16:39:19Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Configuring Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dovecot Authentication and SQL Settings ===&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Dovecot Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4284</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4284"/>
		<updated>2012-03-25T16:37:10Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Configuring Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure Dovecot Listener Sockets ===&lt;br /&gt;
&lt;br /&gt;
Setup the authentication socket to allow the vmail user. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  unix_listener auth-userdb {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = vmail&lt;br /&gt;
    group = vmail&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure Dovecot to authenticate Postfix SMTP requests.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/dovecot/conf.d/10-master.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
   unix_listener smtp-auth {&lt;br /&gt;
    mode = 0600&lt;br /&gt;
    user = postfix&lt;br /&gt;
    group = postfix&lt;br /&gt;
    path = /var/spool/postfix/private/auth&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4283</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4283"/>
		<updated>2012-03-25T16:23:00Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Setup Postfix Mail Delivery via Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this for RHEL/CentOS 6 machines. For other distros, make sure that /usr/libexec/dovecot/deliver exists and change the path if necessary.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4282</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4282"/>
		<updated>2012-03-25T16:21:36Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Setup Postfix Mail Delivery via Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Define a mail transport method in the main Postfix config.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4281</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4281"/>
		<updated>2012-03-25T16:19:33Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Setup SASL SMTP Authentication with Dovecot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix SMTP Authentication using Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix called SASL. Enabling this will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4280</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4280"/>
		<updated>2012-03-25T16:18:14Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Configure Postfix to Use Dovecot for Mail Delivery */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Setup Postfix Mail Delivery via Dovecot ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup SASL SMTP Authentication with Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix. This will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4279</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4279"/>
		<updated>2012-03-25T16:17:06Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Configure Postfix to Use Dovecot for Mail Delivery ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# this option is ignored, but may be useful for reference&lt;br /&gt;
virtual_mailbox_base=/email&lt;br /&gt;
&lt;br /&gt;
# deliver mail via dovecot&lt;br /&gt;
virtual_transport = dovecot&lt;br /&gt;
&lt;br /&gt;
# prevent postfix from sending multiple recipients per delivery request,&lt;br /&gt;
# since dovecot only supports one recipient for each delivery&lt;br /&gt;
dovecot_destination_recipient_limit = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell Postfix what virtual_transport &amp;quot;dovecot&amp;quot; means, and how to use it.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/master.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dovecot   unix  -       n       n       -       -       pipe&lt;br /&gt;
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup SASL SMTP Authentication with Dovecot ===&lt;br /&gt;
&lt;br /&gt;
Dovecot provides an SMTP authentication mechanism to Postfix. This will require users to authenticate against the server before sending mail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Append the following to enable smtp authentication:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
smtpd_sasl_auth_enable = yes&lt;br /&gt;
smtpd_sasl_type = dovecot&lt;br /&gt;
smtpd_sasl_path = private/auth&lt;br /&gt;
broken_sasl_auth_clients = yes&lt;br /&gt;
&lt;br /&gt;
# allow authenticated users to send mail through Postfix SMTP&lt;br /&gt;
# more info at /usr/share/doc/postfix-2.6.6/README_FILES/SMTPD_ACCESS_README&lt;br /&gt;
smtpd_recipient_restrictions =&lt;br /&gt;
        permit_mynetworks&lt;br /&gt;
        permit_sasl_authenticated&lt;br /&gt;
        reject_unauth_destination&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4278</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4278"/>
		<updated>2012-03-25T15:54:29Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Basic Postfix Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4277</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4277"/>
		<updated>2012-03-25T15:53:44Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Basic Postfix Configuration ===&lt;br /&gt;
&lt;br /&gt;
Since we&#039;ll be using virtual domains, users, aliases and mailboxes, we&#039;ll need to start by commenting out some of the default options in Postfix. By default, Postfix is set up for small numbers of local users, and it only allows connections from the localhost. Our configuration will be more scalable, allowing many domains and users to be stored in the Postgres database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
Comment out the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# inet_interfaces = localhost&lt;br /&gt;
# mydestination = $myhostname, localhost.$mydomain, localhost &lt;br /&gt;
# alias_maps = hash:/etc/aliases  &lt;br /&gt;
# alias_database = hash:/etc/aliases&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And uncomment/add these:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vim /etc/postfix/main.cf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
inet_interfaces = all   # allows us to connect and test from another machine&lt;br /&gt;
mynetworks = 192.168.1.0/32, 127.0.0.0/8  # use the IP or subnet of your test machine here&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4276</id>
		<title>PPPower Server</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=PPPower_Server&amp;diff=4276"/>
		<updated>2012-03-23T01:17:04Z</updated>

		<summary type="html">&lt;p&gt;Dak1n1: /* Setup Virtual Domain Lookup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
With tongue firmly in cheek, this is a tutorial on building an [[EL6]] server for hosting website and email using PostgreSQL, Postfix and Postgrey for mail and Apache for web. There are many canned and arguably superior was of accomplishing the same, but this is what I user for this server.&lt;br /&gt;
&lt;br /&gt;
= Post OS Install =&lt;br /&gt;
&lt;br /&gt;
First, the packages we will want to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd httpd-tools postgresql-server postgresql-plperl postgresql-contrib postgresql mysql-server telnet mod_ssl mysql-server php-mysql gcc jwhois bind&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Packages that are currently needed for personal stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install perl-XML-Simple perl-MIME-Lite perl-DBD-MySQL perl-DBD-Pg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Apache =&lt;br /&gt;
&lt;br /&gt;
After all changes, use this to make sure there are no syntax errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service httpd configtest&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=This needs to be explained.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u httpd.conf.orig httpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- httpd.conf.orig	2010-05-28 03:11:06.000000000 -0400&lt;br /&gt;
+++ httpd.conf	2011-05-13 21:56:27.000000000 -0400&lt;br /&gt;
@@ -100,12 +100,12 @@&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
-StartServers       8&lt;br /&gt;
-MinSpareServers    5&lt;br /&gt;
-MaxSpareServers   20&lt;br /&gt;
-ServerLimit      256&lt;br /&gt;
-MaxClients       256&lt;br /&gt;
-MaxRequestsPerChild  4000&lt;br /&gt;
+StartServers      16&lt;br /&gt;
+MinSpareServers   10&lt;br /&gt;
+MaxSpareServers   40&lt;br /&gt;
+ServerLimit      512&lt;br /&gt;
+MaxClients       512&lt;br /&gt;
+MaxRequestsPerChild  8000&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 # worker MPM&lt;br /&gt;
@@ -116,11 +116,11 @@&lt;br /&gt;
 # ThreadsPerChild: constant number of worker threads in each server process&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
-StartServers         4&lt;br /&gt;
-MaxClients         300&lt;br /&gt;
-MinSpareThreads     25&lt;br /&gt;
-MaxSpareThreads     75 &lt;br /&gt;
-ThreadsPerChild     25&lt;br /&gt;
+StartServers         8&lt;br /&gt;
+MaxClients         600&lt;br /&gt;
+MinSpareThreads     50&lt;br /&gt;
+MaxSpareThreads    150 &lt;br /&gt;
+ThreadsPerChild     50&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
@@ -259,7 +259,7 @@&lt;br /&gt;
 # e-mailed.  This address appears on some server-generated pages, such&lt;br /&gt;
 # as error documents.  e.g. admin@your-domain.com&lt;br /&gt;
 #&lt;br /&gt;
-ServerAdmin root@localhost&lt;br /&gt;
+ServerAdmin admin@alteeve.com&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # ServerName gives the name and port that the server uses to identify itself.&lt;br /&gt;
@@ -274,6 +274,7 @@&lt;br /&gt;
 # redirections work in a sensible way.&lt;br /&gt;
 #&lt;br /&gt;
 #ServerName www.example.com:80&lt;br /&gt;
+#ServerName *:80&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # UseCanonicalName: Determines how Apache constructs self-referencing &lt;br /&gt;
@@ -289,7 +290,7 @@&lt;br /&gt;
 # documents. By default, all requests are taken from this directory, but&lt;br /&gt;
 # symbolic links and aliases may be used to point to other locations.&lt;br /&gt;
 #&lt;br /&gt;
-DocumentRoot &amp;quot;/var/www/html&amp;quot;&lt;br /&gt;
+DocumentRoot &amp;quot;/var/www/default/html&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Each directory to which Apache has access can be configured with respect&lt;br /&gt;
@@ -314,7 +315,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # This should be changed to whatever you set DocumentRoot to.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/html&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/html&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Possible values for the Options directive are &amp;quot;None&amp;quot;, &amp;quot;All&amp;quot;,&lt;br /&gt;
@@ -548,9 +549,9 @@&lt;br /&gt;
 # We include the /icons/ alias for FancyIndexed directory listings.  If you&lt;br /&gt;
 # do not use FancyIndexing, you may comment this out.&lt;br /&gt;
 #&lt;br /&gt;
-Alias /icons/ &amp;quot;/var/www/icons/&amp;quot;&lt;br /&gt;
+Alias /icons/ &amp;quot;/var/www/default/icons/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/icons&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/icons&amp;quot;&amp;gt;&lt;br /&gt;
     Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -573,13 +574,13 @@&lt;br /&gt;
 # The same rules about trailing &amp;quot;/&amp;quot; apply to ScriptAlias directives as to&lt;br /&gt;
 # Alias.&lt;br /&gt;
 #&lt;br /&gt;
-ScriptAlias /cgi-bin/ &amp;quot;/var/www/cgi-bin/&amp;quot;&lt;br /&gt;
+ScriptAlias /cgi-bin/ &amp;quot;/var/www/default/cgi-bin/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # &amp;quot;/var/www/cgi-bin&amp;quot; should be changed to whatever your ScriptAliased&lt;br /&gt;
 # CGI directory exists, if you have that configured.&lt;br /&gt;
 #&lt;br /&gt;
-&amp;lt;Directory &amp;quot;/var/www/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
+&amp;lt;Directory &amp;quot;/var/www/default/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
     AllowOverride None&lt;br /&gt;
     Options None&lt;br /&gt;
     Order allow,deny&lt;br /&gt;
@@ -852,11 +853,11 @@&lt;br /&gt;
 # copying them to /your/include/path/, even on a per-VirtualHost basis.&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
-Alias /error/ &amp;quot;/var/www/error/&amp;quot;&lt;br /&gt;
+Alias /error/ &amp;quot;/var/www/default/error/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;IfModule mod_negotiation.c&amp;gt;&lt;br /&gt;
 &amp;lt;IfModule mod_include.c&amp;gt;&lt;br /&gt;
-    &amp;lt;Directory &amp;quot;/var/www/error&amp;quot;&amp;gt;&lt;br /&gt;
+    &amp;lt;Directory &amp;quot;/var/www/default/error&amp;quot;&amp;gt;&lt;br /&gt;
         AllowOverride None&lt;br /&gt;
         Options IncludesNoExec&lt;br /&gt;
         AddOutputFilter Includes html&lt;br /&gt;
@@ -987,7 +988,7 @@&lt;br /&gt;
 #&lt;br /&gt;
 # Use name-based virtual hosting.&lt;br /&gt;
 #&lt;br /&gt;
-#NameVirtualHost *:80&lt;br /&gt;
+NameVirtualHost *:80&lt;br /&gt;
 #&lt;br /&gt;
 # NOTE: NameVirtualHost cannot be used without a port specifier &lt;br /&gt;
 # (e.g. :80) if mod_ssl is being used, due to the nature of the&lt;br /&gt;
@@ -1001,9 +1002,10 @@&lt;br /&gt;
 # server name.&lt;br /&gt;
 #&lt;br /&gt;
 #&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
-#    ServerAdmin webmaster@dummy-host.example.com&lt;br /&gt;
-#    DocumentRoot /www/docs/dummy-host.example.com&lt;br /&gt;
-#    ServerName dummy-host.example.com&lt;br /&gt;
-#    ErrorLog logs/dummy-host.example.com-error_log&lt;br /&gt;
-#    CustomLog logs/dummy-host.example.com-access_log common&lt;br /&gt;
+#    ServerAdmin admin@alteeve.com&lt;br /&gt;
+#    DocumentRoot /var/www/default/html&lt;br /&gt;
+#    ServerName unknown.alteeve.com&lt;br /&gt;
+#    ErrorLog /var/www/default/logs/error.log&lt;br /&gt;
+#    CustomLog /var/www/default/logs/access.log common&lt;br /&gt;
 #&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SSL Virtual Hosts ==&lt;br /&gt;
&lt;br /&gt;
SSL provides for secure client to server communications.&lt;br /&gt;
&lt;br /&gt;
=== Creating The Signed Certificate ===&lt;br /&gt;
&lt;br /&gt;
This section assumes you are using a 3rd party signing authority. Specifically, I use http://www.trustico.ca/ (resellers of http://RapidSSL.com and others). This is also for a domain-specific certificate. Wildcard certificates will differ.&lt;br /&gt;
&lt;br /&gt;
First, create 2048bit private key. Note that this will require a pass-phrase, which you will need to enter whenever the Apache daemon &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt; daemon starts. If you do not want this, remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-des3&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl genrsa -des3 -out /etc/pki/CA/private/alteeve.com.key 2048&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating RSA private key, 2048 bit long modulus&lt;br /&gt;
..................................+++&lt;br /&gt;
.............................................................+++&lt;br /&gt;
e is 65537 (0x10001)&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
Verifying - Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a [[CSR]] (Certificate signing request) which we will send to the signing authority. Do not enter anything in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;extra&amp;lt;/span&amp;gt; section below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Common Name&amp;lt;/span&amp;gt; must be the fully qualified domain name. In this example, I want to create a certificate for the domain &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt;, so I will enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;. If you prefer to use a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix, include it. I will rewrite requests using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;www.&amp;lt;/span&amp;gt; prefix to not use it.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -new -key /etc/pki/CA/private/alteeve.com.key -out alteeve.com.csr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Enter pass phrase for /etc/pki/CA/private/alteeve.com.key:&lt;br /&gt;
You are about to be asked to enter information that will be incorporated&lt;br /&gt;
into your certificate request.&lt;br /&gt;
What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
There are quite a few fields but you can leave some blank&lt;br /&gt;
For some fields there will be a default value,&lt;br /&gt;
If you enter &#039;.&#039;, the field will be left blank.&lt;br /&gt;
-----&lt;br /&gt;
Country Name (2 letter code) [XX]:CA&lt;br /&gt;
State or Province Name (full name) []:Ontario&lt;br /&gt;
Locality Name (eg, city) [Default City]:Oakville&lt;br /&gt;
Organization Name (eg, company) [Default Company Ltd]:Alteeve&#039;s Niche&lt;br /&gt;
Organizational Unit Name (eg, section) []:IT&lt;br /&gt;
Common Name (eg, your name or your server&#039;s hostname) []:alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com     &lt;br /&gt;
&lt;br /&gt;
Please enter the following &#039;extra&#039; attributes&lt;br /&gt;
to be sent with your certificate request&lt;br /&gt;
A challenge password []:&lt;br /&gt;
An optional company name []:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test that the CSR file is ok.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -noout -text -in /etc/pki/CA/alteeve.com.csr &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Certificate Request:&lt;br /&gt;
    Data:&lt;br /&gt;
        Version: 0 (0x0)&lt;br /&gt;
        Subject: C=CA, ST=Ontario, L=Oakville, O=Alteeve&#039;s Niche, OU=IT, CN=alteeve.com/emailAddress=admin@alteeve.com&lt;br /&gt;
        Subject Public Key Info:&lt;br /&gt;
            Public Key Algorithm: rsaEncryption&lt;br /&gt;
                Public-Key: (2048 bit)&lt;br /&gt;
                Modulus:&lt;br /&gt;
                    ...&lt;br /&gt;
                Exponent: 65537 (0x10001)&lt;br /&gt;
        Attributes:&lt;br /&gt;
            a0:00&lt;br /&gt;
    Signature Algorithm: sha1WithRSAEncryption&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the exact contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com.csr&amp;lt;/span&amp;gt; file and provide it to your signing authority as per their instructions. Once you complete their CSR form, they should email you a signed certificate and an intermediary certificate. At this point, the CSR file is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Save the signed certificate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/ssl_alteeve.com.crt &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the intermediary certificate. Change the certificate name to that of your provider. If they provide you with this file, simply save it in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/pki/CA/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/pki/CA/RapidSSL_CA_bundle.pem &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
...&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating An SSL Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
Create a new virtual host container for the new SSL protected virtual host. We will leave the normal unencrypted virtual-host alone for now. Once we&#039;re done, we&#039;ll use it to capture and redirect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; requests to their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; equivalents. I make my virtual host directories writeable by my normal user account. Feel free to adapt this to your preferences.&lt;br /&gt;
&lt;br /&gt;
Setup the directories and then create a trivial &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ssl_alteeve.com/{cgi-bin,html,logs,temp} -p&lt;br /&gt;
chown apache:digimer ssl_alteeve.com -R&lt;br /&gt;
chmod g+w ssl_alteeve.com -R&lt;br /&gt;
vim /var/www/ssl_alteeve.com/html/index.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the Apache2 config. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssl_&amp;lt;/span&amp;gt; prefix for encrypted domains.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This example is for a MediaWiki virtual host with short URLs configured. You will want to adapt the values to suit your needs.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/httpd/conf.d/ssl_alteeve.com.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
        ServerAdmin digimer@alteeve.com&lt;br /&gt;
&lt;br /&gt;
        ServerName alteeve.com&lt;br /&gt;
&lt;br /&gt;
        DirectoryIndex index.php index.html&lt;br /&gt;
&lt;br /&gt;
        # We can haz security?&lt;br /&gt;
        SSLEngine on&lt;br /&gt;
        SSLProtocol all&lt;br /&gt;
        SSLCACertificateFile /etc/pki/CA/RapidSSL_CA_bundle.pem&lt;br /&gt;
        SSLCertificateFile /etc/pki/CA/ssl_alteeve.com.crt&lt;br /&gt;
        SSLCertificateKeyFile /etc/pki/CA/private/alteeve.com.key&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/ssl_alteeve.com/html/&lt;br /&gt;
        Alias /w /var/www/ssl_alteeve.com/html/index.php&lt;br /&gt;
        &amp;lt;Directory /var/www/ssl_alteeve.com/html&amp;gt;&lt;br /&gt;
                Options +Includes Indexes FollowSymLinks MultiViews&lt;br /&gt;
                AllowOverride All&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ScriptAlias /cgi-bin/ /var/www/ssl_alteeve.com/cgi-bin/&lt;br /&gt;
        &amp;lt;Directory &amp;quot;/var/www/ssl_alteeve.com/cgi-bin&amp;quot;&amp;gt;&lt;br /&gt;
                AllowOverride None&lt;br /&gt;
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;
                Order allow,deny&lt;br /&gt;
                Allow from all&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ErrorLog /var/www/ssl_alteeve.com/logs/error.log&lt;br /&gt;
        TransferLog /var/www/ssl_alteeve.com/logs/transfer.log&lt;br /&gt;
&lt;br /&gt;
        # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;
        # alert, emerg.&lt;br /&gt;
        LogLevel debug&lt;br /&gt;
&lt;br /&gt;
        CustomLog /var/www/ssl_alteeve.com/logs/access.log combined&lt;br /&gt;
        ServerSignature On&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Bad Identity Error ====&lt;br /&gt;
&lt;br /&gt;
If you get an error about the server not providing identity information, you may have be loading images, CSS, javascript or similar using a URL from a remote domain with no SSL or badly configured SSL.&lt;br /&gt;
&lt;br /&gt;
For example, on Firefox 4, you may see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This web site does not supply identity information.&lt;br /&gt;
&lt;br /&gt;
Your connection to this site is only partially encrypted, and does not prevent eavesdropping.&lt;br /&gt;
                                                                        [ More Information ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In my case, this turned out to be a problem where mediawiki was loading a Creative Commons logo from their server using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://&amp;lt;/span&amp;gt; link to the icon. Once this was changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://&amp;lt;/span&amp;gt; (in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LocalSettings.php&amp;lt;/span&amp;gt;), the error went away.&lt;br /&gt;
&lt;br /&gt;
=== Testing and Using the New Configuration ===&lt;br /&gt;
&lt;br /&gt;
Test your new Apache configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apachectl -t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Syntax OK&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart Apache. Note that you will be asked to enter the pass-phrase you used when you created your private key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping httpd:                                            [  OK  ]&lt;br /&gt;
Starting httpd: Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)&lt;br /&gt;
Some of your private key files are encrypted for security reasons.&lt;br /&gt;
In order to read them you have to provide the pass phrases.&lt;br /&gt;
&lt;br /&gt;
Server alteeve.com:443 (RSA)&lt;br /&gt;
Enter pass phrase:&lt;br /&gt;
&lt;br /&gt;
OK: Pass Phrase Dialog successful.&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=From now on, you will need to enter the pass-phrase to start Apache. Consider this when restarting your server and when deciding if you want the Apache server to start with your server. As my server is in a VM and it&#039;s underlying disk is also encrypted, I will enable it at boot time. I&#039;ll need to be watching the boot process anyway. This may not apply to you.}}&lt;br /&gt;
&lt;br /&gt;
Now make sure that you can still connect to your server on [[TCP]] port 80 (normal http port). The contents after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;GET&amp;lt;/span&amp;gt; request will obviously vary depending on your configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
telnet localhost 80&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is &#039;^]&#039;.&lt;br /&gt;
GET&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Asakusa.alteeve.com&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	Default - Requested domain not found&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to check that the SSL port is listening properly. We can&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[telnet]]&amp;lt;/span&amp;gt; because of the SSL encryption. Instead we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openssl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl s_client -connect localhost:443 -state -debug&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
CONNECTED(00000003)&lt;br /&gt;
SSL_connect:before/connect initialization&lt;br /&gt;
write to 0x196a050 [0x1a0b3a0] (113 bytes =&amp;gt; 113 (0x71))&lt;br /&gt;
0000 - 16 03 01 00 6c 01 00 00-68 03 01 4d f8 f4 a4 f9   ....l...h..M....&lt;br /&gt;
0010 - 07 b3 11 f8 3d ff 5d 80-ed 69 87 52 e2 60 80 57   ....=.]..i.R.`.W&lt;br /&gt;
0020 - 59 c7 83 4c ea 5b e5 37-06 e0 13 00 00 3a 00 39   Y..L.[.7.....:.9&lt;br /&gt;
0030 - 00 38 00 88 00 87 00 35-00 84 00 16 00 13 00 0a   .8.....5........&lt;br /&gt;
0040 - 00 33 00 32 00 9a 00 99-00 45 00 44 00 2f 00 96   .3.2.....E.D./..&lt;br /&gt;
0050 - 00 41 00 05 00 04 00 15-00 12 00 09 00 14 00 11   .A..............&lt;br /&gt;
0060 - 00 08 00 06 00 03 00 ff-02 01 00 00 04 00 23      ..............#&lt;br /&gt;
0071 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;
read from 0x196a050 [0x1a10900] (7 bytes =&amp;gt; 7 (0x7))&lt;br /&gt;
0000 - 16 03 01 00 35 02                                 ....5.&lt;br /&gt;
0007 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a1090a] (51 bytes =&amp;gt; 51 (0x33))&lt;br /&gt;
0000 - 00 31 03 01 4d f8 f4 a4-7d 35 00 74 24 43 bc c9   .1..M...}5.t$C..&lt;br /&gt;
0010 - 84 5d fe e3 90 1a e8 14-39 a1 b1 7e e8 19 c7 9f   .]......9..~....&lt;br /&gt;
0020 - 45 20 d1 cb 00 00 39 01-00 09 ff 01 00 01 00 00   E ....9.........&lt;br /&gt;
0030 - 23                                                #&lt;br /&gt;
0033 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server hello A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 0c 2c                                    ....,&lt;br /&gt;
read from 0x196a050 [0x1a10908] (3116 bytes =&amp;gt; 3116 (0xC2C))&lt;br /&gt;
0000 - 0b 00 0c 28 00 0c 25 00-04 c2 30 82 04 be 30 82   ...(..%...0...0.&lt;br /&gt;
0010 - 03 a6 a0 03 02 01 02 02-03 02 15 24 30 0d 06 09   ...........$0...&lt;br /&gt;
0020 - 2a 86 48 86 f7 0d 01 01-05 05 00 30 3c 31 0b 30   *.H........0&amp;lt;1.0&lt;br /&gt;
0030 - 09 06 03 55 04 06 13 02-55 53 31 17 30 15 06 03   ...U....US1.0...&lt;br /&gt;
0040 - 55 04 0a 13 0e 47 65 6f-54 72 75 73 74 2c 20 49   U....GeoTrust, I&lt;br /&gt;
0050 - 6e 63 2e 31 14 30 12 06-03 55 04 03 13 0b 52 61   nc.1.0...U....Ra&lt;br /&gt;
0060 - 70 69 64 53 53 4c 20 43-41 30 1e 17 0d 31 31 30   pidSSL CA0...110&lt;br /&gt;
0070 - 36 31 34 31 32 31 39 30-31 5a 17 0d 31 31 30 37   614121901Z..1107&lt;br /&gt;
0080 - 31 36 31 35 35 36 31 34-5a 30 81 d9 31 29 30 27   16155614Z0..1)0&#039;&lt;br /&gt;
0090 - 06 03 55 04 05 13 20 30-54 53 35 57 7a 61 75 51   ..U... 0TS5WzauQ&lt;br /&gt;
00a0 - 52 4a 37 73 63 32 62 2d-68 54 47 77 4b 31 79 78   RJ7sc2b-hTGwK1yx&lt;br /&gt;
00b0 - 53 66 45 44 70 68 46 31-0b 30 09 06 03 55 04 06   SfEDphF1.0...U..&lt;br /&gt;
00c0 - 13 02 43 41 31 14 30 12-06 03 55 04 0a 13 0b 61   ..CA1.0...U....a&lt;br /&gt;
00d0 - 6c 74 65 65 76 65 2e 63-6f 6d 31 13 30 11 06 03   lteeve.com1.0...&lt;br /&gt;
00e0 - 55 04 0b 13 0a 47 54 31-33 39 30 38 38 31 37 31   U....GT139088171&lt;br /&gt;
00f0 - 31 30 2f 06 03 55 04 0b-13 28 53 65 65 20 77 77   10/..U...(See ww&lt;br /&gt;
0100 - 77 2e 72 61 70 69 64 73-73 6c 2e 63 6f 6d 2f 72   w.rapidssl.com/r&lt;br /&gt;
0110 - 65 73 6f 75 72 63 65 73-2f 63 70 73 20 28 63 29   esources/cps (c)&lt;br /&gt;
0120 - 31 31 31 2b 30 29 06 03-55 04 0b 13 22 44 6f 6d   111+0)..U...&amp;quot;Dom&lt;br /&gt;
0130 - 61 69 6e 20 43 6f 6e 74-72 6f 6c 20 56 61 6c 69   ain Control Vali&lt;br /&gt;
0140 - 64 61 74 65 64 20 2d 20-46 72 65 65 53 53 4c 31   dated - FreeSSL1&lt;br /&gt;
0150 - 14 30 12 06 03 55 04 03-13 0b 61 6c 74 65 65 76   .0...U....alteev&lt;br /&gt;
0160 - 65 2e 63 6f 6d 30 82 01-22 30 0d 06 09 2a 86 48   e.com0..&amp;quot;0...*.H&lt;br /&gt;
0170 - 86 f7 0d 01 01 01 05 00-03 82 01 0f 00 30 82 01   .............0..&lt;br /&gt;
0180 - 0a 02 82 01 01 00 c7 b5-75 03 c7 a9 b5 21 b2 7a   ........u....!.z&lt;br /&gt;
0190 - 9b 70 8d f2 44 5d e0 18-f4 05 52 c6 93 d3 17 a5   .p..D]....R.....&lt;br /&gt;
01a0 - 3a c7 46 03 68 d1 01 53-1b e8 b8 d3 4c 56 46 b2   :.F.h..S....LVF.&lt;br /&gt;
01b0 - ca 63 34 88 2c 4f 7b 23-49 07 ef 8e 37 5c 8a ac   .c4.,O{#I...7\..&lt;br /&gt;
01c0 - d7 88 9b ed a1 01 90 bc-32 d8 46 30 6d 82 33 59   ........2.F0m.3Y&lt;br /&gt;
01d0 - ea b5 38 2c 8a 16 e1 63-e7 ba 39 d8 2a fa 8a 6b   ..8,...c..9.*..k&lt;br /&gt;
01e0 - 25 45 0b c9 4d b8 d2 be-a9 3a e3 ff 61 60 f9 a4   %E..M....:..a`..&lt;br /&gt;
01f0 - 99 4e 3f c2 25 0b 21 07-c6 1b 1e 63 71 2e 3d 31   .N?.%.!....cq.=1&lt;br /&gt;
0200 - 42 98 01 f4 88 b8 80 26-b7 bf 5b 00 b1 57 86 b4   B......&amp;amp;..[..W..&lt;br /&gt;
0210 - d8 70 e6 ec ea 98 e1 17-45 a7 ff 83 e0 76 6f 8a   .p......E....vo.&lt;br /&gt;
0220 - 50 bb 1d cb c5 8f f4 01-84 4e 59 c3 4d 28 73 70   P........NY.M(sp&lt;br /&gt;
0230 - 39 c8 da 85 43 b9 07 ae-57 26 04 24 b2 d6 d4 7c   9...C...W&amp;amp;.$...|&lt;br /&gt;
0240 - 03 af 4f 72 00 8f 20 ed-26 77 b3 bf 4e 01 62 8b   ..Or.. .&amp;amp;w..N.b.&lt;br /&gt;
0250 - 62 1b 10 16 65 92 f5 bb-5a dc 83 5c f2 56 f3 60   b...e...Z..\.V.`&lt;br /&gt;
0260 - 34 2c ef 62 f4 ee cf 26-6d 9b 4a 5e 74 05 74 fb   4,.b...&amp;amp;m.J^t.t.&lt;br /&gt;
0270 - 23 86 07 6f cf b0 48 6d-ba 2d 89 5d 0f e0 c0 01   #..o..Hm.-.]....&lt;br /&gt;
0280 - 1c 91 af 00 5f f3 02 03-01 00 01 a3 82 01 29 30   ...._.........)0&lt;br /&gt;
0290 - 82 01 25 30 1f 06 03 55-1d 23 04 18 30 16 80 14   ..%0...U.#..0...&lt;br /&gt;
02a0 - 6b 69 3d 6a 18 42 4a dd-8f 02 65 39 fd 35 24 86   ki=j.BJ...e9.5$.&lt;br /&gt;
02b0 - 78 91 16 30 30 0e 06 03-55 1d 0f 01 01 ff 04 04   x..00...U.......&lt;br /&gt;
02c0 - 03 02 05 a0 30 1d 06 03-55 1d 25 04 16 30 14 06   ....0...U.%..0..&lt;br /&gt;
02d0 - 08 2b 06 01 05 05 07 03-01 06 08 2b 06 01 05 05   .+.........+....&lt;br /&gt;
02e0 - 07 03 02 30 16 06 03 55-1d 11 04 0f 30 0d 82 0b   ...0...U....0...&lt;br /&gt;
02f0 - 61 6c 74 65 65 76 65 2e-63 6f 6d 30 43 06 03 55   alteeve.com0C..U&lt;br /&gt;
0300 - 1d 1f 04 3c 30 3a 30 38-a0 36 a0 34 86 32 68 74   ...&amp;lt;0:08.6.4.2ht&lt;br /&gt;
0310 - 74 70 3a 2f 2f 72 61 70-69 64 73 73 6c 2d 63 72   tp://rapidssl-cr&lt;br /&gt;
0320 - 6c 2e 67 65 6f 74 72 75-73 74 2e 63 6f 6d 2f 63   l.geotrust.com/c&lt;br /&gt;
0330 - 72 6c 73 2f 72 61 70 69-64 73 73 6c 2e 63 72 6c   rls/rapidssl.crl&lt;br /&gt;
0340 - 30 1d 06 03 55 1d 0e 04-16 04 14 a1 2b 4e af 55   0...U.......+N.U&lt;br /&gt;
0350 - 08 7b 34 be 74 fc 57 41-de bc 8f d9 4a 1d c9 30   .{4.t.WA....J..0&lt;br /&gt;
0360 - 0c 06 03 55 1d 13 01 01-ff 04 02 30 00 30 49 06   ...U.......0.0I.&lt;br /&gt;
0370 - 08 2b 06 01 05 05 07 01-01 04 3d 30 3b 30 39 06   .+........=0;09.&lt;br /&gt;
0380 - 08 2b 06 01 05 05 07 30-02 86 2d 68 74 74 70 3a   .+.....0..-http:&lt;br /&gt;
0390 - 2f 2f 72 61 70 69 64 73-73 6c 2d 61 69 61 2e 67   //rapidssl-aia.g&lt;br /&gt;
03a0 - 65 6f 74 72 75 73 74 2e-63 6f 6d 2f 72 61 70 69   eotrust.com/rapi&lt;br /&gt;
03b0 - 64 73 73 6c 2e 63 72 74-30 0d 06 09 2a 86 48 86   dssl.crt0...*.H.&lt;br /&gt;
03c0 - f7 0d 01 01 05 05 00 03-82 01 01 00 66 8b 6f a8   ............f.o.&lt;br /&gt;
03d0 - d5 d2 84 c7 89 31 fb a5-ba e1 11 5e 2f 67 6f df   .....1.....^/go.&lt;br /&gt;
03e0 - 0d 3c 0b 1a 4b ac d9 38-ee 29 0a 4d d9 06 98 2c   .&amp;lt;..K..8.).M...,&lt;br /&gt;
03f0 - 25 0a 59 bb 39 03 b0 cd-3b 06 93 3e 59 90 cf 06   %.Y.9...;..&amp;gt;Y...&lt;br /&gt;
0400 - 17 74 77 bb cd 91 34 d0-6f b9 8f 53 57 ed 14 30   .tw...4.o..SW..0&lt;br /&gt;
0410 - bd e9 6c 04 84 b6 f0 16-9d 29 9b b1 47 f8 84 64   ..l......)..G..d&lt;br /&gt;
0420 - 5f 03 36 ea e1 d6 13 97-5b 50 b9 b2 59 cc f8 ef   _.6.....[P..Y...&lt;br /&gt;
0430 - 23 01 99 91 6e 5e e8 d0-77 54 38 49 18 58 e7 0e   #...n^..wT8I.X..&lt;br /&gt;
0440 - 54 35 c0 37 b5 9e 79 b2-d4 c6 d9 ff 27 31 d4 bf   T5.7..y.....&#039;1..&lt;br /&gt;
0450 - 04 ae d3 0a 90 4b bc 34-bc 53 f8 bc e7 4c 22 b7   .....K.4.S...L&amp;quot;.&lt;br /&gt;
0460 - b3 bc 8c d7 41 44 fc e0-50 2e 9a ac ba 5c ee 88   ....AD..P....\..&lt;br /&gt;
0470 - 03 fc 0e 53 32 aa dd a4-24 ee a6 7c 3d dc 9d 7a   ...S2...$..|=..z&lt;br /&gt;
0480 - 82 0b 9f b8 91 e0 a1 12-77 a3 95 f7 d0 c4 9e f1   ........w.......&lt;br /&gt;
0490 - d7 d9 99 68 80 e8 af ad-68 f5 1a 5f 66 06 78 c9   ...h....h.._f.x.&lt;br /&gt;
04a0 - 56 f8 36 37 16 fa 7d 27-df 1d a2 d8 7c 8c 5b 50   V.67..}&#039;....|.[P&lt;br /&gt;
04b0 - db c6 fe 06 ff 96 86 f5-1f e4 35 ce cf 43 66 53   ..........5..CfS&lt;br /&gt;
04c0 - da a1 50 b5 c0 73 ec 1e-f4 c8 20 13 00 03 d9 30   ..P..s.... ....0&lt;br /&gt;
04d0 - 82 03 d5 30 82 02 bd a0-03 02 01 02 02 03 02 36   ...0...........6&lt;br /&gt;
04e0 - d1 30 0d 06 09 2a 86 48-86 f7 0d 01 01 05 05 00   .0...*.H........&lt;br /&gt;
04f0 - 30 42 31 0b 30 09 06 03-55 04 06 13 02 55 53 31   0B1.0...U....US1&lt;br /&gt;
0500 - 16 30 14 06 03 55 04 0a-13 0d 47 65 6f 54 72 75   .0...U....GeoTru&lt;br /&gt;
0510 - 73 74 20 49 6e 63 2e 31-1b 30 19 06 03 55 04 03   st Inc.1.0...U..&lt;br /&gt;
0520 - 13 12 47 65 6f 54 72 75-73 74 20 47 6c 6f 62 61   ..GeoTrust Globa&lt;br /&gt;
0530 - 6c 20 43 41 30 1e 17 0d-31 30 30 32 31 39 32 32   l CA0...10021922&lt;br /&gt;
0540 - 34 35 30 35 5a 17 0d 32-30 30 32 31 38 32 32 34   4505Z..200218224&lt;br /&gt;
0550 - 35 30 35 5a 30 3c 31 0b-30 09 06 03 55 04 06 13   505Z0&amp;lt;1.0...U...&lt;br /&gt;
0560 - 02 55 53 31 17 30 15 06-03 55 04 0a 13 0e 47 65   .US1.0...U....Ge&lt;br /&gt;
0570 - 6f 54 72 75 73 74 2c 20-49 6e 63 2e 31 14 30 12   oTrust, Inc.1.0.&lt;br /&gt;
0580 - 06 03 55 04 03 13 0b 52-61 70 69 64 53 53 4c 20   ..U....RapidSSL &lt;br /&gt;
0590 - 43 41 30 82 01 22 30 0d-06 09 2a 86 48 86 f7 0d   CA0..&amp;quot;0...*.H...&lt;br /&gt;
05a0 - 01 01 01 05 00 03 82 01-0f 00 30 82 01 0a 02 82   ..........0.....&lt;br /&gt;
05b0 - 01 01 00 c7 71 f8 56 c7-1e d9 cc b5 ad f6 b4 97   ....q.V.........&lt;br /&gt;
05c0 - a3 fb a1 e6 0b 50 5f 50-aa 3a da 0f fc 3d 29 24   .....P_P.:...=)$&lt;br /&gt;
05d0 - 43 c6 10 29 c1 fc 55 40-72 ee bd ea df 9f b6 41   C..)..U@r......A&lt;br /&gt;
05e0 - f4 48 4b c8 6e fe 4f 57-12 8b 5b fa 92 dd 5e e8   .HK.n.OW..[...^.&lt;br /&gt;
05f0 - ad f3 f0 1b b1 7b 4d fb-cf fd d1 e5 f8 e3 dc e7   .....{M.........&lt;br /&gt;
0600 - f5 73 7f df 01 49 cf 8c-56 c1 bd 37 e3 5b be b5   .s...I..V..7.[..&lt;br /&gt;
0610 - 4f 8b 8b f0 da 4f c7 e3-dd 55 47 69 df f2 5b 7b   O....O...UGi..[{&lt;br /&gt;
0620 - 07 4f 3d e5 ac 21 c1 c8-1d 7a e8 e7 f6 0f a1 aa   .O=..!...z......&lt;br /&gt;
0630 - f5 6f de a8 65 4f 10 89-9c 03 f3 89 7a a5 5e 01   .o..eO......z.^.&lt;br /&gt;
0640 - 72 33 ed a9 e9 5a 1e 79-f3 87 c8 df c8 c5 fc 37   r3...Z.y.......7&lt;br /&gt;
0650 - c8 9a 9a d7 b8 76 cc b0-3e e7 fd e6 54 ea df 5f   .....v..&amp;gt;...T.._&lt;br /&gt;
0660 - 52 41 78 59 57 ad f1 12-d6 7f bc d5 9f 70 d3 05   RAxYW........p..&lt;br /&gt;
0670 - 6c fa a3 7d 67 58 dd 26-62 1d 31 92 0c 79 79 1c   l..}gX.&amp;amp;b.1..yy.&lt;br /&gt;
0680 - 8e cf ca 7b c1 66 af a8-74 48 fb 8e 82 c2 9e 2c   ...{.f..tH.....,&lt;br /&gt;
0690 - 99 5c 7b 2d 5d 9b bc 5b-57 9e 7c 3a 7a 13 ad f2   .\{-]..[W.|:z...&lt;br /&gt;
06a0 - a3 18 5b 2b 59 0f cd 5c-3a eb 68 33 c6 28 1d 82   ..[+Y..\:.h3.(..&lt;br /&gt;
06b0 - d1 50 8b 02 03 01 00 01-a3 81 d9 30 81 d6 30 0e   .P.........0..0.&lt;br /&gt;
06c0 - 06 03 55 1d 0f 01 01 ff-04 04 03 02 01 06 30 1d   ..U...........0.&lt;br /&gt;
06d0 - 06 03 55 1d 0e 04 16 04-14 6b 69 3d 6a 18 42 4a   ..U......ki=j.BJ&lt;br /&gt;
06e0 - dd 8f 02 65 39 fd 35 24-86 78 91 16 30 30 1f 06   ...e9.5$.x..00..&lt;br /&gt;
06f0 - 03 55 1d 23 04 18 30 16-80 14 c0 7a 98 68 8d 89   .U.#..0....z.h..&lt;br /&gt;
0700 - fb ab 05 64 0c 11 7d aa-7d 65 b8 ca cc 4e 30 12   ...d..}.}e...N0.&lt;br /&gt;
0710 - 06 03 55 1d 13 01 01 ff-04 08 30 06 01 01 ff 02   ..U.......0.....&lt;br /&gt;
0720 - 01 00 30 3a 06 03 55 1d-1f 04 33 30 31 30 2f a0   ..0:..U...3010/.&lt;br /&gt;
0730 - 2d a0 2b 86 29 68 74 74-70 3a 2f 2f 63 72 6c 2e   -.+.)http://crl.&lt;br /&gt;
0740 - 67 65 6f 74 72 75 73 74-2e 63 6f 6d 2f 63 72 6c   geotrust.com/crl&lt;br /&gt;
0750 - 73 2f 67 74 67 6c 6f 62-61 6c 2e 63 72 6c 30 34   s/gtglobal.crl04&lt;br /&gt;
0760 - 06 08 2b 06 01 05 05 07-01 01 04 28 30 26 30 24   ..+........(0&amp;amp;0$&lt;br /&gt;
0770 - 06 08 2b 06 01 05 05 07-30 01 86 18 68 74 74 70   ..+.....0...http&lt;br /&gt;
0780 - 3a 2f 2f 6f 63 73 70 2e-67 65 6f 74 72 75 73 74   ://ocsp.geotrust&lt;br /&gt;
0790 - 2e 63 6f 6d 30 0d 06 09-2a 86 48 86 f7 0d 01 01   .com0...*.H.....&lt;br /&gt;
07a0 - 05 05 00 03 82 01 01 00-ab bc bc 0a 5d 18 94 e3   ............]...&lt;br /&gt;
07b0 - c1 b1 c3 a8 4c 55 d6 be-b4 98 f1 ee 3c 1c cd cf   ....LU......&amp;lt;...&lt;br /&gt;
07c0 - f3 24 24 5c 96 03 27 58-fc 36 ae a2 2f 8f f1 fe   .$$\..&#039;X.6../...&lt;br /&gt;
07d0 - da 2b 02 c3 33 bd c8 dd-48 22 2b 60 0f a5 03 10   .+..3...H&amp;quot;+`....&lt;br /&gt;
07e0 - fd 77 f8 d0 ed 96 67 4f-fd ea 47 20 70 54 dc a9   .w....gO..G pT..&lt;br /&gt;
07f0 - 0c 55 7e e1 96 25 8a d9-b5 da 57 4a be 8d 8e 49   .U~..%....WJ...I&lt;br /&gt;
0800 - 43 63 a5 6c 4e 27 87 25-eb 5b 6d fe a2 7f 38 28   Cc.lN&#039;.%.[m...8(&lt;br /&gt;
0810 - e0 36 ab ad 39 a5 a5 62-c4 b7 5c 58 2c aa 5d 01   .6..9..b..\X,.].&lt;br /&gt;
0820 - 60 a6 62 67 a3 c0 c7 62-23 f4 e7 6c 46 ee b5 d3   `.bg...b#..lF...&lt;br /&gt;
0830 - 80 6a 22 13 d2 2d 3f 74-4f ea af 8c 5f b4 38 9c   .j&amp;quot;..-?tO..._.8.&lt;br /&gt;
0840 - db ae ce af 84 1e a6 f6-34 51 59 79 d3 e3 75 dc   ........4QYy..u.&lt;br /&gt;
0850 - bc d7 f3 73 df 92 ec d2-20 59 6f 9c fb 95 f8 92   ...s.... Yo.....&lt;br /&gt;
0860 - 76 18 0a 7c 0f 2c a6 ca-de 8a 62 7b d8 f3 ce 5f   v..|.,....b{..._&lt;br /&gt;
0870 - 68 bd 8f 3e c1 74 bb 15-72 3a 16 83 a9 0b e6 4d   h..&amp;gt;.t..r:.....M&lt;br /&gt;
0880 - 99 9c d8 57 ec a8 01 51-c7 6f 57 34 5e ab 4a 2c   ...W...Q.oW4^.J,&lt;br /&gt;
0890 - 42 f6 4f 1c 89 78 de 26-4e f5 6f 93 4c 15 6b 27   B.O..x.&amp;amp;N.o.L.k&#039;&lt;br /&gt;
08a0 - 56 4d 00 54 6c 7a b7 b7-00 03 81 30 82 03 7d 30   VM.Tlz.....0..}0&lt;br /&gt;
08b0 - 82 02 e6 a0 03 02 01 02-02 03 12 bb e6 30 0d 06   .............0..&lt;br /&gt;
08c0 - 09 2a 86 48 86 f7 0d 01-01 05 05 00 30 4e 31 0b   .*.H........0N1.&lt;br /&gt;
08d0 - 30 09 06 03 55 04 06 13-02 55 53 31 10 30 0e 06   0...U....US1.0..&lt;br /&gt;
08e0 - 03 55 04 0a 13 07 45 71-75 69 66 61 78 31 2d 30   .U....Equifax1-0&lt;br /&gt;
08f0 - 2b 06 03 55 04 0b 13 24-45 71 75 69 66 61 78 20   +..U...$Equifax &lt;br /&gt;
0900 - 53 65 63 75 72 65 20 43-65 72 74 69 66 69 63 61   Secure Certifica&lt;br /&gt;
0910 - 74 65 20 41 75 74 68 6f-72 69 74 79 30 1e 17 0d   te Authority0...&lt;br /&gt;
0920 - 30 32 30 35 32 31 30 34-30 30 30 30 5a 17 0d 31   020521040000Z..1&lt;br /&gt;
0930 - 38 30 38 32 31 30 34 30-30 30 30 5a 30 42 31 0b   80821040000Z0B1.&lt;br /&gt;
0940 - 30 09 06 03 55 04 06 13-02 55 53 31 16 30 14 06   0...U....US1.0..&lt;br /&gt;
0950 - 03 55 04 0a 13 0d 47 65-6f 54 72 75 73 74 20 49   .U....GeoTrust I&lt;br /&gt;
0960 - 6e 63 2e 31 1b 30 19 06-03 55 04 03 13 12 47 65   nc.1.0...U....Ge&lt;br /&gt;
0970 - 6f 54 72 75 73 74 20 47-6c 6f 62 61 6c 20 43 41   oTrust Global CA&lt;br /&gt;
0980 - 30 82 01 22 30 0d 06 09-2a 86 48 86 f7 0d 01 01   0..&amp;quot;0...*.H.....&lt;br /&gt;
0990 - 01 05 00 03 82 01 0f 00-30 82 01 0a 02 82 01 01   ........0.......&lt;br /&gt;
09a0 - 00 da cc 18 63 30 fd f4-17 23 1a 56 7e 5b df 3c   ....c0...#.V~[.&amp;lt;&lt;br /&gt;
09b0 - 6c 38 e4 71 b7 78 91 d4-bc a1 d8 4c f8 a8 43 b6   l8.q.x.....L..C.&lt;br /&gt;
09c0 - 03 e9 4d 21 07 08 88 da-58 2f 66 39 29 bd 05 78   ..M!....X/f9)..x&lt;br /&gt;
09d0 - 8b 9d 38 e8 05 b7 6a 7e-71 a4 e6 c4 60 a6 b0 ef   ..8...j~q...`...&lt;br /&gt;
09e0 - 80 e4 89 28 0f 9e 25 d6-ed 83 f3 ad a6 91 c7 98   ...(..%.........&lt;br /&gt;
09f0 - c9 42 18 35 14 9d ad 98-46 92 2e 4f ca f1 87 43   .B.5....F..O...C&lt;br /&gt;
0a00 - c1 16 95 57 2d 50 ef 89-2d 80 7a 57 ad f2 ee 5f   ...W-P..-.zW..._&lt;br /&gt;
0a10 - 6b d2 00 8d b9 14 f8 14-15 35 d9 c0 46 a3 7b 72   k........5..F.{r&lt;br /&gt;
0a20 - c8 91 bf c9 55 2b cd d0-97 3e 9c 26 64 cc df ce   ....U+...&amp;gt;.&amp;amp;d...&lt;br /&gt;
0a30 - 83 19 71 ca 4e e6 d4 d5-7b a9 19 cd 55 de c8 ec   ..q.N...{...U...&lt;br /&gt;
0a40 - d2 5e 38 53 e5 5c 4f 8c-2d fe 50 23 36 fc 66 e6   .^8S.\O.-.P#6.f.&lt;br /&gt;
0a50 - cb 8e a4 39 19 00 b7 95-02 39 91 0b 0e fe 38 2e   ...9.....9....8.&lt;br /&gt;
0a60 - d1 1d 05 9a f6 4d 3e 6f-0f 07 1d af 2c 1e 8f 60   .....M&amp;gt;o....,..`&lt;br /&gt;
0a70 - 39 e2 fa 36 53 13 39 d4-5e 26 2b db 3d a8 14 bd   9..6S.9.^&amp;amp;+.=...&lt;br /&gt;
0a80 - 32 eb 18 03 28 52 04 71-e5 ab 33 3d e1 38 bb 07   2...(R.q..3=.8..&lt;br /&gt;
0a90 - 36 84 62 9c 79 ea 16 30-f4 5f c0 2b e8 71 6b e4   6.b.y..0._.+.qk.&lt;br /&gt;
0aa0 - f9 02 03 01 00 01 a3 81-f0 30 81 ed 30 1f 06 03   .........0..0...&lt;br /&gt;
0ab0 - 55 1d 23 04 18 30 16 80-14 48 e6 68 f9 2b d2 b2   U.#..0...H.h.+..&lt;br /&gt;
0ac0 - 95 d7 47 d8 23 20 10 4f-33 98 90 9f d4 30 1d 06   ..G.# .O3....0..&lt;br /&gt;
0ad0 - 03 55 1d 0e 04 16 04 14-c0 7a 98 68 8d 89 fb ab   .U.......z.h....&lt;br /&gt;
0ae0 - 05 64 0c 11 7d aa 7d 65-b8 ca cc 4e 30 0f 06 03   .d..}.}e...N0...&lt;br /&gt;
0af0 - 55 1d 13 01 01 ff 04 05-30 03 01 01 ff 30 0e 06   U.......0....0..&lt;br /&gt;
0b00 - 03 55 1d 0f 01 01 ff 04-04 03 02 01 06 30 3a 06   .U...........0:.&lt;br /&gt;
0b10 - 03 55 1d 1f 04 33 30 31-30 2f a0 2d a0 2b 86 29   .U...3010/.-.+.)&lt;br /&gt;
0b20 - 68 74 74 70 3a 2f 2f 63-72 6c 2e 67 65 6f 74 72   http://crl.geotr&lt;br /&gt;
0b30 - 75 73 74 2e 63 6f 6d 2f-63 72 6c 73 2f 73 65 63   ust.com/crls/sec&lt;br /&gt;
0b40 - 75 72 65 63 61 2e 63 72-6c 30 4e 06 03 55 1d 20   ureca.crl0N..U. &lt;br /&gt;
0b50 - 04 47 30 45 30 43 06 04-55 1d 20 00 30 3b 30 39   .G0E0C..U. .0;09&lt;br /&gt;
0b60 - 06 08 2b 06 01 05 05 07-02 01 16 2d 68 74 74 70   ..+........-http&lt;br /&gt;
0b70 - 73 3a 2f 2f 77 77 77 2e-67 65 6f 74 72 75 73 74   s://www.geotrust&lt;br /&gt;
0b80 - 2e 63 6f 6d 2f 72 65 73-6f 75 72 63 65 73 2f 72   .com/resources/r&lt;br /&gt;
0b90 - 65 70 6f 73 69 74 6f 72-79 30 0d 06 09 2a 86 48   epository0...*.H&lt;br /&gt;
0ba0 - 86 f7 0d 01 01 05 05 00-03 81 81 00 76 e1 12 6e   ............v..n&lt;br /&gt;
0bb0 - 4e 4b 16 12 86 30 06 b2-81 08 cf f0 08 c7 c7 71   NK...0.........q&lt;br /&gt;
0bc0 - 7e 66 ee c2 ed d4 3b 1f-ff f0 f0 c8 4e d6 43 38   ~f....;.....N.C8&lt;br /&gt;
0bd0 - b0 b9 30 7d 18 d0 55 83-a2 6a cb 36 11 9c e8 48   ..0}..U..j.6...H&lt;br /&gt;
0be0 - 66 a3 6d 7f b8 13 d4 47-fe 8b 5a 5c 73 fc ae d9   f.m....G..Z\s...&lt;br /&gt;
0bf0 - 1b 32 19 38 ab 97 34 14-aa 96 d2 eb a3 1c 14 08   .2.8..4.........&lt;br /&gt;
0c00 - 49 b6 bb e5 91 ef 83 36-eb 1d 56 6f ca da bc 73   I......6..Vo...s&lt;br /&gt;
0c10 - 63 90 e4 7f 7b 3e 22 cb-3d 07 ed 5f 38 74 9c e3   c...{&amp;gt;&amp;quot;.=.._8t..&lt;br /&gt;
0c20 - 03 50 4e a1 af 98 ee 61-f2 84 3f 12               .PN....a..?.&lt;br /&gt;
depth=3 C = US, O = Equifax, OU = Equifax Secure Certificate Authority&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=1 C = US, O = &amp;quot;GeoTrust, Inc.&amp;quot;, CN = RapidSSL CA&lt;br /&gt;
verify return:1&lt;br /&gt;
depth=0 serialNumber = 0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF, C = CA, O = alteeve.com, OU = GT13908817, OU = See www.rapidssl.com/resources/cps (c)11, OU = Domain Control Validated - FreeSSL, CN = alteeve.com&lt;br /&gt;
verify return:1&lt;br /&gt;
SSL_connect:SSLv3 read server certificate A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 02 0d                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (525 bytes =&amp;gt; 525 (0x20D))&lt;br /&gt;
0000 - 0c 00 02 09 00 80 d6 7d-e4 40 cb bb dc 19 36 d6   .......}.@....6.&lt;br /&gt;
0010 - 93 d3 4a fd 0a d5 0c 84-d2 39 a4 5f 52 0b b8 81   ..J......9._R...&lt;br /&gt;
0020 - 74 cb 98 bc e9 51 84 9f-91 2e 63 9c 72 fb 13 b4   t....Q....c.r...&lt;br /&gt;
0030 - b4 d7 17 7e 16 d5 5a c1-79 ba 42 0b 2a 29 fe 32   ...~..Z.y.B.*).2&lt;br /&gt;
0040 - 4a 46 7a 63 5e 81 ff 59-01 37 7b ed dc fd 33 16   JFzc^..Y.7{...3.&lt;br /&gt;
0050 - 8a 46 1a ad 3b 72 da e8-86 00 78 04 5b 07 a7 db   .F..;r....x.[...&lt;br /&gt;
0060 - ca 78 74 08 7d 15 10 ea-9f cc 9d dd 33 05 07 dd   .xt.}.......3...&lt;br /&gt;
0070 - 62 db 88 ae aa 74 7d e0-f4 d6 e2 bd 68 b0 e7 39   b....t}.....h..9&lt;br /&gt;
0080 - 3e 0f 24 21 8e b3 00 01-02 00 80 51 5c 13 33 38   &amp;gt;.$!.......Q\.38&lt;br /&gt;
0090 - 83 ef 76 6f 23 52 55 bf-23 ba 7f f0 a4 ca 35 01   ..vo#RU.#.....5.&lt;br /&gt;
00a0 - 9c 70 e1 61 b2 0d 7b 5c-1c 32 02 c1 ac 14 be e9   .p.a..{\.2......&lt;br /&gt;
00b0 - b9 7a 5d 11 9b 53 48 64-cd 12 b8 15 4c df cc 10   .z]..SHd....L...&lt;br /&gt;
00c0 - 4e 2b e7 cd 3f 33 68 1a-60 cc f7 18 25 7c e5 ca   N+..?3h.`...%|..&lt;br /&gt;
00d0 - c8 cb 45 ba 2a 6d dc 84-5f 26 6f 9a a3 73 b9 7f   ..E.*m.._&amp;amp;o..s..&lt;br /&gt;
00e0 - 02 cb 7b a7 ac 59 9f f3-6e c9 01 ed b9 35 99 49   ..{..Y..n....5.I&lt;br /&gt;
00f0 - 37 77 68 65 ec e2 f7 17-03 e7 f5 f5 86 33 e6 6c   7whe.........3.l&lt;br /&gt;
0100 - 06 3c 15 83 98 74 2e b9-83 31 11 01 00 20 6e 17   .&amp;lt;...t...1... n.&lt;br /&gt;
0110 - 3d 2d ec 3e 19 b2 9e 5b-37 38 3a 31 57 3d 0e c1   =-.&amp;gt;...[78:1W=..&lt;br /&gt;
0120 - 6b c4 b4 83 d9 6b f0 d3-44 db 9f 18 55 15 e1 09   k....k..D...U...&lt;br /&gt;
0130 - 73 59 8c 46 3d a4 47 58-b1 71 a3 32 b5 06 26 8c   sY.F=.GX.q.2..&amp;amp;.&lt;br /&gt;
0140 - 27 88 9e 13 c8 12 5d 94-9b 24 54 10 aa 79 e5 b4   &#039;.....]..$T..y..&lt;br /&gt;
0150 - 43 f5 5e 4c 01 dc 02 aa-69 02 37 71 4e 26 1c 0b   C.^L....i.7qN&amp;amp;..&lt;br /&gt;
0160 - 40 19 c9 95 4d af 93 35-07 7a ff b1 96 7f 03 ce   @...M..5.z......&lt;br /&gt;
0170 - 7a eb a2 1c 97 6b d2 97-d2 0f 1a f5 b2 af fb 65   z....k.........e&lt;br /&gt;
0180 - 86 b9 e3 38 30 ba f5 02-d6 6b fc da 94 93 8b b3   ...80....k......&lt;br /&gt;
0190 - 96 b5 b7 58 dc 36 55 6d-e9 47 e5 4a 33 1d b9 d9   ...X.6Um.G.J3...&lt;br /&gt;
01a0 - ec 33 e8 fb 58 c8 74 13-ff dd 40 b7 35 56 63 03   .3..X.t...@.5Vc.&lt;br /&gt;
01b0 - 9f 16 2f 72 be 56 56 c3-15 3a c3 10 09 f0 9d f2   ../r.VV..:......&lt;br /&gt;
01c0 - 42 52 5a ce d6 db 61 0e-d0 e2 ac 2e 9e 04 30 8e   BRZ...a.......0.&lt;br /&gt;
01d0 - 0d d7 07 f9 3e 0a a8 3b-8d 11 5c 6e 21 47 28 2d   ....&amp;gt;..;..\n!G(-&lt;br /&gt;
01e0 - 28 31 a6 3d d0 e9 2e 7a-de 4a 00 2a a8 6f 5d 82   (1.=...z.J.*.o].&lt;br /&gt;
01f0 - 45 df 3e 06 e3 11 e3 3c-b9 1e 34 b8 bd 60 fd a7   E.&amp;gt;....&amp;lt;..4..`..&lt;br /&gt;
0200 - a2 c1 c8 19 61 19 da 10-e4 c3 70 7e 5f            ....a.....p~_&lt;br /&gt;
SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 04                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (4 bytes =&amp;gt; 4 (0x4))&lt;br /&gt;
0000 - 0e                                                .&lt;br /&gt;
0004 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
SSL_connect:SSLv3 read server done A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (139 bytes =&amp;gt; 139 (0x8B))&lt;br /&gt;
0000 - 16 03 01 00 86 10 00 00-82 00 80 7f 9d d2 3b 68   ..............;h&lt;br /&gt;
0010 - 49 c9 dd ed 4f 35 a0 70-3a 28 0f ce c1 5a 81 ce   I...O5.p:(...Z..&lt;br /&gt;
0020 - cd 46 c5 e5 a4 44 25 04-4e b4 48 d8 3b a6 d4 44   .F...D%.N.H.;..D&lt;br /&gt;
0030 - 4e 9a dc 20 fa 52 9f eb-52 3b 3c 3e 34 dc ed 34   N.. .R..R;&amp;lt;&amp;gt;4..4&lt;br /&gt;
0040 - e5 b7 10 f9 6d 3a c0 84-64 bf b8 91 54 6c 37 1b   ....m:..d...Tl7.&lt;br /&gt;
0050 - eb 75 7a 95 aa e8 83 6f-e0 16 f2 af 77 0f 7a 0c   .uz....o....w.z.&lt;br /&gt;
0060 - a8 82 27 a4 a5 f2 f0 1b-d2 6e 46 c4 ef 10 7c 39   ..&#039;......nF...|9&lt;br /&gt;
0070 - 6c 87 74 ec 68 7e d5 9a-10 ab 10 03 75 a2 fb 4b   l.t.h~......u..K&lt;br /&gt;
0080 - 8c 49 4c da 64 49 bd 27-ba 51 a4                  .IL.dI.&#039;.Q.&lt;br /&gt;
SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (6 bytes =&amp;gt; 6 (0x6))&lt;br /&gt;
0000 - 14 03 01 00 01 01                                 ......&lt;br /&gt;
SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;
write to 0x196a050 [0x1a1add0] (53 bytes =&amp;gt; 53 (0x35))&lt;br /&gt;
0000 - 16 03 01 00 30 b4 8a 74-4d a4 bf b1 54 04 8a 25   ....0..tM...T..%&lt;br /&gt;
0010 - 24 f8 81 f1 64 9f 1f 6d-fb bd a7 4c 57 6a a5 63   $...d..m...LWj.c&lt;br /&gt;
0020 - fb 3a dd 8e e3 f9 38 f6-22 fd 7e 42 81 2e a2 41   .:....8.&amp;quot;.~B...A&lt;br /&gt;
0030 - 1f 74 d1 27 02                                    .t.&#039;.&lt;br /&gt;
SSL_connect:SSLv3 write finished A&lt;br /&gt;
SSL_connect:SSLv3 flush data&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 ca                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (202 bytes =&amp;gt; 202 (0xCA))&lt;br /&gt;
0000 - 04 00 00 c6 00 00 00 00-00 c0 6c f3 41 26 c8 6b   ..........l.A&amp;amp;.k&lt;br /&gt;
0010 - 1e 9c 2e 78 af 75 b2 46-34 f4 30 c3 bd e4 ee 2f   ...x.u.F4.0..../&lt;br /&gt;
0020 - f6 28 37 f6 7c 55 3b c7-08 ad 1e 48 f1 83 9f 9a   .(7.|U;....H....&lt;br /&gt;
0030 - d4 ef 9b 7d 5a 9c f7 5b-92 e9 2f ca c3 e5 44 c7   ...}Z..[../...D.&lt;br /&gt;
0040 - 7a c1 ed db 98 1a 18 bd-25 30 3c 50 ad 96 23 22   z.......%0&amp;lt;P..#&amp;quot;&lt;br /&gt;
0050 - 7e a1 b7 eb 1d b5 cc 69-2a 43 63 13 4f 21 90 32   ~......i*Cc.O!.2&lt;br /&gt;
0060 - 87 94 0b 6a 66 da 99 fa-45 79 cc 53 29 35 59 0d   ...jf...Ey.S)5Y.&lt;br /&gt;
0070 - 02 93 c6 c6 af f3 52 79-b5 36 c0 a6 4d 22 9f af   ......Ry.6..M&amp;quot;..&lt;br /&gt;
0080 - 4a f2 86 b4 50 68 83 b1-ab a6 a6 ac 6e 4e 18 3d   J...Ph......nN.=&lt;br /&gt;
0090 - 80 a7 b4 85 77 06 69 60-fa b2 22 9a 79 14 c6 3e   ....w.i`..&amp;quot;.y..&amp;gt;&lt;br /&gt;
00a0 - 3e 68 33 4e 1e a9 40 09-47 d0 02 97 8b ba 39 db   &amp;gt;h3N..@.G.....9.&lt;br /&gt;
00b0 - 2f b1 1c 2e 66 49 d3 bc-99 cc 56 4f 1d f4 c6 7b   /...fI....VO...{&lt;br /&gt;
00c0 - 58 3e 28 df b1 ce 2b 45-36 ca                     X&amp;gt;(...+E6.&lt;br /&gt;
SSL_connect:SSLv3 read server session ticket A&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 14 03 01 00 01                                    .....&lt;br /&gt;
read from 0x196a050 [0x1a10908] (1 bytes =&amp;gt; 1 (0x1))&lt;br /&gt;
0000 - 01                                                .&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 16 03 01 00 30                                    ....0&lt;br /&gt;
read from 0x196a050 [0x1a10908] (48 bytes =&amp;gt; 48 (0x30))&lt;br /&gt;
0000 - c0 79 35 bf c6 1e 7e d4-04 cf 68 c7 9d f5 9f 42   .y5...~...h....B&lt;br /&gt;
0010 - 03 91 5f 72 ae 5b ec a8-aa e7 af e8 f3 39 1b cd   .._r.[.......9..&lt;br /&gt;
0020 - 13 05 56 f2 1b 28 c9 42-4b 67 88 48 20 c2 a5 06   ..V..(.BKg.H ...&lt;br /&gt;
SSL_connect:SSLv3 read finished A&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
   i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
 1 s:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEvjCCA6agAwIBAgIDAhUkMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT&lt;br /&gt;
MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew&lt;br /&gt;
HhcNMTEwNjE0MTIxOTAxWhcNMTEwNzE2MTU1NjE0WjCB2TEpMCcGA1UEBRMgMFRT&lt;br /&gt;
NVd6YXVRUko3c2MyYi1oVEd3SzF5eFNmRURwaEYxCzAJBgNVBAYTAkNBMRQwEgYD&lt;br /&gt;
VQQKEwthbHRlZXZlLmNvbTETMBEGA1UECxMKR1QxMzkwODgxNzExMC8GA1UECxMo&lt;br /&gt;
U2VlIHd3dy5yYXBpZHNzbC5jb20vcmVzb3VyY2VzL2NwcyAoYykxMTErMCkGA1UE&lt;br /&gt;
CxMiRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkIC0gRnJlZVNTTDEUMBIGA1UEAxML&lt;br /&gt;
YWx0ZWV2ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHtXUD&lt;br /&gt;
x6m1IbJ6m3CN8kRd4Bj0BVLGk9MXpTrHRgNo0QFTG+i400xWRrLKYzSILE97I0kH&lt;br /&gt;
7443XIqs14ib7aEBkLwy2EYwbYIzWeq1OCyKFuFj57o52Cr6imslRQvJTbjSvqk6&lt;br /&gt;
4/9hYPmkmU4/wiULIQfGGx5jcS49MUKYAfSIuIAmt79bALFXhrTYcObs6pjhF0Wn&lt;br /&gt;
/4Pgdm+KULsdy8WP9AGETlnDTShzcDnI2oVDuQeuVyYEJLLW1HwDr09yAI8g7SZ3&lt;br /&gt;
s79OAWKLYhsQFmWS9bta3INc8lbzYDQs72L07s8mbZtKXnQFdPsjhgdvz7BIbbot&lt;br /&gt;
iV0P4MABHJGvAF/zAgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRraT1qGEJK3Y8C&lt;br /&gt;
ZTn9NSSGeJEWMDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG&lt;br /&gt;
CCsGAQUFBwMCMBYGA1UdEQQPMA2CC2FsdGVldmUuY29tMEMGA1UdHwQ8MDowOKA2&lt;br /&gt;
oDSGMmh0dHA6Ly9yYXBpZHNzbC1jcmwuZ2VvdHJ1c3QuY29tL2NybHMvcmFwaWRz&lt;br /&gt;
c2wuY3JsMB0GA1UdDgQWBBShK06vVQh7NL50/FdB3ryP2UodyTAMBgNVHRMBAf8E&lt;br /&gt;
AjAAMEkGCCsGAQUFBwEBBD0wOzA5BggrBgEFBQcwAoYtaHR0cDovL3JhcGlkc3Ns&lt;br /&gt;
LWFpYS5nZW90cnVzdC5jb20vcmFwaWRzc2wuY3J0MA0GCSqGSIb3DQEBBQUAA4IB&lt;br /&gt;
AQBmi2+o1dKEx4kx+6W64RFeL2dv3w08CxpLrNk47ikKTdkGmCwlClm7OQOwzTsG&lt;br /&gt;
kz5ZkM8GF3R3u82RNNBvuY9TV+0UML3pbASEtvAWnSmbsUf4hGRfAzbq4dYTl1tQ&lt;br /&gt;
ubJZzPjvIwGZkW5e6NB3VDhJGFjnDlQ1wDe1nnmy1MbZ/ycx1L8ErtMKkEu8NLxT&lt;br /&gt;
+LznTCK3s7yM10FE/OBQLpqsulzuiAP8DlMyqt2kJO6mfD3cnXqCC5+4keChEnej&lt;br /&gt;
lffQxJ7x19mZaIDor61o9RpfZgZ4yVb4NjcW+n0n3x2i2HyMW1Dbxv4G/5aG9R/k&lt;br /&gt;
Nc7PQ2ZT2qFQtcBz7B70yCAT&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
subject=/serialNumber=0TS5WzauQRJ7sc2b-hTGwK1yxSfEDphF/C=CA/O=alteeve.com/OU=GT13908817/OU=See www.rapidssl.com/resources/cps (c)11/OU=Domain Control Validated - FreeSSL/CN=alteeve.com&lt;br /&gt;
issuer=/C=US/O=GeoTrust, Inc./CN=RapidSSL CA&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 3984 bytes and written 311 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA&lt;br /&gt;
Server public key is 2048 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: zlib compression&lt;br /&gt;
Expansion: zlib compression&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1&lt;br /&gt;
    Cipher    : DHE-RSA-AES256-SHA&lt;br /&gt;
    Session-ID: 2880725EB8BDD73F469C17BCA54DF373DFE8EDE3D52A1C8F5E0A5919694FB111&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: F329DEA0DF39FF181ACFBCA69BEC417D7CAA4399D73229A1D912CC8236A858FD099B834F5B32C9BF979C4B5948196FC9&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    Krb5 Principal: None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - 6c f3 41 26 c8 6b 1e 9c-2e 78 af 75 b2 46 34 f4   l.A&amp;amp;.k...x.u.F4.&lt;br /&gt;
    0010 - 30 c3 bd e4 ee 2f f6 28-37 f6 7c 55 3b c7 08 ad   0..../.(7.|U;...&lt;br /&gt;
    0020 - 1e 48 f1 83 9f 9a d4 ef-9b 7d 5a 9c f7 5b 92 e9   .H.......}Z..[..&lt;br /&gt;
    0030 - 2f ca c3 e5 44 c7 7a c1-ed db 98 1a 18 bd 25 30   /...D.z.......%0&lt;br /&gt;
    0040 - 3c 50 ad 96 23 22 7e a1-b7 eb 1d b5 cc 69 2a 43   &amp;lt;P..#&amp;quot;~......i*C&lt;br /&gt;
    0050 - 63 13 4f 21 90 32 87 94-0b 6a 66 da 99 fa 45 79   c.O!.2...jf...Ey&lt;br /&gt;
    0060 - cc 53 29 35 59 0d 02 93-c6 c6 af f3 52 79 b5 36   .S)5Y.......Ry.6&lt;br /&gt;
    0070 - c0 a6 4d 22 9f af 4a f2-86 b4 50 68 83 b1 ab a6   ..M&amp;quot;..J...Ph....&lt;br /&gt;
    0080 - a6 ac 6e 4e 18 3d 80 a7-b4 85 77 06 69 60 fa b2   ..nN.=....w.i`..&lt;br /&gt;
    0090 - 22 9a 79 14 c6 3e 3e 68-33 4e 1e a9 40 09 47 d0   &amp;quot;.y..&amp;gt;&amp;gt;h3N..@.G.&lt;br /&gt;
    00a0 - 02 97 8b ba 39 db 2f b1-1c 2e 66 49 d3 bc 99 cc   ....9./...fI....&lt;br /&gt;
    00b0 - 56 4f 1d f4 c6 7b 58 3e-28 df b1 ce 2b 45 36 ca   VO...{X&amp;gt;(...+E6.&lt;br /&gt;
&lt;br /&gt;
    Compression: 1 (zlib compression)&lt;br /&gt;
    Start Time: 1308161188&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 0 (ok)&lt;br /&gt;
---&lt;br /&gt;
GET&lt;br /&gt;
write to 0x196a050 [0x1a14e56] (74 bytes =&amp;gt; 74 (0x4A))&lt;br /&gt;
0000 - 17 03 01 00 20 8a 4c 57-8c b9 d5 d4 c6 1b 56 ce   .... .LW......V.&lt;br /&gt;
0010 - 93 b5 78 6b 5f 0e c5 a2-39 2a f9 7a 20 7d 68 85   ..xk_...9*.z }h.&lt;br /&gt;
0020 - af 52 e3 5f fc 17 03 01-00 20 c6 c4 19 74 61 64   .R._..... ...tad&lt;br /&gt;
0030 - 42 59 e0 52 3f 42 44 53-8b c9 40 69 1c 3d 9b 7f   BY.R?BDS..@i.=..&lt;br /&gt;
0040 - aa e8 8f a4 5c de c9 d4-0a a4                     ....\.....&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 17 03 01 00 60                                    ....`&lt;br /&gt;
read from 0x196a050 [0x1a10908] (96 bytes =&amp;gt; 96 (0x60))&lt;br /&gt;
0000 - 46 4c 99 93 29 c9 ed 66-81 43 89 39 26 2b d1 b0   FL..)..f.C.9&amp;amp;+..&lt;br /&gt;
0010 - 19 73 eb 51 18 45 54 49-74 43 e0 92 1b f8 af f0   .s.Q.ETItC......&lt;br /&gt;
0020 - 0d e1 08 79 96 38 e1 5e-29 9d 66 9c 30 04 8e c4   ...y.8.^).f.0...&lt;br /&gt;
0030 - 10 83 49 7e 09 d7 8a ff-4b 11 f9 13 3e ac 77 73   ..I~....K...&amp;gt;.ws&lt;br /&gt;
0040 - e8 94 e3 f3 74 db 4e 5f-67 13 1d c4 3a 06 98 b3   ....t.N_g...:...&lt;br /&gt;
0050 - da 20 41 3c ca 9a fb 3f-f3 d7 64 a1 e9 f4 0a 98   . A&amp;lt;...?..d.....&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;AN!Wiki - SSL Test Server&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
	&amp;lt;h1&amp;gt;SSL Test&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10903] (5 bytes =&amp;gt; 5 (0x5))&lt;br /&gt;
0000 - 15 03 01                                          ...&lt;br /&gt;
0005 - &amp;lt;SPACES/NULS&amp;gt;&lt;br /&gt;
read from 0x196a050 [0x1a10908] (32 bytes =&amp;gt; 32 (0x20))&lt;br /&gt;
0000 - 2e bb a7 d6 dc ce 6c 34-dc 2e 43 c7 89 02 a9 5c   ......l4..C....\&lt;br /&gt;
0010 - 3b 3e d0 43 1c ec fa c7-89 48 fd 76 58 82 ef 45   ;&amp;gt;.C.....H.vX..E&lt;br /&gt;
SSL3 alert read:warning:close notify&lt;br /&gt;
closed&lt;br /&gt;
write to 0x196a050 [0x1a14e53] (37 bytes =&amp;gt; 37 (0x25))&lt;br /&gt;
0000 - 15 03 01 00 20 d8 6f 46-24 e9 fa 0c c9 9f aa 2d   .... .oF$......-&lt;br /&gt;
0010 - db 69 2a d8 fb 61 66 b0-23 23 f9 a4 ac 49 b7 e6   .i*..af.##...I..&lt;br /&gt;
0020 - 31 73 56 05 ed                                    1sV..&lt;br /&gt;
SSL3 alert write:warning:close notify&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
=== Open Port 443 On The Firewall ===&lt;br /&gt;
&lt;br /&gt;
At this point, if you try to connect to the SSL virtual host remotely, you will fail because port 443 is not yet open.&lt;br /&gt;
&lt;br /&gt;
Use your favourite program to open inbound TCP port 443. I like to directly edit the firewall&#039;s config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/iptables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Firewall configuration written by system-config-firewall&lt;br /&gt;
# Manual customization of this file is not recommended.&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [0:0]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [0:0]&lt;br /&gt;
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;
-A INPUT -p icmp -j ACCEPT&lt;br /&gt;
-A INPUT -i lo -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
-A INPUT -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
-A FORWARD -j REJECT --reject-with icmp-host-prohibited&lt;br /&gt;
COMMIT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/iptables restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
iptables: Flushing firewall rules:                         [  OK  ]&lt;br /&gt;
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]&lt;br /&gt;
iptables: Unloading modules:                               [  OK  ]&lt;br /&gt;
iptables: Applying firewall rules:                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browse to the New Virtual Host ===&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the new SSL virtual host! Simply browse to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;https://alteeve.com&amp;lt;/span&amp;gt; (replace with your domain).&lt;br /&gt;
&lt;br /&gt;
[[Image:SSL_Test_Page_01.png|thumb|center|741px|Test SSL virtual host in Firefox 4.]]&lt;br /&gt;
&lt;br /&gt;
Note the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;&#039; to the left of the address bar showing that the site is encrypted and verified!&lt;br /&gt;
&lt;br /&gt;
= PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
We need to initialize the postgres core databases before we can start it for the first time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
service postgresql initdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing database:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From now on, we can start PostgreSQL normally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping postgresql service:                               [  OK  ]&lt;br /&gt;
Starting postgresql service:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the admin user called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; which will own the databases we will create and use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su - postgres&lt;br /&gt;
createuser -S -d -R alteeve&lt;br /&gt;
psql template1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the shell, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER USER alteeve WITH PASSWORD &#039;secret&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ALTER ROLE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
\q&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell PostgreSQL to require a password for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/pgsql/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /var/lib/pgsql/data/pg_hba.conf.orig	2011-06-15 17:57:25.666509143 -0400&lt;br /&gt;
+++ /var/lib/pgsql/data/pg_hba.conf	2011-06-15 17:58:54.077510393 -0400&lt;br /&gt;
@@ -65,6 +65,7 @@&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD&lt;br /&gt;
+local   all         alteeve                           md5&lt;br /&gt;
 &lt;br /&gt;
 # &amp;quot;local&amp;quot; is for Unix domain socket connections only&lt;br /&gt;
 local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload PostgreSQL&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postgresql reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a Database that is owned by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt; user, then connect to it to make sure we&#039;re asked for a password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
su postgres -c &amp;quot;createdb an_wiki -O alteeve&amp;quot;&lt;br /&gt;
psql an_wiki -U alteeve&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
psql (8.4.7)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&lt;br /&gt;
an_wiki=&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now load a database from a backup file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql an_wiki -U alteeve -f /var/www/ssl_alteeve.com/temp/an_wiki_3.out &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password for user alteeve: &lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE SCHEMA&lt;br /&gt;
ALTER SCHEMA&lt;br /&gt;
CREATE LANGUAGE&lt;br /&gt;
psql:/var/www/ssl_alteeve.com/temp/an_wiki_3.out:27: ERROR:  must be member of role &amp;quot;postgres&amp;quot;&lt;br /&gt;
SET&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
CREATE FUNCTION&lt;br /&gt;
ALTER FUNCTION&lt;br /&gt;
SET&lt;br /&gt;
SET&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      8&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   2500&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   4416&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3465&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
     34&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
    957&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3274&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3547&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
   3513&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE SEQUENCE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
 setval &lt;br /&gt;
--------&lt;br /&gt;
      1&lt;br /&gt;
(1 row)&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE INDEX&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
CREATE TRIGGER&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
ALTER TABLE&lt;br /&gt;
REVOKE&lt;br /&gt;
REVOKE&lt;br /&gt;
GRANT&lt;br /&gt;
GRANT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
== Media Wiki Problem ==&lt;br /&gt;
&lt;br /&gt;
If you moved a MediaWiki DB and it generated an error like this in the log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;objectcache&amp;quot; does not exist\nLINE 1: ...ECT /* SqlBagOStuff::get  */  value,exptime  FROM objectcach...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
[Wed Jun 15 21:37:20 2011] [error] [client 206.108.5.162] PHP Warning:  pg_query(): Query failed: ERROR:  relation &amp;quot;l10n_cache&amp;quot; does not exist\nLINE 1: ... LCStore_DB::get 206.108.5.162 */  lc_value  FROM l10n_cache...\n&lt;br /&gt;
                                                             ^ in /var/www/ssl_alteeve.com/html/includes/db/DatabasePostgres.php on line 584&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fix is to run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
ALTER DATABASE an_wiki SET search_path=mediawiki;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_wiki&amp;lt;/span&amp;gt; with the name of your wiki database.&lt;br /&gt;
&lt;br /&gt;
= MySQL =&lt;br /&gt;
&lt;br /&gt;
Start MySQL for the first time:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysqld start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Initializing MySQL database:  Installing MySQL system tables...&lt;br /&gt;
OK&lt;br /&gt;
Filling help tables...&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
To start mysqld at boot time you have to copy&lt;br /&gt;
support-files/mysql.server to the right place for your system&lt;br /&gt;
&lt;br /&gt;
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;br /&gt;
To do so, start the server, then issue the following commands:&lt;br /&gt;
&lt;br /&gt;
/usr/bin/mysqladmin -u root password &#039;new-password&#039;&lt;br /&gt;
/usr/bin/mysqladmin -u root -h asakusa.alteeve.com password &#039;new-password&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can run:&lt;br /&gt;
/usr/bin/mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
which will also give you the option of removing the test&lt;br /&gt;
databases and anonymous user created by default.  This is&lt;br /&gt;
strongly recommended for production servers.&lt;br /&gt;
&lt;br /&gt;
See the manual for more instructions.&lt;br /&gt;
&lt;br /&gt;
You can start the MySQL daemon with:&lt;br /&gt;
cd /usr ; /usr/bin/mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can test the MySQL daemon with mysql-test-run.pl&lt;br /&gt;
cd /usr/mysql-test ; perl mysql-test-run.pl&lt;br /&gt;
&lt;br /&gt;
Please report any problems with the /usr/bin/mysqlbug script!&lt;br /&gt;
&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Starting mysqld:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secure the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL&lt;br /&gt;
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to log into MySQL to secure it, we&#039;ll need the current&lt;br /&gt;
password for the root user.  If you&#039;ve just installed MySQL, and&lt;br /&gt;
you haven&#039;t set the root password yet, the password will be blank,&lt;br /&gt;
so you should just press enter here.&lt;br /&gt;
&lt;br /&gt;
Enter current password for root (enter for none): &lt;br /&gt;
OK, successfully used password, moving on...&lt;br /&gt;
&lt;br /&gt;
Setting the root password ensures that nobody can log into the MySQL&lt;br /&gt;
root user without the proper authorisation.&lt;br /&gt;
&lt;br /&gt;
Set root password? [Y/n] y&lt;br /&gt;
New password: &lt;br /&gt;
Re-enter new password: &lt;br /&gt;
Password updated successfully!&lt;br /&gt;
Reloading privilege tables..&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, a MySQL installation has an anonymous user, allowing anyone&lt;br /&gt;
to log into MySQL without having to have a user account created for&lt;br /&gt;
them.  This is intended only for testing, and to make the installation&lt;br /&gt;
go a bit smoother.  You should remove them before moving into a&lt;br /&gt;
production environment.&lt;br /&gt;
&lt;br /&gt;
Remove anonymous users? [Y/n] y&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Normally, root should only be allowed to connect from &#039;localhost&#039;.  This&lt;br /&gt;
ensures that someone cannot guess at the root password from the network.&lt;br /&gt;
&lt;br /&gt;
Disallow root login remotely? [Y/n]  &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
By default, MySQL comes with a database named &#039;test&#039; that anyone can&lt;br /&gt;
access.  This is also intended only for testing, and should be removed&lt;br /&gt;
before moving into a production environment.&lt;br /&gt;
&lt;br /&gt;
Remove test database and access to it? [Y/n] &lt;br /&gt;
 - Dropping test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
 - Removing privileges on test database...&lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Reloading the privilege tables will ensure that all changes made so far&lt;br /&gt;
will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
Reload privilege tables now? [Y/n] &lt;br /&gt;
 ... Success!&lt;br /&gt;
&lt;br /&gt;
Cleaning up...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All done!  If you&#039;ve completed all of the above steps, your MySQL&lt;br /&gt;
installation should now be secure.&lt;br /&gt;
&lt;br /&gt;
Thanks for using MySQL!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= BIND =&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is not meant to cover creating the actual zone files for DNS. It&#039;s goal is to setup BIND on your [[EL6]] server only.}}&lt;br /&gt;
&lt;br /&gt;
This is the BIND named server that handles DNS resolution. It will be setup in two parts; The global options and then the zones file.&lt;br /&gt;
&lt;br /&gt;
== Install bind ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bind bind-libs bind-utils&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit the main configuration file, making a backup first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.conf /etc/named.conf.orig&lt;br /&gt;
vim /etc/named.conf &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable queries on any interface and answer queries for any domain, not just ours. Edit or add the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        listen-on port 53       { any; };&lt;br /&gt;
        allow-query             { localhost; };&lt;br /&gt;
        allow-query-cache       { any; };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For now, we&#039;re going to disable DNSSEC. Make the following changes;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        dnssec-enable           no;&lt;br /&gt;
        dnssec-validation       no;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell bind where to look for a domain name&#039;s IP when we don&#039;t know. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        forwarders {&lt;br /&gt;
                // These are Google&#039;s open DNS servers&lt;br /&gt;
                8.8.8.8;&lt;br /&gt;
                8.8.4.4;&lt;br /&gt;
        };&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This server will have a slave, and we want to notify that slave when a record changes. Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
        notify                  yes;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done. I like to clean up the file to put the variables in line with one another. With this in mind, let&#039;s look at the changes as a unified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/named.conf.orig /etc/named.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/named.conf.orig	2012-02-05 00:54:48.434068501 -0500&lt;br /&gt;
+++ /etc/named.conf	2012-02-05 13:45:16.484083319 -0500&lt;br /&gt;
@@ -8,18 +8,26 @@&lt;br /&gt;
 //&lt;br /&gt;
 &lt;br /&gt;
 options {&lt;br /&gt;
-	listen-on port 53 { 127.0.0.1; };&lt;br /&gt;
-	listen-on-v6 port 53 { ::1; };&lt;br /&gt;
-	directory 	&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
-	dump-file 	&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
-        statistics-file &amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
-        memstatistics-file &amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
-	allow-query     { localhost; };&lt;br /&gt;
-	recursion yes;&lt;br /&gt;
-&lt;br /&gt;
-	dnssec-enable yes;&lt;br /&gt;
-	dnssec-validation yes;&lt;br /&gt;
-	dnssec-lookaside auto;&lt;br /&gt;
+	listen-on port		53 { any; };&lt;br /&gt;
+	listen-on-v6 port	53 { ::1; };&lt;br /&gt;
+	directory		&amp;quot;/var/named&amp;quot;;&lt;br /&gt;
+	dump-file 		&amp;quot;/var/named/data/cache_dump.db&amp;quot;;&lt;br /&gt;
+        statistics-file		&amp;quot;/var/named/data/named_stats.txt&amp;quot;;&lt;br /&gt;
+        memstatistics-file	&amp;quot;/var/named/data/named_mem_stats.txt&amp;quot;;&lt;br /&gt;
+	allow-query		{ any; };&lt;br /&gt;
+	allow-query-cache 	{ any; };&lt;br /&gt;
+	recursion 		yes;&lt;br /&gt;
+	notify			yes;&lt;br /&gt;
+&lt;br /&gt;
+	dnssec-enable		no;&lt;br /&gt;
+	dnssec-validation	no;&lt;br /&gt;
+	dnssec-lookaside	auto;&lt;br /&gt;
+&lt;br /&gt;
+	forwarders {&lt;br /&gt;
+		// These are Google&#039;s open DNS servers&lt;br /&gt;
+		8.8.8.8;&lt;br /&gt;
+		8.8.4.4;&lt;br /&gt;
+	};&lt;br /&gt;
 &lt;br /&gt;
 	/* Path to ISC DLV key */&lt;br /&gt;
 	bindkeys-file &amp;quot;/etc/named.iscdlv.key&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Zones ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell BIND which zones we have SOA for. This includes the pointers to the actual files on disk with each domain&#039;s information.&lt;br /&gt;
&lt;br /&gt;
Backup then edit the zones file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.orig&lt;br /&gt;
vim /etc/named.rfc1912.zones&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In here is where we add the entries for the domains we have [[SOA]] for at the end of the file. These will differ for every install, so only two examples will be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;dot&amp;quot;&amp;gt;&lt;br /&gt;
// Our zones which this server is SOA for.&lt;br /&gt;
zone &amp;quot;45years.ca&amp;quot; IN {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.45years.ca&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
zone &amp;quot;alteeve.com&amp;quot; in {&lt;br /&gt;
        type master;&lt;br /&gt;
        file &amp;quot;/etc/named/db.alteeve.com&amp;quot;;&lt;br /&gt;
        allow-transfer {&lt;br /&gt;
                192.139.81.117;&lt;br /&gt;
        };&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial does not aim to cover actual zone files, but here is one for reference:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /etc/named/db.45years.ca &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
$ORIGIN .&lt;br /&gt;
$TTL 600	; Time To Live.&lt;br /&gt;
45years.ca		IN SOA ns1.alteeve.com. admin.alteeve.com. (&lt;br /&gt;
				2011081402	;	Serial Number (yyyymmdd##)&lt;br /&gt;
				300		;	refresh (in seconds)&lt;br /&gt;
				180		;	retry (in seconds)&lt;br /&gt;
				600		;	expire (in seconds)&lt;br /&gt;
				86400		;	minimum (in seconds)&lt;br /&gt;
				)&lt;br /&gt;
			NS	ns1.alteeve.com.&lt;br /&gt;
			NS	ns2.alteeve.com.&lt;br /&gt;
			A	192.139.81.121&lt;br /&gt;
			MX	10	mail.45years.ca.&lt;br /&gt;
$ORIGIN 45years.ca.&lt;br /&gt;
localhost		A	127.0.0.1&lt;br /&gt;
mail			A	192.139.81.121&lt;br /&gt;
www			CNAME	45years.ca.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding a Firewall Entry ==&lt;br /&gt;
&lt;br /&gt;
Assuming you have a firewall running, be sure to add an entry for [[TCP]] port 53.&lt;br /&gt;
&lt;br /&gt;
== (Re)Start BIND ==&lt;br /&gt;
&lt;br /&gt;
Once all the configuration files and domain zone files are in place, (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;named&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/named restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping named: .                                          [  OK  ]&lt;br /&gt;
Starting named:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Name resolution ==&lt;br /&gt;
&lt;br /&gt;
To properly test name resolution, you will want to resolve a domain we are [[SOA]] for and another domain which we are not. We will repeat this twice, once on the server and once from a remote machine to ensure that it is answering remote queries. Note that in the examples below, my DNS server&#039;s IP address is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;78.46.37.135&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 1418&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 0 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 13:57:11 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @localhost&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @localhost&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 56760&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		300	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2967	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	e.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2967	IN	NS	m.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 12 msec&lt;br /&gt;
;; SERVER: ::1#53(::1)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:02:03 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now from a remote machine, repeat the same queries to ensure that our DNS server will respond to external queries.&lt;br /&gt;
&lt;br /&gt;
On the server;&lt;br /&gt;
&lt;br /&gt;
Query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;, which we&#039;re SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig alteeve.com @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; alteeve.com @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 46628&lt;br /&gt;
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;alteeve.com.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
alteeve.com.		600	IN	A	192.139.81.121&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
alteeve.com.		600	IN	NS	ns2.alteeve.com.&lt;br /&gt;
alteeve.com.		600	IN	NS	ns1.alteeve.com.&lt;br /&gt;
&lt;br /&gt;
;; ADDITIONAL SECTION:&lt;br /&gt;
ns1.alteeve.com.	600	IN	A	192.139.81.117&lt;br /&gt;
ns2.alteeve.com.	600	IN	A	192.139.81.119&lt;br /&gt;
&lt;br /&gt;
;; Query time: 138 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:09 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 113&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now query &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; which we obviously are not SOA for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dig google.ca @78.46.37.135&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.8.2rc1-RedHat-9.8.2-0.2.rc1.fc16 &amp;lt;&amp;lt;&amp;gt;&amp;gt; google.ca @78.46.37.135&lt;br /&gt;
;; global options: +cmd&lt;br /&gt;
;; Got answer:&lt;br /&gt;
;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18204&lt;br /&gt;
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0&lt;br /&gt;
&lt;br /&gt;
;; QUESTION SECTION:&lt;br /&gt;
;google.ca.			IN	A&lt;br /&gt;
&lt;br /&gt;
;; ANSWER SECTION:&lt;br /&gt;
google.ca.		138	IN	A	74.125.232.56&lt;br /&gt;
&lt;br /&gt;
;; AUTHORITY SECTION:&lt;br /&gt;
.			2805	IN	NS	h.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	c.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	j.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	i.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	b.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	m.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	g.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	d.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	a.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	l.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	f.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	k.root-servers.net.&lt;br /&gt;
.			2805	IN	NS	e.root-servers.net.&lt;br /&gt;
&lt;br /&gt;
;; Query time: 140 msec&lt;br /&gt;
;; SERVER: 78.46.37.135#53(78.46.37.135)&lt;br /&gt;
;; WHEN: Sun Feb  5 14:04:31 2012&lt;br /&gt;
;; MSG SIZE  rcvd: 254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= Email =&lt;br /&gt;
&lt;br /&gt;
This is a pretty heavily customized postfix install using a custom schema. It was originally based on [http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch this Debian Etch] tutorial, but adapted for PostgreSQL. Much time has passed and the operating system is now significantly changed, but it&#039;s lineage is thus. A more recent, but still Debian-focused version of the tutorial [http://workaround.org/ispmail/squeeze/big-picture is here]. I also used [http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot this tutorial] to help sort out the PostgreSQL stuff.&lt;br /&gt;
&lt;br /&gt;
This will use a few applications;&lt;br /&gt;
* Postfix - The program that receives email.&lt;br /&gt;
* PostgreSQL - The database used to validate the existence of email accounts and validates incoming user credentials.&lt;br /&gt;
* Dovecot - Takes email coming from postfix, via amavis, and records them to disk. It also answers requests from users wanting to check their email.&lt;br /&gt;
* Amavis - Filters incoming email for spam (via spamassassin) and virsus (via clamav)&lt;br /&gt;
&lt;br /&gt;
We will also be using graylisting, which is a spam fighting tactic where the first email from a given user to one of our users is bounced for a few minutes. Proper mail servers will acknowledge the bound, wait the time and resend. Spam mailers though are usually fire-and-forget and will not resend, thus effectively blocking the spam message. This is a very effective method of blocking spam with minimal chance of losing real mail from real users. Any subsequent message from the user would be allowed through with no delay, provided the user had in fact resent the first message as requested.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
To install the applications;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install postfix postfix-perl-scripts dovecot dovecot-pgsql spamassassin postgresql-server postgresql-plperl mutt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Postfix ==&lt;br /&gt;
&lt;br /&gt;
Installation requires several steps. The AN!Console database must be loaded. Various applications need to be installed. Postfix, Dovecot and helper applications need to be configured and so on.&lt;br /&gt;
&lt;br /&gt;
This tutorial uses the following values that you may need to adjust;&lt;br /&gt;
* Database name; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_tools&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database user; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database password; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secret&amp;lt;/span&amp;gt;&lt;br /&gt;
* Database host; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not use the database host &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt;&amp;quot; unless you are certain you can connect to the DB using a standard [[unix]] socket.}}&lt;br /&gt;
&lt;br /&gt;
=== Building Support for PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=We need to build our own RPM in order to support postgresql. This means we will have to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates, placing the onus on us to make sure critical updates are applied. This will require downloading the latest source RPMs, re-enabling postgres and recompile/reinstall.}}&lt;br /&gt;
&lt;br /&gt;
Add the source [[RPM]] repository by adding the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/CentOS-Base.repo &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Source RPM repository&lt;br /&gt;
[base-source]&lt;br /&gt;
name=CentOS-$releasever - Base - Source&lt;br /&gt;
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
#baseurl=http://vault.centos.org/$releasever/os/SRPMS/&lt;br /&gt;
baseurl=http://vault.centos.org/6.0/os/SRPMS/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now download the source RPM for postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yumdownloader --source postfix&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
base                               | 3.7 kB     00:00&lt;br /&gt;
base-source                        | 1.9 kB     00:00&lt;br /&gt;
extras                             | 3.5 kB     00:00&lt;br /&gt;
updates                            | 3.5 kB     00:00&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
./postfix-2.6.6-2.el6.src.rpm already exists and appears to be complete&lt;br /&gt;
nikko:/etc/postfix# rm postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
rm: remove regular file `postfix-2.6.6-2.el6.src.rpm&#039;? y&lt;br /&gt;
nikko:/etc/postfix# yumdownloader --source postfix&lt;br /&gt;
Loaded plugins: fastestmirror&lt;br /&gt;
Loading mirror speeds from cached hostfile&lt;br /&gt;
 * base: centos.vieth-server.de&lt;br /&gt;
 * extras: centos.vieth-server.de&lt;br /&gt;
 * updates: centos.vieth-server.de&lt;br /&gt;
No source RPM found for 2:postfix-2.6.6-2.2.el6_1.x86_64&lt;br /&gt;
postfix-2.6.6-2.el6.src.rpm        | 3.3 MB     00:00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the postfix source RPM, we will install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh postfix-2.6.6-2.el6.src.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   1:postfix                warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
########################################### [100%]&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
warning: user mockbuild does not exist - using root&lt;br /&gt;
warning: group mockbuild does not exist - using root&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.spec&amp;lt;/span&amp;gt; file to enable postgres support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ~/rpmbuild/SPECS/postfix.spec ~/rpmbuild/SPECS/postfix.spec.orig&lt;br /&gt;
vim ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the following changes.&lt;br /&gt;
&lt;br /&gt;
* Enable PostgreSQL support&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Increment the release version by one.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Release: 3%{?dist}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see the changes here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u ~/rpmbuild/SPECS/postfix.spec.orig ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /root/rpmbuild/SPECS/postfix.spec.orig      2012-02-11 16:54:54.495330859 -0500&lt;br /&gt;
+++ /root/rpmbuild/SPECS/postfix.spec   2012-02-11 16:53:39.873331101 -0500&lt;br /&gt;
@@ -1,5 +1,5 @@&lt;br /&gt;
 %{?!MYSQL: %define MYSQL 1}&lt;br /&gt;
-%{?!PGSQL: %define PGSQL 0}&lt;br /&gt;
+%{?!PGSQL: %define PGSQL 1}&lt;br /&gt;
 %define LDAP 2&lt;br /&gt;
 %define PCRE 1&lt;br /&gt;
 %define SASL 2&lt;br /&gt;
@@ -35,7 +35,7 @@&lt;br /&gt;
 Name: postfix&lt;br /&gt;
 Summary: Postfix Mail Transport Agent&lt;br /&gt;
 Version: 2.6.6&lt;br /&gt;
-Release: 2%{?dist}&lt;br /&gt;
+Release: 3%{?dist}&lt;br /&gt;
 Epoch: 2&lt;br /&gt;
 Group: System Environment/Daemons&lt;br /&gt;
 URL: http://www.postfix.org&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rebuild the RPM, which means we need to install the build tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum groupinstall development&lt;br /&gt;
yum install db4-devel openldap-devel cyrus-sasl-devel pcre-devel mysql-devel postgresql-devel openssl-devel&lt;br /&gt;
rpmbuild -bb ~/rpmbuild/SPECS/postfix.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(compile output)&lt;br /&gt;
Processing files: postfix-debuginfo-2.6.6-3.el6.x86_64&lt;br /&gt;
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Wrote: /root/rpmbuild/RPMS/x86_64/postfix-debuginfo-2.6.6-3.el6.x86_64.rpm&lt;br /&gt;
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rymr5C&lt;br /&gt;
+ umask 022&lt;br /&gt;
+ cd /root/rpmbuild/BUILD&lt;br /&gt;
+ cd postfix-2.6.6&lt;br /&gt;
+ rm -rf /root/rpmbuild/BUILDROOT/postfix-2.6.6-3.el6.x86_64&lt;br /&gt;
+ exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the updated postfix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -Uvh ~/rpmbuild/RPMS/x86_64/postfix-2.6.6-3.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/postfix-perl-scripts-2.6.6-3.el6.x86_64.rpm &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:postfix                ########################################### [ 50%]&lt;br /&gt;
   2:postfix-perl-scripts   ########################################### [100%]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now exclude &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;/span&amp;gt; from future updates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/yum.conf /etc/yum.conf.orig&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
diff -u /etc/yum.conf.orig /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/yum.conf.orig  2012-02-11 16:59:53.720079168 -0500&lt;br /&gt;
+++ /etc/yum.conf       2012-02-11 17:00:47.013331283 -0500&lt;br /&gt;
@@ -10,6 +10,7 @@&lt;br /&gt;
 installonly_limit=5&lt;br /&gt;
 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&amp;amp;ref=http://bugs.centos.org/bug_report_page.php?category=yum&lt;br /&gt;
 distroverpkg=centos-release&lt;br /&gt;
+exclude=postfix*&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Virtual Domain Lookup ===&lt;br /&gt;
&lt;br /&gt;
This tells postfix how to find which domains we have.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM domains WHERE dom_name=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Postfix to use this new file by appending the following to the main postfix configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix to validate domains using our postgresql databae via the&lt;br /&gt;
# pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
virtual_mailbox_domains=pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reload postfix;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can test that domains resolve. In my case, I will test the look-up for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure it returns nothing when query a bad domain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q example.com pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Mailbox Mapping ===&lt;br /&gt;
&lt;br /&gt;
This section will tell postfix which users for a given domain are valid.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT 1 FROM email_file WHERE email=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell postfix to use this new file when looking up users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Tell postfix which table to look in when validating a local user via their&lt;br /&gt;
# email address.&lt;br /&gt;
virtual_mailbox_maps=pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;postfix&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now do a test of a valid user, which should return &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, and an invalid user, which should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q nobody@alteeve.com pgsql:/etc/postfix/pgsql-virtual-mailbox-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Email Forwards ===&lt;br /&gt;
&lt;br /&gt;
This will allow for email addresses to be forwarded to other email addresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
dbname = an_tools&lt;br /&gt;
query = SELECT fwd_destination FROM forwards WHERE fwd_source=&#039;%s&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell postfix where to look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/postfix/main.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This tells postfix where to forward incoming email to, where appropriate.&lt;br /&gt;
virtual_alias_maps=pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/postfix reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Reloading postfix:                                         [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve setup a forward where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;digimer@alteeve.com&amp;lt;/span&amp;gt; forwards to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt;, so we will use that for the next test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q digimer@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkelly@alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An email address with no forward should return nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
postmap -q mkelly@alteeve.com pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;nothing returned&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
== Configuring Dovecot ==&lt;br /&gt;
&lt;br /&gt;
Dovecot handles writing incoming mail to the disk and moving/deleting mail as the user wishes. We&#039;re going to create a user and group called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; which will be used to manage the email stored on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
useradd -m vmail&lt;br /&gt;
mkdir /email&lt;br /&gt;
chown -R vmail:vmail /email&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dovecot&amp;lt;/span&amp;gt; and the main configuration file is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.orig&lt;br /&gt;
vim /etc/dovecot/dovecot.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dovecot uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.d&amp;lt;/span&amp;gt; style configuration files.&lt;br /&gt;
&lt;br /&gt;
* Authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (needed for some old email clients, you may not need to enable this).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it not to use the database, and not local users for mail delivery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!include auth-system.conf.ext&lt;br /&gt;
!include auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Mail store&lt;br /&gt;
&lt;br /&gt;
Tell dovecot where to store the email. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%d&amp;lt;/span&amp;gt; tells dovecot to substitute the user&#039;s domain name and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;%n&amp;lt;/span&amp;gt; is substituted by the user&#039;s email name. For example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkelly@alteeve.com&amp;lt;/span&amp;gt; becomes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/email/alteeve.com/mkelly&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.conf.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* User authentication.&lt;br /&gt;
&lt;br /&gt;
We need to tell dovecot where to look for passwords when authenticating a user. Where to look is controlled in the &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auth-sql.conf.ext&amp;lt;/span&amp;gt; file and is broken down into user and password lookups. We will want to first tell Dovecot which user to use when accessing the mail store on disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
userdb {&lt;br /&gt;
  driver = static&lt;br /&gt;
  args = uid=vmail gid=vmail home=/email/%d/%n allow_all_users=yes&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Now configure the SQL server access details.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that PostgreSQL has sufficient &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_connections&amp;lt;/span&amp;gt; set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/pgsql/data/postgresql.conf&amp;lt;/span&amp;gt; to handle enough connections for the expected number of email connections, plus other connections from other applications.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/doc/dovecot-2.0.9/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chown root:root /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
chmod 600 /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
vim /etc/dovecot/dovecot-sql.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to use PostgreSQL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
driver = pgsql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the connection string.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your database uses a password with a space character in it, quote the password. Ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;password=&#039;super secret&#039;&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
connect = host=127.0.0.1 dbname=an_tools user=alteeve password=secret&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot to accept plain-text passwords (this is needed for some stupid MS clients, this will probably change soon).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell dovecot how to pull use the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last thing to setup is the user query. The query needs to return the [[UID]] and [[GID]] of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmail&amp;lt;/span&amp;gt; user we setup earlier. To get it, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
id vmail&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
uid=503(vmail) gid=503(vmail) groups=503(vmail)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers we want are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;503&amp;lt;/span&amp;gt; for the UID and GID, respectively. Knowing this, we can set the userdb SQL string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;503&#039; AS uid, &#039;503&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable [[PAM]] lookup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/dovecot/conf.d/auth-system.conf.ext /etc/dovecot/conf.d/auth-system.conf.ext.orig&lt;br /&gt;
vim /etc/dovecot/conf.d/auth-system.conf.ext&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comment-out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;driver = pam&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
  #driver = pam&lt;br /&gt;
  # [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&amp;lt;n&amp;gt;]&lt;br /&gt;
  # [cache_key=&amp;lt;key&amp;gt;] [&amp;lt;service name&amp;gt;]&lt;br /&gt;
  #args = dovecot&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now (re)start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dovecot&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ooooold Notes ==&lt;br /&gt;
&lt;br /&gt;
When prompted;&lt;br /&gt;
For &#039;Create directories for web-based administration ?&#039; Choose &#039;Yes&#039;.&lt;br /&gt;
For &#039;General type of configuration?&#039;, choose &#039;Local Only&#039;.&lt;br /&gt;
For &#039;Mail Name&#039;, enter &#039;alteeve.com&#039;.&lt;br /&gt;
For &#039;SSL certificate required&#039;, hit &#039;Ok&#039;.&lt;br /&gt;
Create the database that we will use:&lt;br /&gt;
# su alteeve&lt;br /&gt;
$ createdb an_console&lt;br /&gt;
$ psql an_console&lt;br /&gt;
Now that we are in the new database we will need to load the AN!Console schema file. &lt;br /&gt;
# su postgres -c psql an_console -f /var/www/ssl_alteeve.com/cgi-bin/t/anc.pgsql.schema&lt;br /&gt;
On the Master node, we will create the directory where email will be stored.&lt;br /&gt;
# mkdir /ha/email&lt;br /&gt;
On the both nodes, we will create a link to the &#039;/ha/email&#039; directory off of root.&lt;br /&gt;
# ln -s /ha/email /email&lt;br /&gt;
Under this directory create another directory that is the domain name for the domains we will host mail for. Ie (no longer needed to be done manually, AN!Console will create directories for email as needed):&lt;br /&gt;
# mkdir /email/45years.ca&lt;br /&gt;
# mkdir /email/alteeve.com&lt;br /&gt;
And so on.&lt;br /&gt;
Go to the &#039;/etc/postfix&#039; directory and create these four files:&lt;br /&gt;
# vim /etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = domains&lt;br /&gt;
select_field = &#039;virtual&#039;&lt;br /&gt;
where_field = dom_name&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_forwardings.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = forwards&lt;br /&gt;
select_field = fwd_destination&lt;br /&gt;
where_field = fwd_source&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
# vim /etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve &lt;br /&gt;
password = secret &lt;br /&gt;
dbname = an_console &lt;br /&gt;
table = email_file &lt;br /&gt;
select_field = file &lt;br /&gt;
where_field = email &lt;br /&gt;
hosts = 127.0.0.1 &lt;br /&gt;
Note: The table &#039;email_file&#039; is actually a view that takes the email passed by postfix and splits it to generate a joined SELECT.&lt;br /&gt;
# vim /etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
user = alteeve&lt;br /&gt;
password = secret&lt;br /&gt;
dbname = an_console&lt;br /&gt;
table = email_email&lt;br /&gt;
select_field = email&lt;br /&gt;
where_field = email&lt;br /&gt;
hosts = 127.0.0.1&lt;br /&gt;
Note: The table &#039;email_email&#039; is actually a view that takes the email passed by postfix and returns the same email based on the DB entry. This is needed as a work-around for Postfix&#039;s habit of matching global forwards like &#039;@domain -&amp;gt; user@domain&#039; for all email to that domain, even what a given email address matches a user.&lt;br /&gt;
Now change the owner and permissions of those four files to NOT allow global reading as they contain our password.&lt;br /&gt;
# chown root:postfix /etc/postfix/psql-virtual_*&lt;br /&gt;
# chmod 640 /etc/postfix/psql-virtual_*&lt;br /&gt;
Now we will create a user account that will, in turn, own all the mail on the system. This user will not have shell access.&lt;br /&gt;
# adduser vmail&lt;br /&gt;
Enter a password, preferably one treated with the same care as the root password. You can leave all other options blank.&lt;br /&gt;
Now change the ownership of the mail store.&lt;br /&gt;
# chown -R vmail:vmail /email&lt;br /&gt;
# chmod -R 775 /email&lt;br /&gt;
Now we edit the main &#039;/etc/postfix/main.cf&#039; configuration file.&lt;br /&gt;
Make a backup of the original file “just in case”.&lt;br /&gt;
# cp /etc/postfix/main.cf /etc/postfix/main.cf.original&lt;br /&gt;
Now edit it:&lt;br /&gt;
# vim /etc/postfix/main.cf&lt;br /&gt;
There are several options to edit:&lt;br /&gt;
Please see &#039;Step 6&#039; at: http://workaround.org/articles/ispmail-sarge/index.shtml.en for details on the options to set.&lt;br /&gt;
For &#039;inet_interface&#039; enter &#039;all&#039;.&lt;br /&gt;
For &#039;myhostname&#039; use the cluster FQDN. Ie;&lt;br /&gt;
myhostname = nikko.alteeve.com&lt;br /&gt;
For &#039;mydestination&#039; use only local names, NOT real domains we will host email for. Any mail sent to the domains specified here will go to local (shell) users. &lt;br /&gt;
mydestination = nikko.alteeve.com, localhost.alteeve.com, localhost&lt;br /&gt;
For &#039;mynetworks&#039; set all the IP subnets we trust. Ie;&lt;br /&gt;
mynetworks = 192.139.81.0/24 192.168.1.0/24 192.168.2.0/24 10.0.0.0/24 127.0.0.0/8&lt;br /&gt;
We can ignore &#039;virtual_alias_domains&#039; if it exists.&lt;br /&gt;
For &#039;virtual_alias_maps&#039; we will set:&lt;br /&gt;
virtual_alias_maps = pgsql:/etc/postfix/psql-virtual_forwardings.cf pgsql:/etc/postfix/psql-virtual_email2email.cf&lt;br /&gt;
For &#039;virtual_mailbox_domains&#039; we will set:&lt;br /&gt;
virtual_mailbox_domains = pgsql:/etc/postfix/psql-virtual_domains.cf&lt;br /&gt;
For &#039;virtual_mailbox_maps&#039; we will set:&lt;br /&gt;
virtual_mailbox_maps = pgsql:/etc/postfix/psql-virtual_mailboxes.cf&lt;br /&gt;
For &#039;virtual_mailbox_base&#039; (where the email will be stored on disk) we will set:&lt;br /&gt;
virtual_mailbox_base = /ha/email&lt;br /&gt;
For &#039;virtual_uid_maps&#039; and &#039;virtual_gid_maps&#039; we will enter the numerical UID and GID for the &#039;vmail&#039; shell user we created earlier. To find what it&#039;s UID and GID is run:&lt;br /&gt;
# cat /etc/passwd | grep vmail&lt;br /&gt;
vmail:x:1001:1001:,,,:/home/vmail:/bin/bash&lt;br /&gt;
The first number is the UID, the second is the GID;&lt;br /&gt;
virtual_uid_maps = static:1001&lt;br /&gt;
virtual_gid_maps = static:1001&lt;br /&gt;
Set &#039;smtpd_sasl_auth_enable&#039; to &#039;yes&#039;.&lt;br /&gt;
Set &#039;broken_sasl_auth_clients&#039; to &#039;yes&#039;.&lt;br /&gt;
To enable relaying of local mail, trusted domains and SASL authenticated users and reject the rest set;&lt;br /&gt;
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination&lt;br /&gt;
For &#039;smtpd_use_tls&#039; the value should already be &#039;yes&#039;, but set it to such if not.&lt;br /&gt;
Lastly we&#039;ll set our certificate paths;&lt;br /&gt;
smtpd_tls_cert_file = /etc/postfix/smtpd.cert&lt;br /&gt;
smtpd_tls_key_file = /etc/postfix/smtpd.key&lt;br /&gt;
At this point we should be good to go. Restart postfix;&lt;br /&gt;
# /etc/init.d/postfix restart&lt;br /&gt;
If there were no errors in the restart, test the config by running;&lt;br /&gt;
# postfix check&lt;br /&gt;
If you get errors, fix &#039;em. Otherwise, so far so good!&lt;br /&gt;
Now to setup postfix to allow authentication of SMTP connections to allow relaying of messages from people (we trust) outside on the &#039;mynetworks&#039; scope.&lt;br /&gt;
Create or edit the file &#039;/etc/postfix/sasl/smtpd.conf&#039;&lt;br /&gt;
# vim /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
In it enter the lines:&lt;br /&gt;
pwcheck_method: auxprop&lt;br /&gt;
auxprop_plugin: sql&lt;br /&gt;
mech_list: plain login cram-md5 digest-md5&lt;br /&gt;
sql_engine: pgsql&lt;br /&gt;
sql_hostnames: 127.0.0.1&lt;br /&gt;
sql_user: alteeve&lt;br /&gt;
sql_passwd: secret&lt;br /&gt;
sql_database: an_console&lt;br /&gt;
sql_select: SELECT passwd FROM email_passwd WHERE email=&#039;%u@%r&#039;&lt;br /&gt;
log_level: 7 &lt;br /&gt;
Now secure the file (it&#039;s got our DB password)&lt;br /&gt;
# chown root:postfix /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
# chmod 640 /etc/postfix/sasl/smtpd.conf&lt;br /&gt;
Now we want to setup TLS to encrypt SMTP traffic. Be sure you are still in &#039;/etc/postfix&#039; as this is where you want the certificate files.&lt;br /&gt;
To create a 10-year certificate for our SMTP domain &#039;smtp.alteeve.com&#039;:&lt;br /&gt;
# openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 3650 -x509&lt;br /&gt;
This will bring up a bunch of questions:&lt;br /&gt;
Country Name (2 letter code) [AU]: CA&lt;br /&gt;
State or Province Name (full name) [Some-State]:Ontario&lt;br /&gt;
Locality Name (eg, city) []:Toronto&lt;br /&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alteeve&#039;s Niche!&lt;br /&gt;
Organizational Unit Name (eg, section) []:Hosting&lt;br /&gt;
Common Name (eg, YOUR name) []:smtp.alteeve.com&lt;br /&gt;
Email Address []:admin@alteeve.com&lt;br /&gt;
This will create two files in your current directory; &#039;smtpd.key&#039; and &#039;smtpd.cert&#039;. You&#039;ll want to protect them.&lt;br /&gt;
# chown root:postfix smtpd.*&lt;br /&gt;
# chmod 640 smtpd.*&lt;br /&gt;
Now we need to setup POP3 and IMAP access so users can actually check their email.&lt;br /&gt;
Backup then edit &#039;/etc/dovecot/dovecot.conf&#039; to have:&lt;br /&gt;
protocols = pop3 imap&lt;br /&gt;
mail_location = mbox:/email/%d/%n&lt;br /&gt;
#  passdb pam {&lt;br /&gt;
#  }&lt;br /&gt;
passdb sql {&lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
} &lt;br /&gt;
#  userdb passwd {&lt;br /&gt;
#  }&lt;br /&gt;
userdb sql { &lt;br /&gt;
	args = /etc/dovecot/dovecot-sql.conf&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The default location for &#039;dovecot-sql.conf&#039; is under &#039;/usr/local/etc&#039;, be sure to&lt;br /&gt;
# change it!&lt;br /&gt;
auth default { &lt;br /&gt;
	mechanisms = plain&lt;br /&gt;
	passdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	userdb sql { &lt;br /&gt;
		args = /etc/dovecot/dovecot-sql.conf &lt;br /&gt;
	}&lt;br /&gt;
	user = root&lt;br /&gt;
}&lt;br /&gt;
Then create/edit &#039;/etc/dovecot/dovecot-sql.conf&#039;:&lt;br /&gt;
driver = pgsql&lt;br /&gt;
connect = host=localhost dbname=an_console user=alteeve password=secret&lt;br /&gt;
default_pass_scheme = PLAIN&lt;br /&gt;
password_query = SELECT email, password FROM email_password WHERE email=&#039;%u&#039; &lt;br /&gt;
user_query = SELECT &#039;/email/&#039;||file AS email_dir, &#039;1001&#039; AS uid, &#039;1001&#039; AS gid FROM email_file WHERE email=&#039;%u&#039;&lt;br /&gt;
Now restart Dovecot:&lt;br /&gt;
# /etc/init.d/dovecot restart&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* To [http://planet-geek.com Dave Shevett] (aka: eidolon) and [http://codex.grimoire.ca/ Owen Jacobson] for answering my n00b SSL questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Dak1n1</name></author>
	</entry>
</feed>