<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Circles of Archimedes &#187; Server Solutions</title>
	<atom:link href="http://wiki.springsurprise.com/category/server-solutions/feed/" rel="self" type="application/rss+xml" />
	<link>http://wiki.springsurprise.com</link>
	<description>Technical scribbles in the sand</description>
	<lastBuildDate>Mon, 24 Oct 2011 01:00:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Graphing Running Averages in RRDTool</title>
		<link>http://wiki.springsurprise.com/2011/10/23/graphing-running-averages-in-rrdtool/</link>
		<comments>http://wiki.springsurprise.com/2011/10/23/graphing-running-averages-in-rrdtool/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 01:00:15 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Graphing Solutions]]></category>
		<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[rrd]]></category>
		<category><![CDATA[rrd tool]]></category>
		<category><![CDATA[rrdtool]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=598</guid>
		<description><![CDATA[There are a number of times where the data collected may appear so erratic that it is difficult to identify any trends.  While use of a VDEF can provide a gross average of a data set, it doesn&#8217;t provide the &#8230; <a href="http://wiki.springsurprise.com/2011/10/23/graphing-running-averages-in-rrdtool/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are a number of times where the data collected may appear so erratic that it is difficult to identify any trends.  While use of a VDEF can provide a gross average of a data set, it doesn&#8217;t provide the utility of a true running average.  The running average can provide a consistent calculation regardless as to the time scale displayed in the graph.  Fortunately, <a href="http://oss.oetiker.ch/rrdtool/index.en.html">RRDTool</a> provides a flexible means via its TREND operator for calculating a running average to address this need.</p>
<p>To begin, setup a chart that graphs the desired data in a typical manner before adding in the running average.  The following graph command creates a somewhat typical visualization of the last day&#8217;s network traffic as illustrated by the following graph:</p>
<pre>rrdtool graph example.png \
  --title "Network Traffic" \
  --width=500 \
  --slope-mode \
  --end=now \
  --start=end-24h \
  --base=1000 \
  DEF:bytesIn=network.rrd:bytesIn:AVERAGE \
  DEF:bytesOut=network.rrd:bytesOut:AVERAGE \
  CDEF:bpsIn=bytesIn,8,* \
  CDEF:bpsOut=bytesOut,8,* \
  CDEF:bpsOutNeg=bpsOut,-1,* \
  VDEF:bpsInTot=bpsIn,TOTAL \
  VDEF:bpsOutTot=bpsOut,TOTAL \
  COMMENT:"              current     min        max      total\n" \
  AREA:bpsIn#FF880044:"Bits/s In " \
  GPRINT:bpsIn:LAST:"%6.1lf%s\t" \
  GPRINT:bpsIn:MIN:"%6.1lf%s\t" \
  GPRINT:bpsIn:MAX:"%6.1lf%s\t" \
  GPRINT:bpsInTot:"%6.1lf%s\n" \
  LINE1:bpsIn#FF8800CC \
  AREA:bpsOutNeg#44C80044:"Bits/s Out" \
  GPRINT:bpsOut:LAST:"%6.1lf%s\t" \
  GPRINT:bpsOut:MIN:"%6.1lf%s\t" \
  GPRINT:bpsOut:MAX:"%6.1lf%s\t" \
  GPRINT:bpsOutTot:"%6.1lf%s\n" \
  LINE1:bpsOutNeg#44C800CC \
  HRULE:0#000000</pre>
<p><a href="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-11.png"><img class="aligncenter size-full wp-image-599" title="Example 1" src="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-11.png" alt="" width="581" height="201" /></a>With the basic graph setup, adding the elements necessary for the running average can now begin.  In this example, it appears there is a roughly hourly cycle (Time Machine backups) that defines the period so a reasonable start is to work with a minimum average calculated over 60 minutes.</p>
<p>First, additional CDEF statements need to be declared applying the TREND operator to the desired data.  The format for this operation is straightforward:</p>
<p style="text-align: center;"><code>CDEF:label=data_source,time_span,TREND</code></p>
<p>In this case, two new data sources are defined and are given the labels <code>bspInTrend</code> and <code>bpsOutTrendNeg</code>.  The data sources for these are the previously declared <code>bpsIn</code> and <code>bpsOutNeg</code> and the time span for them is 1 hour (3600 seconds).</p>
<pre>  CDEF:bpsInTrend=bpsIn,3600,TREND \
  CDEF:bpsOutTrendNeg=bpsOutNeg,3600,TREND \</pre>
<p>With the running averages now defined, it is possible to graph the data.  For the purposes of this example, the running average is graphed as a &#8220;shadow&#8221; on top of the base data.</p>
<pre>  LINE2:bpsInTrend#000000CC \
  LINE2:bpsOutTrendNeg#000000CC \</pre>
<p>The graph shown below illustrates the new running averages.</p>
<p><a href="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-21.png"><img class="aligncenter size-full wp-image-602" title="Example 2" src="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-21.png" alt="" width="581" height="201" /></a>The running averages are now shown and it illustrates that despite the hourly peaks, the overall trend is fairly flat with the slight exception around 00:15.  However, the running averages also show a gap at the beginning of the graph. This gap is because it takes an hour of data before the hourly running average can be computed.  While this may be acceptable, it doesn&#8217;t look polished.</p>
<p>A minor tweak of the original DEF statements can provide &#8220;padding&#8221; necessary to eliminate the displayed gap in the running average lines.  This can be accomplished by extending the start time of the data sources by at least the same duration specified in the running averages.  Note that the <em>display area</em> is not affected by altering the start time of the DEF statements &#8212; that is controlled by the <code>--start</code> and <code>--end</code> options.  For the example data, the DEF statements need to extend the range of the data set by 1 hour so as to encompass 25 hours instead of the display area&#8217;s 24 hours:</p>
<pre>  DEF:bytesIn=network.rrd:bytesIn:AVERAGE:start=end-25h \
  DEF:bytesOut=network.rrd:bytesOut:AVERAGE:start=end-25h \</pre>
<p>Putting it together, the following command will pull in all the data necessary to calculate a running average for the extent of the display area, calculate the running averages, and display the results:</p>
<pre>rrdtool graph example.png \
  --title "Network Traffic" \
  --width=500 \
  --slope-mode \
  --end=now \
  --start=end-24h \
  --base=1000 \
  DEF:bytesIn=network.rrd:bytesIn:AVERAGE:start=end-25h \
  DEF:bytesOut=network.rrd:bytesOut:AVERAGE:start=end-25h \
  CDEF:bpsIn=bytesIn,8,* \
  CDEF:bpsOut=bytesOut,8,* \
  CDEF:bpsOutNeg=bpsOut,-1,* \
  CDEF:bpsInTrend=bpsIn,3600,TREND \
  CDEF:bpsOutTrendNeg=bpsOutNeg,3600,TREND \
  VDEF:bpsInTot=bpsIn,TOTAL \
  VDEF:bpsOutTot=bpsOut,TOTAL \
  COMMENT:"              current     min        max      total\n" \
  AREA:bpsIn#FF880044:"Bits/s In " \
  GPRINT:bpsIn:LAST:"%6.1lf%s\t" \
  GPRINT:bpsIn:MIN:"%6.1lf%s\t" \
  GPRINT:bpsIn:MAX:"%6.1lf%s\t" \
  GPRINT:bpsInTot:"%6.1lf%s\n" \
  LINE1:bpsIn#FF8800CC \
  AREA:bpsOutNeg#44C80044:"Bits/s Out" \
  GPRINT:bpsOut:LAST:"%6.1lf%s\t" \
  GPRINT:bpsOut:MIN:"%6.1lf%s\t" \
  GPRINT:bpsOut:MAX:"%6.1lf%s\t" \
  GPRINT:bpsOutTot:"%6.1lf%s\n" \
  LINE1:bpsOutNeg#44C800CC \
  LINE2:bpsInTrend#000000CC \
  LINE2:bpsOutTrendNeg#000000CC \
  HRULE:0#000000</pre>
<p><a href="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-3.png"><img class="aligncenter size-full wp-image-603" title="Example 3" src="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-3.png" alt="" width="581" height="201" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2011/10/23/graphing-running-averages-in-rrdtool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graphing Time Shifted Data in RRDTool</title>
		<link>http://wiki.springsurprise.com/2011/10/20/graphing-time-shifted-data-in-rrdtool/</link>
		<comments>http://wiki.springsurprise.com/2011/10/20/graphing-time-shifted-data-in-rrdtool/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 07:38:48 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Graphing Solutions]]></category>
		<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[Technical Tidbits]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[rrd]]></category>
		<category><![CDATA[rrd tool]]></category>
		<category><![CDATA[rrdtool]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=586</guid>
		<description><![CDATA[While visualizing performance or activity data using a well-designed chart can be useful, it is frequently desired to be able to compare recent performance against an earlier period of time.  Comparisons against historic data help identify changes in trends or &#8230; <a href="http://wiki.springsurprise.com/2011/10/20/graphing-time-shifted-data-in-rrdtool/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While visualizing performance or activity data using a well-designed chart can be useful, it is frequently desired to be able to compare recent performance against an earlier period of time.  Comparisons against historic data help identify changes in trends or other anomalous performance behaviors.  In some cases, this can be done simply by extending the time span of the graph.  However, expansion of the graphed time span can lead to either an unacceptable loss of resolution or an unacceptably large image.  Fortunately, <a href="http://oss.oetiker.ch/rrdtool/index.en.html">RRDTool</a> can make this type of comparison chart fairly easily without resulting in a loss of fidelity or unwieldy image size.</p>
<p>To begin, it helps to setup a chart that graphs the desired data in a typical manner before adding in the time shifted overlays.  The following graph command creates a somewhat typical visualization of the last hour&#8217;s network traffic as illustrated by Example 1 graph:</p>
<pre>rrdtool graph example.png \
  --title "Network Traffic" \
  --width=500 \
  --slope-mode \
  --end=now \
  --start=end-1h \
  --base=1000 \
  DEF:bytesIn=network.rrd:bytesIn:AVERAGE \
  DEF:bytesOut=network.rrd:bytesOut:AVERAGE \
  CDEF:bpsIn=bytesIn,8,* \
  CDEF:bpsOut=bytesOut,8,* \
  CDEF:bpsOutNeg=bpsOut,-1,* \
  VDEF:bpsInTot=bpsIn,TOTAL \
  VDEF:bpsOutTot=bpsOut,TOTAL \
  COMMENT:"            current     min        max      total\n" \
  AREA:bpsIn#FF880044:"Bits/s In " \
  GPRINT:bpsIn:LAST:"%6.1lf%s\t" \
  GPRINT:bpsIn:MIN:"%6.1lf%s\t" \
  GPRINT:bpsIn:MAX:"%6.1lf%s\t" \
  GPRINT:bpsInTot:"%6.1lf%s\n" \
  LINE1:bpsIn#FF8800CC \
  AREA:bpsOutNeg#44C80044:"Bits/s Out" \
  GPRINT:bpsOut:LAST:"%6.1lf%s\t" \
  GPRINT:bpsOut:MIN:"%6.1lf%s\t" \
  GPRINT:bpsOut:MAX:"%6.1lf%s\t" \
  GPRINT:bpsOutTot:"%6.1lf%s\n" \
  LINE1:bpsOutNeg#44C800CC \
  HRULE:0#000000</pre>
<p><a href="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-1.png"><img class="aligncenter size-full wp-image-587" title="Example 1" src="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-1.png" alt="" width="581" height="201" /></a>With the basic chart setup as desired, now the command can be modified to support a time shifted overlay.</p>
<p>First, additional DEF statements need to be defined for time range <em>for the source data</em> to encompass the time span desired for comparison.  Note that this is <em>not</em> the same as the graph&#8217;s display range; those options (<code>--start</code> and <code>--end</code>) should remain unchanged.  The override start time should extend the time frame to the start of the time shifted data.  For example, the following would be suitable for comparison of the previous 1 hour:</p>
<pre>  DEF:bytesInPrevHour=network.rrd:bytesIn:AVERAGE:start=end-2h \
  DEF:bytesOutPrevHour=network.rrd:bytesOut:AVERAGE:start=end-2h \</pre>
<p>As another example, the following would be suitable for a comparison of the same hour, 1 day (24 hours) ago:</p>
<pre>  DEF:bytesInPrevDay=network.rrd:bytesIn:AVERAGE:start=end-25h \
  DEF:bytesOutPrevDay=network.rrd:bytesOut:AVERAGE:start=end-25h \</pre>
<p>Next, a new SHIFT statement needs to be introduced that shifts the data being displayed by the specified number of seconds.  The SHIFT statements must be specified <em>after</em> the DEF statements they are shifting.  The following statements would shift the newly inserted DEF statements by 1 hour (3600 seconds):</p>
<pre>  SHIFT:bytesInPrevHour:3600 \
  SHIFT:bytesOutPrevHour:3600 \</pre>
<p>Next, the CDEF and VDEF operations need to be supplied in order to transform the new data in a consistent manner with the original data.</p>
<pre>  CDEF:bpsInPrev=bytesInPrevHour,8,* \
  CDEF:bpsOutPrev=bytesOutInPrevHour,8,* \
  CDEF:bpsOutPrevNeg=bpsOutPrev,-1,* \</pre>
<p>Finally, the new elements are ready for graphing.  Care should be made to ensure the shifted data is displayed in a distinct manner from the current data so as to prevent visual confusion or obscuring the current data.</p>
<pre>  LINE1:bpsInPrev#00000088 \ 
  LINE1:bpsOutPrevNeg#00000088 \</pre>
<p>Pulling it all together, the following command will pull in the data from the extended time frame, shift it forward by the appropriate amount of time so that it aligns with the displayed time frame, perform the desired transformation options, and finally display the results:</p>
<pre>rrdtool graph example.png \
  --title "Network Traffic" \
  --width=500 \
  --slope-mode \
  --end=now \
  --start=end-1h \
  --base=1000 \
  DEF:bytesIn=network.rrd:bytesIn:AVERAGE \
  DEF:bytesOut=network.rrd:bytesOut:AVERAGE \
  DEF:bytesInPrevHour=network.rrd:bytesIn:AVERAGE:start=end-2h \
  DEF:bytesOutPrevHour=network.rrd:bytesOut:AVERAGE:start=end-2h \
  SHIFT:bytesInPrevHour:3600 \
  SHIFT:bytesOutPrevHour:3600 \
  CDEF:bpsIn=bytesIn,8,* \
  CDEF:bpsOut=bytesOut,8,* \
  CDEF:bpsOutNeg=bpsOut,-1,* \
  CDEF:bpsInPrev=bytesInPrevHour,8,* \
  CDEF:bpsOutPrev=bytesOutInPrevHour,8,* \
  CDEF:bpsOutPrevNeg=bpsOutPrev,-1,* \
  VDEF:bpsInTot=bpsIn,TOTAL \
  VDEF:bpsOutTot=bpsOut,TOTAL \
  COMMENT:"            current     min        max      total\n" \
  AREA:bpsIn#FF880044:"Bits/s In " \
  GPRINT:bpsIn:LAST:"%6.1lf%s\t" \
  GPRINT:bpsIn:MIN:"%6.1lf%s\t" \
  GPRINT:bpsIn:MAX:"%6.1lf%s\t" \
  GPRINT:bpsInTot:"%6.1lf%s\n" \
  LINE1:bpsIn#FF8800CC \
  AREA:bpsOutNeg#44C80044:"Bits/s Out" \
  GPRINT:bpsOut:LAST:"%6.1lf%s\t" \
  GPRINT:bpsOut:MIN:"%6.1lf%s\t" \
  GPRINT:bpsOut:MAX:"%6.1lf%s\t" \
  GPRINT:bpsOutTot:"%6.1lf%s\n" \
  LINE1:bpsOutNeg#44C800CC \
  LINE1:bpsInPrev#00000088 \ 
  LINE1:bpsOutPrevNeg#00000088 \
  HRULE:0#000000</pre>
<p><a href="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-2.png"><img class="aligncenter size-full wp-image-590" title="Example 2" src="http://wiki.springsurprise.com/wp-content/uploads/2011/10/Example-2.png" alt="" width="581" height="201" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2011/10/20/graphing-time-shifted-data-in-rrdtool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling DNS statistics for Mac OS X Server</title>
		<link>http://wiki.springsurprise.com/2011/10/17/enabling-dns-statistics-for-mac-os-x-server/</link>
		<comments>http://wiki.springsurprise.com/2011/10/17/enabling-dns-statistics-for-mac-os-x-server/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 07:06:58 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[Technical Tidbits]]></category>
		<category><![CDATA[leopard server]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=577</guid>
		<description><![CDATA[The DNS server is an essential service for the smooth operations of any site, but there is little insight into how it is being used or its operational health presented in the Apple Server Admin tool.  Thankfully, Apple uses the &#8230; <a href="http://wiki.springsurprise.com/2011/10/17/enabling-dns-statistics-for-mac-os-x-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The DNS server is an essential service for the smooth operations of any site, but there is little insight into how it is being used or its operational health presented in the Apple Server Admin tool.  Thankfully, Apple uses the standard <a href="http://www.bind9.net/">bind9</a> utility as the underlying implementation for the DNS service and this can provide a great deal of statistics for analysis.  Unfortunately, the statistics are currently disabled in the default installation and there is no means to enable them using the Server Admin tool but it is relatively straight-forward to edit a couple configuration files in order to unleash this capability.</p>
<p>First, the <code>/etc/named.conf</code> file needs to be modified to specify both the statistics file and the appropriate control mechanisms.  As this is an essential configuration file, create a backup copy of the existing (working) file before editing in case something goes wrong.</p>
<p>In the <code>named.conf</code> file, ensure that there is an configuration block for the &#8220;controls&#8221;.  By default, it should already be present and look similar to the following:</p>
<pre>controls  {
        inet 127.0.0.1 port 54 allow    {any;   }
        keys    { "rndc-key";    };
   };</pre>
<p>This section defines the access control for the stats tool (among other things).  The essential elements for this purpose is that it defines the communications port as port 54 and it uses the key identified as &#8220;rndc-key&#8221; as its security token.  The key is actually defined in a separate file and read into the configuration via the <code>include "/etc/rndc.key"</code> statement earlier in the <code>named.conf</code> file.</p>
<p>There should also be a configuration block for the &#8220;options&#8221;.  A typical installation will look like the following:</p>
<pre>options  {
        include "/etc/dns/options.conf.apple";
                /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
   };</pre>
<p>This section requires some minor modification to specify the stats file.  In the block, insert a line specifying <code>statistics-file "/full/path/to/the/named.stats";</code>.  It is best to make the addition <em>after</em> the include statement so that the edited result looks similar to the following:</p>
<pre>options  {
        include "/etc/dns/options.conf.apple";

        // Addition to enable statistics
        statistics-file "/var/log/named.stats";

                /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
   };</pre>
<p>After the <code>named.conf</code> file has been configured properly, a new file must created for the configuration of the rndc utility.  Create the <code>/etc/rndc.conf</code> file and edit it with the following settings:</p>
<pre>include "/etc/rndc.key";

options {
    default-key "rndc-key";
    default-server localhost;
    default-port 54;
};</pre>
<p>The include statement <em>must</em> match the same included file specified in the <code>named.conf</code> file as the security key (&#8220;rndc-key&#8221;) must match or the <a href="http://www.manpagez.com/man/8/rndc/">rndc</a> utility used to trigger the stats dump will not be authorized to connect.  The options block specifies the key name and the default server and port.  The assumption here is that the rndc tool will be run on the same host (localhost) as the DNS server.  The port should match the port specified in the controls block of the <code>named.conf</code> file.</p>
<p>At this point, the named daemon can be safely signaled to pick up the configuration changes.  This can be done easily via the Server Admin tool by restarting the DNS service or, for the more advanced sysadmin, a SIGHUP can be sent to the process.</p>
<p>To trigger a stats dump, simply call the <code>rndc stats</code> and look for the stats file specified in the <code>named.conf</code> file.  If the file isn&#8217;t found, there may be a authorization issue:  try running the command as an administrator or call the command via <a href="http://www.manpagez.com/man/8/sudo/">sudo</a> (e.g. <code>sudo rndc stats</code>).</p>
<p>The stats can be triggered on an ongoing basis by specifying an appropriate entry for the <a href="http://www.manpagez.com/man/8/launchd/">launchd</a> system.  A simple plist formatted file located in <code>/Library/LaunchDaemons</code> can serve to repeatedly call the stats file for ongoing monitoring.  (See <a href="http://wiki.springsurprise.com/2009/06/22/mac-os-x-launchd-tips-tricks/">launchd tips and tricks</a> for more information.)</p>
<p>The following example would be named <code>com.hostname.namedstats.plist</code> and specifies that the stats should be generated every 5 minutes (300 seconds).</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.hostname.namedstats&lt;/string&gt;
    &lt;key&gt;StartInterval&lt;/key&gt;
    &lt;integer&gt;300&lt;/integer&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/sbin/rndc&lt;/string&gt;
        &lt;string&gt;stats&lt;/string&gt;
    &lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p>Note that every time the stats are generated they are appended to the existing file which can quickly result in a very large, unwieldy file.  If recurring stats are desired, then ensuring the stats file is <a href="http://wiki.springsurprise.com/2011/10/15/automatic-log-rotation-in-mac-os-x/">periodically rotated</a> is essential.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2011/10/17/enabling-dns-statistics-for-mac-os-x-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic Log Rotation in Mac OS X</title>
		<link>http://wiki.springsurprise.com/2011/10/15/automatic-log-rotation-in-mac-os-x/</link>
		<comments>http://wiki.springsurprise.com/2011/10/15/automatic-log-rotation-in-mac-os-x/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 07:44:39 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[Technical Tidbits]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[log rotation]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[newsyslog]]></category>
		<category><![CDATA[newsyslog.conf]]></category>
		<category><![CDATA[syslog]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=553</guid>
		<description><![CDATA[Log rotation is a standard practice to ensure that log files are periodically restarted so that they don&#8217;t grow without bounds.  In the past, when disk space was at a premium and maximum file sizes were limited, this was an &#8230; <a href="http://wiki.springsurprise.com/2011/10/15/automatic-log-rotation-in-mac-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Log rotation is a standard practice to ensure that log files are periodically restarted so that they don&#8217;t grow without bounds.  In the past, when disk space was at a premium and maximum file sizes were limited, this was an absolute necessity.  For more modern systems, these constraints may be less relevant although they may continue to be a valid concern for very active systems or with verbose logging enabled.  Even with abundant disk space, appropriate managing of the system logs helps ensure the system remains healthy, logs remain available for diagnostics and analysis, and operational overhead is reduced.</p>
<p>In Linux, the typical log rotation utility is, appropriately enough, <a href="http://linuxcommand.org/man_pages/logrotate8.html">logrotate</a>.  However, Mac OS X uses a different tool, <a href="http://www.manpagez.com/man/8/newsyslog/">newsyslog</a>, to manage the log rotation responsibilities.  This utility is run automatically by the OS at frequently intervals and evaluates the rules defined in its configuration file &#8212; <code>/etc/newsyslog.conf</code>.  For the log files defined in the config, it can evaluate the need to rotate based on a number of criteria, such as file size, at a specific time, at a specific interval, etc.  It can also specify additional actions to take on the rotated log, including compression of the old log, maintaining a fixed number of previous log files, setting appropriate permissions, etc.  Full documentation is available in the man page for <a href="http://www.manpagez.com/man/5/newsyslog.conf/">newsyslog.conf</a>.</p>
<p>Each entry in the <code>newsyslog.conf</code> file is specified as a single line with space-delimited fields for the various options.  The general format is as follows (with [] surrounding the optional fields):</p>
<p><code>logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]</code></p>
<p>An example entry for rotating the named.stats log file can be specified as follows:</p>
<p><code>/var/log/named.stats                    640  5     1000 *     J</code></p>
<p>In the above example, the full path is specified for the target log file &#8212; <code>/var/log/named.stats</code>.  Permissions (640) are specified in the typical Unix manner, in this case enabling read/write for the owner and read-only for the group.  This log file will maintain a maximum of 5 files, removing the oldest file as newer archived logs are created.  This log file is also set to rotate at a fixed size &#8212; 1000 kilobytes and can rotate at any time (&#8220;*&#8221;) this size threshold is exceeded.  The &#8220;J&#8221; flag specified calls for the the older log files to be compressed (further reducing used disk space) using the <a href="http://www.manpagez.com/man/1/bzip2/">bzip2</a> utility.</p>
<p>A special note for binary (not text-based) logs:  by default, <code>newsyslog</code> will inject a line at the beginning of a file indicating when and why the log rotated.  For most text-based logs, this can be easily skipped over but for binary logs this might result in an unreadable file.  In this case, be sure to specify the &#8220;B&#8221; flag which suppresses the informational line from being injected.</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2011/10/15/automatic-log-rotation-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Remote Logging on Mac OS X</title>
		<link>http://wiki.springsurprise.com/2010/01/30/enable-remote-logging-on-mac-os-x/</link>
		<comments>http://wiki.springsurprise.com/2010/01/30/enable-remote-logging-on-mac-os-x/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 00:18:09 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[Technical Tidbits]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[launchd]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[leopard server]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[syslog]]></category>
		<category><![CDATA[syslogd]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=397</guid>
		<description><![CDATA[Background It is often desirable to collect the system logs from various devices onto a central &#8220;logging host&#8221;.  This can simplify monitoring needs considerably as tools and scripts need only work on a single host.  It also provides some security &#8230; <a href="http://wiki.springsurprise.com/2010/01/30/enable-remote-logging-on-mac-os-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>It is often desirable to collect the system logs from various devices onto a central &#8220;logging host&#8221;.  This can simplify monitoring needs considerably as tools and scripts need only work on a single host.  It also provides some security benefits as hackers will have a harder time masking their activities if they do not have access to the logging host.</p>
<p>On Mac OS X, there is a logging daemon (the Unix standard <code>syslogd</code> utility) that can be used to write both local logs and receive logs from remote hosts.  Unfortunately, the ability to receive remote logs is turned off in the default installation.  However, it is a trivial task to enable this functionality.</p>
<h3>Setup (for 10.5 and older systems)</h3>
<ol>
<li>Login as administrator to the logging host</li>
<li>Open a terminal session using the Terminal utility</li>
<li>Navigate to the LaunchDaemons directory<br />
<code>cd /System/Library/LaunchDaemons</code></li>
<li>Edit the <code>com.apple.syslogd.plist</code> file<br />
<code>sudo vi com.apple.syslogd.plist</code></li>
<li>Remove the comment delimiters (<code>&lt;!--</code> and <code>--&gt;</code>) surrounding the <code>NetworkListener</code> block and save the changes<br />
<blockquote>
<pre>&lt;!--
 &lt;key&gt;NetworkListener&lt;/key&gt;
 &lt;dict&gt;
 &lt;key&gt;SockServiceName&lt;/key&gt;
 &lt;string&gt;syslog&lt;/string&gt;
 &lt;key&gt;SockType&lt;/key&gt;
 &lt;string&gt;dgram&lt;/string&gt;
 &lt;/dict&gt;
--&gt;</pre>
</blockquote>
</li>
<li>Stop the currently running instance of the syslog daemon<br />
<code>sudo launchctl unload  /System/Library/LaunchDaemons/com.apple.syslogd.plist</code></li>
<li>Restart the syslog daemon to pick up the changes in the LaunchDaemon configuration<br />
<code>sudo launchctl load  /System/Library/LaunchDaemons/com.apple.syslogd.plist</code></li>
</ol>
<p>The logging facility on the log host should now be available for remote devices to use.</p>
<h3>Setup (for 10.6 and later systems)</h3>
<ol>
<li>Login as administrator to the logging host</li>
<li>Open a terminal session using the Terminal utility</li>
<li>Navigate to the LaunchDaemons directory<br />
<code>cd /System/Library/LaunchDaemons</code></li>
<li>Convert the <code>com.apple.syslogd.plist</code> to XML format<br />
<code>sudo plutil -convert xml1 com.apple.syslogd.plist</code></li>
<li>Edit the <code>com.apple.syslogd.plist</code> file<br />
<code>sudo vi com.apple.syslogd.plist</code></li>
<li>Add the NetworkListener dict entry after the end of the BSDSystemLogger dict entry and save the changes<br />
<blockquote>
<pre>&lt;key&gt;NetworkListener&lt;/key&gt;
&lt;dict&gt;
&lt;key&gt;SockServiceName&lt;/key&gt;
&lt;string&gt;syslog&lt;/string&gt;
&lt;key&gt;SockType&lt;/key&gt;
&lt;string&gt;dgram&lt;/string&gt;
&lt;/dict&gt;</pre>
</blockquote>
</li>
<li>Convert the <code>com.apple.syslogd.plist</code> file back to the binary format<br />
<code>sudo plutil -convert binary1 com.apple.syslogd.plist</code></li>
<li>Stop the currently running instance of the syslog daemon<br />
<code>sudo launchctl unload  /System/Library/LaunchDaemons/com.apple.syslogd.plist</code></li>
<li>Restart the syslog daemon to pick up the changes in the LaunchDaemon configuration<br />
<code>sudo launchctl load  /System/Library/LaunchDaemons/com.apple.syslogd.plist</code></li>
</ol>
<p>The logging facility on the log host should now be available for remote devices to use.</p>
<h3>Setup (using the Property List Editor)</h3>
<p>Apple provides the Property List Editor utility as part of its developer tools.  The developer tools are usually a separate install from the operating system and is frequently <em>not</em> installed on systems.  If it is present, then using the Property List Editor may be the most convenient means of modifying the com.apple.syslogd.plist file.</p>
<ol>
<li>Login as administrator to the logging host</li>
<li>Launch the Property List Editor utility (typically located in <code>/Developer/Applications/Utilities</code>)</li>
<li>Open the <code>/System/Library/LaunchDaemons/com.apple.syslogd.plist</code> file</li>
<li>Select the &#8220;Sockets&#8221; dictionary entry and &#8220;Add Item&#8221; to create a new key in the &#8220;Sockets&#8221; dictionary</li>
<li>Change the name of the item to &#8220;NetworkListener&#8221; and set its type to &#8220;Dictionary&#8221;</li>
<li>Select the &#8220;NetworkListener&#8221; dictionary entry and &#8220;Add Item&#8221; to create a new key in the &#8220;NetworkListener&#8221; dictionary</li>
<li>Change the name of the item to &#8220;SockServiceName&#8221;, its type to &#8220;String&#8221; and its value to &#8220;syslog&#8221;</li>
<li>Select the &#8220;NetworkListener&#8221; dictionary entry and &#8220;Add Item&#8221; to create another new key in the &#8220;NetworkListener&#8221; dictionary</li>
<li>Change the name of the item to &#8220;SockType&#8221;, its type to &#8220;String&#8221;, and its value to &#8220;dgram&#8221;</li>
<li>Save the file and quit the Property List Editor utility.  The property list should resemble the following example:<a href="http://wiki.springsurprise.com/wp-content/uploads/2010/01/Syslog-Property-List.png"><img class="aligncenter size-full wp-image-447" title="Syslog Property List" src="http://wiki.springsurprise.com/wp-content/uploads/2010/01/Syslog-Property-List.png" alt="Example Property List for com.apple.syslogd.plist" width="476" height="382" /></a></li>
<li>Open a terminal session using the Terminal utility</li>
<li>Navigate to the LaunchDaemons directory<br />
<code>cd /System/Library/LaunchDaemons</code></li>
<li>Stop the currently running instance of the syslog daemon<br />
<code>sudo launchctl unload  /System/Library/LaunchDaemons/com.apple.syslogd.plist</code></li>
<li>Restart the syslog daemon to pick up the changes in the LaunchDaemon configuration<br />
<code>sudo launchctl load  /System/Library/LaunchDaemons/com.apple.syslogd.plist</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2010/01/30/enable-remote-logging-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extending Service Discovery Cabilities on ReadyNAS</title>
		<link>http://wiki.springsurprise.com/2009/10/09/extending-service-discovery-cabilities-on-readynas/</link>
		<comments>http://wiki.springsurprise.com/2009/10/09/extending-service-discovery-cabilities-on-readynas/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 19:17:22 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[Technical Tidbits]]></category>
		<category><![CDATA[avahi]]></category>
		<category><![CDATA[bonjour]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[readynas]]></category>
		<category><![CDATA[UPnP]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=347</guid>
		<description><![CDATA[Background The ReadyNAS appliance can advertise the services available on their system through the Bonjour or UPnP protocols.  These service discovery protocols can greatly simplify the client connection and configuration problems.  The web administration interface provides an easy method of &#8230; <a href="http://wiki.springsurprise.com/2009/10/09/extending-service-discovery-cabilities-on-readynas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>The ReadyNAS appliance can advertise the services available on their system through the Bonjour or UPnP protocols.  These service discovery protocols can greatly simplify the client connection and configuration problems.  The web administration interface provides an easy method of controlling some of the services advertised, but there may be additional services running on the ReadyNAS that do not have an administrative interface for controlling their advertisement.</p>
<p>Because the ReadyNAS uses the open-source project <a href="http://avahi.org/">avahi</a> to handle service discovery, documentation on extending the list of services to be advertised is readily available.  With this information, it is relatively easy to create new service records for additional services and simplify the user experience.</p>
<h3>Setup</h3>
<p>In order to create additional avahi service records, it is necessary to <a href="http://wiki.springsurprise.com/2009/10/01/enabling-root-ssh-access-on-a-readynas-appliance/">enable root SSH access</a> to the ReadyNAS system.</p>
<p>The service file is a simple XML file which defines a service-group record.  The service-group record contains a number of elements which may vary according to the service being advertised.  The two essential elements are the name record, which defines the displayed name for the service in question, and the service record, which defines the type, port, and any other connection-related information.</p>
<p>The name element has one possible attribute &#8211; <code>replace-wildcards</code> &#8211; which can take a value of &#8220;yes&#8221; or &#8220;no&#8221;.  If the attribute is present and the value is &#8220;yes&#8221;, then a <code>%h</code> can be used in the value which will be automatically substituted with the host name of the system.</p>
<p>The service element groups together the necessary information for service connectivity.  The two most essential elements it contains are the type element and the port element.  The type is the is the official service type as defined by <a href="http://www.dns-sd.org/ServiceTypes.html">RFC 2782</a> and the port is simply the listening port number.</p>
<p>Depending on the service, there may be additional elements or attributes that are necessary to have a properly formatted service file.  Be sure to consult the <a href="http://avahi.org/download/avahi.service.5.xml">documentation</a> to ensure the service is properly defined before making any changes.</p>
<h4>Example</h4>
<p>The following is an example configuration that enables service discovery for SSH:</p>
<blockquote><p><code><br />
&lt;?xml version="1.0" standalone='no'?&gt;<br />
&lt;service-group&gt;<br />
&lt;name replace-wildcards="yes"&gt;SSH on %h&lt;/name&gt;<br />
&lt;service&gt;<br />
&lt;type&gt;_ssh._tcp&lt;/type&gt;<br />
&lt;port&gt;22&lt;/port&gt;<br />
&lt;/service&gt;<br />
&lt;/service-group&gt;</code></p></blockquote>
<p>To activate this service, perform the following actions:</p>
<ol>
<li>Login (via ssh) as “root” to the ReadyNAS appliance.</li>
<li>Navigate to the configuration directory.
<p style="padding-left: 30px;"><code>cd /etc/avahi/services</code></p>
</li>
<li>Create a new file named <code>ssh.service</code> containing the configuration information listed above.</li>
<li>Restart the avahi service to load the new service file.
<p style="padding-left: 30px;"><code>kill -SIGHUP `ps ax | grep avahi | grep -v grep | awk '{ print $1 }'`</code></p>
</li>
</ol>
<p><center><iframe src="http://rcm.amazon.com/e/cm?t=circlesofarchimedes-20&#038;o=1&#038;p=48&#038;l=st1&#038;mode=books&#038;search=o%27reilly%20networking%20configuration&#038;nou=1&#038;fc1=000000&#038;lt1=_blank&#038;lc1=3366FF&#038;bg1=FFFFFF&#038;f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe></center></p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2009/10/09/extending-service-discovery-cabilities-on-readynas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring RADIUS for Bugzilla on Mac OS X Server</title>
		<link>http://wiki.springsurprise.com/2009/10/06/configuring-radius-for-bugzilla-on-mac-os-x-server/</link>
		<comments>http://wiki.springsurprise.com/2009/10/06/configuring-radius-for-bugzilla-on-mac-os-x-server/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:46:19 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technical Tidbits]]></category>
		<category><![CDATA[bugzilla]]></category>
		<category><![CDATA[radius]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=320</guid>
		<description><![CDATA[Background Bugzilla is a very popular open-source issue tracking system.  However, setting up all the user accounts can be a tedious chore, particularly for large user bases.  In addition, there are additional user-management headaches associated with maintaining another list of &#8230; <a href="http://wiki.springsurprise.com/2009/10/06/configuring-radius-for-bugzilla-on-mac-os-x-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>Bugzilla is a very popular open-source issue tracking system.  However, setting up all the user accounts can be a tedious chore, particularly for large user bases.  In addition, there are additional user-management headaches associated with maintaining another list of user names, password issues, and access changes due to staff turnover.</p>
<p>Fortunately, Bugzilla is capable of integrating with the <a href="http://en.wikipedia.org/wiki/RADIUS">RADIUS</a> service available on the Mac OS X Server.  RADIUS is a remote authentication and authorization service which can handle the user authentication requests for Bugzilla and permit users to simply sign on with their standard account name and passwords.  This relieves the administrator from having to create and maintain another set of accounts and allows the users to simply use their standard account name and password.</p>
<p>It should be noted that the implementation of the RADIUS service on the Mac OS X Server is the open-source <a href="http://freeradius.org/">FreeRADIUS</a>.  More configuration information and usage can be found on the projects web site.</p>
<p>Prior <a href="http://wiki.springsurprise.com/2009/09/30/installing-bugzilla-on-mac-os-x-server/">installation</a> of Bugzilla is assumed for these directions.</p>
<h4>Enabling the RADIUS Service</h4>
<p>If the RADIUS service has not been enabled on the server, then it is necessary to activate it.  Do <em>not</em> start the service during this step.</p>
<ol>
<li>Open the <strong>Server Admin</strong> application and connect to the server hosting the RADIUS service.</li>
<li>Select the server in the &#8220;Servers&#8221; pane and then click on the &#8220;Settings&#8221; icon.</li>
<li>Click on the &#8220;Services&#8221; tab and enable the &#8220;RADIUS&#8221; service by clicking on the appropriate checkbox.</li>
<li>Save the new configuration by clicking on the &#8220;Save&#8221; button.</li>
<li>Select the &#8220;RADIUS&#8221; service now available in the &#8220;Servers&#8221; pane.</li>
<li>Select the &#8220;Settings&#8221; icon and select a security certificate to use for the service.  A self-signed certificate can easily be created using the &#8220;Manage Certificates&#8221; option in the drop-down menu.  Regardless, the certificate used for this service should <em><strong>not</strong></em> have a Private Key Passphrase set.</li>
<li>Save the new configuration by clicking on the &#8220;Save&#8221; button.</li>
</ol>
<h4>Configuring the RADIUS service</h4>
<p>The stock RADIUS service on Mac OS X (Leopard) has been configured to work only with Apple&#8217;s Airport and Airport Express WiFi systems.  In order to extend its functionality to provide service to other types of systems,  the configuration file must be edited and a special entry must be created.</p>
<ol>
<li>Open the <strong>Server Admin</strong> application and connect to the server hosting the RADIUS service.</li>
<li>Select the RADIUS service for configuration.  If the service is already running, then click on the &#8220;Stop RADIUS&#8221; button to stop it.</li>
<li>Click on the &#8220;Base Stations&#8221; icon and then the &#8220;Add&#8230;&#8221; button to create a new entry.  The most important elements to set correctly are the Type and IP Address.  Type <em>must</em> be &#8220;other&#8221; and the IP Address should be the address of the Bugzilla server.<br />
<blockquote><p>Name: <em> Bugzilla</em><br />
Type: <em> other</em><br />
IP Address: <em> 192.168.1.2</em><br />
Shared Secret: <em>********</em><br />
Verify: <em> ********</em></p></blockquote>
</li>
<li>Make a backup copy of the <code>/etc/raddb/users</code> configuration file for safety.
<p style="padding-left: 30px;"><code>sudo cp /etc/raddb/users /etc/raddb/users.orig</code></p>
</li>
<li>Edit the <code>/etc/raddb/users</code> configuration file to alter the default authentication type to use the Open Directory service instead of the local account database.  The line in question should be approximately 153 lines down in the file (as of 10.5.8).
<p style="padding-left: 30px;">Replace: <code>DEFAULT Auth-Type = System</code><br />
with: <code>DEFAULT Auth-Type = opendirectory</code></li>
<li>Return to the <strong>Server Admin</strong> application and start the RADIUS service.</li>
</ol>
<h4>Testing the RADIUS service</h4>
<p>In order to verify the RADIUS service is working properly it should be tested using the included test tool <code>radtest</code>.  The general format for testing the RADIUS service is:</p>
<p style="text-align: center;"><em>radtest user password radius-server nas-port-number shared-secret</em></p>
<p><em>user</em> is the username to be tested.</p>
<p><em>password</em> is the user&#8217;s password.  Note that this is given in cleartext and so may be considered a security risk.  It is suggested that you change the password immediately after concluding the test.</p>
<p><em>radius-server</em> is the hostname (or IP address) of the server hosting the RADIUS service.</p>
<p><em>nas-port-number</em> is the value of the NAS-Port attribute.  For testing purposes, it does not matter what value is provided as long as it is between 0 and 2^31.</p>
<p><em>shared-secret</em> is the shared secret established when the service was configured.</p>
<p>The following is an example usage showing the result of a successful test:</p>
<p style="padding-left: 30px;"><code>$ radtest groucho RufusTFirefly radius.example.com 10 SecretWord<br />
Sending Access-Request of id 203 to 192.168.1.2 port 1812<br />
User-Name = "groucho"<br />
User-Password = "RufusTFirefly"<br />
NAS-IP-Address = 255.255.255.255<br />
NAS-Port = 10<br />
rad_recv: Access-Accept packet from host 192.168.1.2:1812, id=203, length=20</code></p>
<h4>Configuring Bugzilla for RADIUS authentication</h4>
<p>RADIUS configuration requires administrative access to the Bugzilla installation.  It cannot be performed as a &#8220;normal&#8221; user of the system.  It is best practice to verify the RADIUS service is working properly before attempting to configure a dependent service.</p>
<ol>
<li>Install the Authen::Radius perl module (if not already installed as part of the initial setup).
<p style="padding-left: 30px;"><code>sudo cpan -i Authen::Radius</code></p>
</li>
<li>Login as administrator to Bugzilla.</li>
<li>Click on the &#8220;Administration&#8221; link.</li>
<li>Click on the &#8220;Parameters&#8221; link.</li>
<li>Click on the &#8220;RADIUS&#8221; link</li>
<li>Fill in the information for all the RADIUS fields.  The server is the hostname where the RADIUS service is running.  The secret it the shared secret established when the service was configured.  The NAS IP is the address where the Bugzilla service is running.  The email suffix is appended to the username to generate the appropriate email address for each user.<br />
<blockquote><p>RADIUS_server:  radius.example.com<br />
RADIUS_secret:  ********<br />
RADIUS_NAS_IP:  192.168.1.2<br />
RADIUS_email_suffix:  @example.com</p></blockquote>
</li>
<li>Click on the &#8220;Save Changes&#8221; button to save the new configuration information.</li>
<li>Click on the &#8220;User Authentication&#8221; link.</li>
<li>Navigate to the <code>user_verify_class</code> and activate RADIUS as a valid authentication mechanism.  It is strongly suggested that you leave the DB method also activated.</li>
<li>Click on the &#8220;Save Changes&#8221; button to save the new configuration information.</li>
</ol>
<p>Related Links</p>
<ul>
<li><a href="http://wiki.springsurprise.com/2009/09/30/installing-bugzilla-on-mac-os-x-server/">Installing Bugzilla on Mac OS X Server</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2009/10/06/configuring-radius-for-bugzilla-on-mac-os-x-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Bugzilla on Mac OS X Server</title>
		<link>http://wiki.springsurprise.com/2009/09/30/installing-bugzilla-on-mac-os-x-server/</link>
		<comments>http://wiki.springsurprise.com/2009/09/30/installing-bugzilla-on-mac-os-x-server/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 23:48:09 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=237</guid>
		<description><![CDATA[Background Bugzilla is a very popular open-source bug-tracking system.  It is used by many companies (large and small) to not only track defects and their remediation, but also to track various other development tasks, including new feature work, enhancement requests, &#8230; <a href="http://wiki.springsurprise.com/2009/09/30/installing-bugzilla-on-mac-os-x-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>Bugzilla is a very popular open-source bug-tracking system.  It is used by many companies (large and small) to not only track defects and their remediation, but also to track various other development tasks, including new feature work, enhancement requests, etc.  It can even be used as part of a change-control process (e.g. SAS-70, SOx, etc.).</p>
<p>Because Bugzilla is an open-source project, it is actively enhanced and can be installed on a number of different systems.  It is easily customized in both appearance and functionality which provides it with the flexibility to fit into the existing development process of almost any team.</p>
<p>The project&#8217;s site (<a href="http://www.bugzilla.org">http://www.bugzilla.org</a>) has a plethora of documentation, example usages, forums, as well as the latest releases.  The latest stable release can be found on their <a href="http://www.bugzilla.org/download/">download</a> page.  This post contains specific instructions for installing Bugzilla on a system running Mac OS X Server (Leopard).</p>
<h3>Preliminary Preparations</h3>
<h4>Perl</h4>
<p>An appropriate version of perl should already be available as part of the normal operating system installation.  Bugzilla requires a minimum of version 5.8.1 and version 5.8.8 should already be installed (as of OS X 10.5.8).  The version of perl can be verified with the following command:</p>
<p style="padding-left: 30px;"><code>/usr/bin/perl --version</code></p>
<h4>MySQL</h4>
<p>Bugzilla can utilize several different databases to store its data, but Mac OS X Server already has MySQL included in its normal installation so it makes sense to use that option.  However, the MySQL installed by default with Mac OS X Server does <em>not</em> include the necessary files to build a MySQL application so these must be installed manually.</p>
<p>To install the MySQL build files:</p>
<ol>
<li>Go to the Apple <a href="http://www.opensource.apple.com/">open source download page</a> and select the appropriate version of the operating system the installation is running.</li>
<li>Download the binary version of the MySQL package (for 10.5.8, the correct package is MySQL-45).</li>
<li>Decompress the packaged binary.
<p style="padding-left: 30px;"><code>tar xzf MySQL-45.binaries.tar.gz</code></p>
</li>
<li>Navigate to the uncompressed package directory.
<p style="padding-left: 30px;"><code>cd MySQL-45.binaries</code></p>
</li>
<li>Decompress the <em>internal</em> package into the destination directory.
<p style="padding-left: 30px;"><code>sudo tar -xzvf MySQL-45.root.tar.gz -C /</code></p>
</li>
</ol>
<p>To enable the MySQL service:</p>
<ol>
<li>Open the <strong>Server Admin</strong> application and connect to the server.</li>
<li>Select the server name and click on the &#8220;Settings&#8221; icon and then the &#8220;Services&#8221; tab.</li>
<li>Enable the MySQL service by clicking on the appropriate checkbox.</li>
<li>Click on the &#8220;Save&#8221; button to save the new configuration.</li>
</ol>
<p>To start the MySQL service:</p>
<ol>
<li>Open the <strong>Server Admin</strong> application and connect to the server.</li>
<li>Select the <strong>MySQL</strong> service from the list of available services.</li>
<li>Click on the &#8220;Settings&#8221; tab.</li>
<li>If necessary, set the root password for the MySQL service.  The default database location of <code>/var/mysql</code> may also be overridden if desired.</li>
<li>Click on the &#8220;Save&#8221; button to save the new configuration.</li>
<li>Click on the &#8220;Start MySQL&#8221; to startup the new service.</li>
</ol>
<h4>Apache</h4>
<p>Bugzilla can utilize a wide variety of web servers, but Apache is already installed with Mac OS X Server so it makes sense to use that option.  For this installation, Bugzilla will be configured in its own subdomain (e.g. bugzilla.example.com) and not as a directory of another domain (e.g. www.example.com/bugzilla).</p>
<p>To setup the bugzilla domain:</p>
<ol>
<li>Open the <strong>Server Admin</strong> application and connect to the server hosting DNS services.</li>
<li>Select the <strong>DNS</strong> service from the list of available services.</li>
<li>Select the &#8220;Zones&#8221; icon.</li>
<li>Select the Primary Zone for the site (e.g. example.com).</li>
<li>Click on the &#8220;Add Record&#8221; drop-down and select the &#8220;Add Alias (CNAME)&#8221; item.</li>
<li>Enter the Alias Name for the bugzilla subdomain.  The alias name should be <em>fully qualified</em>. This means the full domain name should be given and terminated with a period.
<p style="padding-left: 30px;"><code>bugzilla.example.com.</code></p>
</li>
<li>Enter the Destination for the bugzilla alias.  (i.e. the name of the server running Apache).  The domain name should be <em>fully qualified</em>. This means the full domain name should be given and terminated with a period.
<p style="padding-left: 30px;"><code>www.example.com.</code></p>
</li>
<li>Click on the &#8220;Save&#8221; button to save the new configuration.</li>
<li>Restart the DNS service to activate the new domain name.</li>
</ol>
<p>To setup the bugzilla web site:</p>
<ol>
<li>Open the <strong>Server Admin</strong> application and connect to the server hosting the web server.</li>
<li>Select the <strong>Web</strong> service from the list of available services.</li>
<li>Select the &#8220;Sites&#8221; icon.</li>
<li>Click on the &#8220;+&#8221; button to create a new site entry.</li>
<li>Click on the &#8220;General&#8221; tab and fill out the information for the new site entry:<br />
<blockquote><p>Domain Name: <em> bugzilla.example.com</em><br />
Host Description: <em>Bugzilla</em><br />
IP Address: <em>any</em><br />
Port: <em>80</em><br />
Web Folder:<em> /opt/local/www/bugzilla</em><br />
Default Index Files: <em> index.cgi</em><br />
Error Document: <em>/error.html</em><br />
Administrator Email: <em> admin@example.com</em></p></blockquote>
</li>
<li>Select the &#8220;Options&#8221; tab and enable the &#8220;CGI Execution&#8221; and &#8220;Allow All Overrides&#8221; options.</li>
<li>Select the &#8220;Logging&#8221; tab and setup the logging information:<br />
<blockquote><p>Enable Access Log: <em>enabled</em><br />
Archive every: <em>7 days</em><br />
Location: <em>/var/log/apache2/bugzilla_access_log</em><br />
Error Log Archive every: <em>7 days</em><br />
Error Log Location: <em>/var/log/apache2/bugzilla_error_log</em><br />
Error Log Level: <em>Warnings</em></p></blockquote>
</li>
<li>Select the &#8220;Web Services&#8221; tab and disable any additional services selected.</li>
<li>Enable the new site by clicking the &#8220;Enabled&#8221; checkbox next to the site entry.</li>
<li>Click on the &#8220;Save&#8221; button to save the new configuration.</li>
<li>Restart the Web service to activate the new site.</li>
</ol>
<h4>Bugzilla</h4>
<p>In this installation, Bugzilla is installed in the <code>/opt/local/src</code> directory so as to keep it isolated from the &#8220;stock&#8221; operating system tools and utilities.  This makes upgrading either the operating system or Bugzilla easier and less likely to result in conflicts.  In order to further simplify future upgrades, a symbolic link (<code>/opt/local/www/bugzilla</code>) is used as the root web folder instead of directly utilizing the actual Bugzilla source directory.</p>
<ol>
<li>Download the latest Bugzilla source tarball.</li>
<li>Copy the tarball to source directory.
<p style="padding-left: 30px;"><code>sudo cp bugzilla-3.4.2.tar.gz /opt/local/src</code></p>
</li>
<li>Unpack the source tarball.
<p style="padding-left: 30px;"><code>cd /opt/local/src<br />
sudo tar xzf bugzilla-3.4.2.tar.gz</code></li>
<li>Change the owner and group to the default web server user.
<p style="padding-left: 30px;"><code>sudo chown -R _www:_www bugzilla-3.4.2</code></p>
</li>
<li>Create an alias in the web folder to the active Bugzilla source.
<p style="padding-left: 30px;"><code>sudo ln -s /opt/local/src/bugzilla-3.4.2 /opt/local/www/bugzilla</code></p>
</li>
</ol>
<h4>Perl Modules</h4>
<p>There are a number of perl modules (both required and optional) that Bugzilla requires for operating.  Fortunately, there are several utilities included in the Bugzilla directory that can be used to determine what needs installation as well as actually installing the necessary modules.  For these installations, it is strongly suggested that you run the commands in a root shell.</p>
<p>To install the perl modules:</p>
<ol>
<li>Create a root shell.
<p style="padding-left: 30px;"><code>sudo bash</code></p>
</li>
<li>Execute the check-modules.pl script.
<p style="padding-left: 30px;"><code>/opt/local/src/bugzilla-3.4.2/checksetup.pl --check_modules</code></p>
</li>
<li>Install all the <em>required</em> perl modules identified by the check-modules.pl script.</li>
<li>Install the appropriate database binding module (DBD:mysql)
<p style="padding-left: 30px;"><code>/usr/bin/perl install-module.pl DBD::mysql</code></p>
</li>
<li>Install any <em>optional</em> modules desired.</li>
<li>Exit from the root shell.
<p style="padding-left: 30px;"><code>exit</code></p>
</li>
</ol>
<h4>Mail</h4>
<p>Mac OS X Server already comes with a compatible mail transfer agent (Postfix) so no additional installation is necessary.  A working mail service is necessary for Bugzilla to issue event alerts and notifications.</p>
<h3>Configuration</h3>
<h4>localconfig</h4>
<p>The <code>localconfig</code> file is an auto-generated file that contains many of the core Bugzilla configuration variables.  Generation of the file is done by running the <code>checksetup.pl</code> script (with no additional parameters).  The resulting file is <em>not</em> immediately usable as it requires a couple quick updates to properly configure the database access.</p>
<ol>
<li>Execute the <code>checksetup.pl</code> script to generate the <code>localconfig</code> file.
<p style="padding-left: 30px;"><code>cd /opt/local/src/bugzilla-3.4.2<br />
./checksetup.pl</code></li>
<li>Change the $db_driver variable in the <code>localconfig</code> file.
<p style="padding-left: 30px;"><code>$db_driver = 'mysql'</code></p>
</li>
<li>Change the $db_pass variable in the <code>localconfig</code> file to the password for &#8216;bugs&#8217; user of the database.  (The &#8216;bugs&#8217; user will be created shortly.)
<p style="padding-left: 30px;"><code>$db_pass = '********'</code></p>
</li>
<li>Change the $webservergroup variable in the <code>localconfig</code> file.
<p style="padding-left: 30px;"><code>$webservergroup = '_www'</code></p>
</li>
</ol>
<h4>MySQL</h4>
<p>In order to provide a better working experience with Bugzilla, it is necessary to update some of the MySQL configuration variables.  In addition, a new database user must be created.</p>
<ol>
<li>Edit the /etc/my.cnf file to permit large attachments and many comments
<p style="padding-left: 30px;"><code>max_allowed_packet=4M</code></p>
</li>
<li>Edit the /etc/my.cnf file to allow small words in full-text indexes
<p style="padding-left: 30px;"><code>ft_min_word_len=2</code></p>
</li>
<li>Add the &#8216;bugs&#8217; database user with associated privileges.  Be sure to specify the same password for the &#8216;bugs&#8217; users as in the configuration of the <code>localconfig</code> file.
<p style="padding-left: 30px;"><code>mysql -u root -p<br />
mysql&gt; GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES on bugs.* to bugs@localhost IDENTIFIED BY '********';<br />
mysql&gt; FLUSH PRIVILEGES;<br />
mysql&gt; commit;<br />
mysql&gt; exit;</code></li>
<li>Run the checksetup.pl script again to create the database tables, groups, users, and indexes.  Be sure to note the created administrator account and password for future reference.</li>
</ol>
<h4>Bugzilla</h4>
<p>Bugzilla should now be accessible to a web browser at the domain specified earlier.  (http://bugzilla.example.com)  While it is usable in this state, there are some additional configuration settings that should be made with the administrator&#8217;s account.</p>
<ol>
<li>Login as the administrator using the bugzilla administrator&#8217;s email address and password previously set.</li>
<li>Click on the &#8220;Administration&#8221; link.</li>
<li>Click on the &#8220;Parameters&#8221; link.</li>
<li>Set the email address of the maintainer.
<p style="padding-left: 30px;"><code>bugadmin@example.com</code></p>
</li>
<li>Set the URL base of the installation.
<p style="padding-left: 30px;"><code>http://bugzilla.example.com/</code></p>
</li>
<li>Set the cookie domain for the service.
<p style="padding-left: 30px;"><code>bugzilla.example.com</code></p>
</li>
<li>Click on the &#8220;Save Changes&#8221; button to save the new parameters.</li>
</ol>
<h3>Related Links</h3>
<ul>
<li><a href="http://wiki.springsurprise.com/2009/10/06/configuring-radius-for-bugzilla-on-mac-os-x-server/">Configuring RADIUS support for Bugzilla</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2009/09/30/installing-bugzilla-on-mac-os-x-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Refining Search Traffic with Robots.txt</title>
		<link>http://wiki.springsurprise.com/2009/07/13/refining-search-traffic-with-robots-txt/</link>
		<comments>http://wiki.springsurprise.com/2009/07/13/refining-search-traffic-with-robots-txt/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 17:29:24 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=94</guid>
		<description><![CDATA[Background The robots.txt file provides guidance to the search agents (from Google, Yahoo, MSN, etc.) on how to search your web site.  Well-behaving search agents (aka &#8220;bots&#8221;, &#8220;crawlers&#8221;, or &#8220;spiders&#8221;) look for a robots.txt file in the root directory of &#8230; <a href="http://wiki.springsurprise.com/2009/07/13/refining-search-traffic-with-robots-txt/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>The <code>robots.txt</code> file provides guidance to the search agents (from Google, Yahoo, MSN, etc.) on how to search your web site.  Well-behaving search agents (aka &#8220;bots&#8221;, &#8220;crawlers&#8221;, or &#8220;spiders&#8221;) look for a <code>robots.txt</code> file in the root directory of the web site in order to determine permissions, restrictions, or hints for properly crawling and indexing the site.  <em>Observance of the controls expressed in a robots.txt file is strictly voluntary on the part of the search agents and is <strong>not</strong> a substitution  for appropriate security measures on any sensitive information.</em></p>
<p>The <code>robots.txt</code> file is intended to be read and processed only by the automated search agents.  The rules expressed in the file do not apply to users visiting the site with a typical web browser (e.g. Internet Explorer, FireFox, Safari, etc.).</p>
<h3>File Format</h3>
<p>The format of a <code>robots.txt</code> file consists of a minimum of one <strong>record</strong>.  Each record consists of a series of <strong>directives </strong>with one or more User-agent directives followed by one or more Disallow directives.  There can be only one directive specified per line, and it should be in the format of &lt;<code>directive</code>&gt;<code>:</code> &lt;<code>value</code>&gt;.  Comments are specified by a leading &#8220;#&#8221; character.</p>
<p>While there are a number of other possible directives that can be specified within a record, the minimum required are a User-agent and a Disallow directive.</p>
<h3>Location</h3>
<p>The search agent looks for the <code>robots.txt</code> file at the root of the web site.  If the server is running more than one site, then one file should be created for each site.  The exact location may vary depending on the site configuration, but this can be checked in the <strong>Server Admin</strong> application.  (Select the &#8220;Web&#8221; service, click on the &#8220;Sites&#8221; icon, and note the &#8220;Web Folder&#8221; value for each Domain Name.)</p>
<h3><strong>Basic Directives</strong></h3>
<h4>User-agent</h4>
<p>The User-agent directive consists of either the name of a search agent or the wildcard character (&#8220;*&#8221;).  The wildcard character indicates the rule set applies to all search agents and can only be specified once in the robots.txt file.</p>
<h4>Disallow</h4>
<p>The Disallow directive follows the User-agent directive and specifies a path (either partial or full) that should not be accessed by the search agent.  Multiple paths may be specified by using multiple Disallow directives within a record.  Multiple paths should <em>not</em> be specified within a single Disallow directive.  The value of the directive may be left blank to indicate there are no agent restrictions.</p>
<h3>Additional Directives</h3>
<p>There are a number of additional directives that may be specified in a record, but not all of them are recognized by the various search agents.  The only directives that seem to be universally parsed are the basic directives &#8212; User-agent and Disallow.</p>
<h4>Crawl-delay</h4>
<p>The Crawl-delay directive specifies a delay (in seconds) between requests by a search agent.  The delay can be used to help prevent an aggressive search agent from overloading the site by issuing requests too rapidly.</p>
<h4>Visit-time</h4>
<p>The Visit-time directive specifies the acceptable time range for a search agent to crawl the site.  This can be used to defer any search traffic that might otherwise occur during peak traffic times.  The times specified are in 24 hour (military) format and are based on GMT.  (e.g. &#8220;2200-0530&#8243; would advise search agents to crawl the site from 10:00pm to 5:30am GMT.)</p>
<h4>Request-rate</h4>
<p>The Request-rate directive is similar in effect to the Crawl-delay directive however instead of specifying an absolute time between requests a rate is used.  For example, a rate of 1/30 indicates a maximum of 1 request should be issued every 30 seconds.  In addition, time of day restrictions can also be specified which can be used to provide a more flexible policy with different rates for different times of day.</p>
<h4>Comment</h4>
<p>The Comment directive can be used instead of the comment delimiter (&#8220;#&#8221;).  The Comment directive is intended to be returned to the administrator of the search agent and should contain a statement of the site&#8217;s crawl policy.</p>
<h4>Allow</h4>
<p>The Allow directive provides an exception into an otherwise disallowed area of the site.  This may provide a means whereby a search agent can bypass restrictions in order to access deeply-nested content.</p>
<h4>Robot-version</h4>
<p>The Robot-version directive specifies which version of the Robot Exclusion Standard the rule set observes.  It is intended primarily for site documentation purposes.</p>
<h3>Examples</h3>
<h4>Open Access</h4>
<p>The wildcard User-agent indicates the record applies to all search agents and the blank Disallow value means there are no restrictions.</p>
<p><code>User-agent: *<br />
Disallow:</code></p>
<h4>Blocked Access</h4>
<p>The wildcard User-agent indicates the record applies to all search agents and the specification of the root directory (&#8220;/&#8221;) restricts the search agent from all content.</p>
<p><code>User-agent: *<br />
Disallow: /</code></p>
<h4>Multiple Restrictions</h4>
<p>The wildcard User-agent indicates the record applies to all search agents and the Disallow directives restrict the search agents from content in the <code>/doc/private</code> and <code>/cgi-bin</code> directories.</p>
<p><code>User-agent: *<br />
Disallow: /doc/private<br />
Disallow: /cgi-bin</code></p>
<h4>Timed Access</h4>
<p>The wildcard User-agent indicates the record applies to all search agents and the Disallow directive restricts the search agents from content in the <code>/doc/private</code> directory.  The Visit-time directive advises the search agent to only attempt to crawl the site betwen 11:00pm and 4:30am (GMT).</p>
<p><code>User-agent: *<br />
Disallow: /doc/private<br />
Visit-time: 2300-0430</code></p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2009/07/13/refining-search-traffic-with-robots-txt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Working Around ISP Mail Server Blocks</title>
		<link>http://wiki.springsurprise.com/2009/07/10/working-around-isp-mail-server-blocks/</link>
		<comments>http://wiki.springsurprise.com/2009/07/10/working-around-isp-mail-server-blocks/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 19:54:53 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Server Solutions]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://wiki.springsurprise.com/?p=82</guid>
		<description><![CDATA[Background It is a common practice for many ISP&#8217;s to place restrictions on the sending and receiving of mail in order to reduce the potential for abuse by spammers.  For the typical home user, these restrictions are non-intrusive and are &#8230; <a href="http://wiki.springsurprise.com/2009/07/10/working-around-isp-mail-server-blocks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>It is a common practice for many ISP&#8217;s to place restrictions on the sending and receiving of mail in order to reduce the potential for abuse by spammers.  For the typical home user, these restrictions are non-intrusive and are effective in preventing gratuitous abuse of the mail systems.  However, for users running their own mail server, these restrictions interfere with the proper operation of the service.</p>
<p>The origin for the restrictions began when spammers began directly injecting their email into the ISP&#8217;s mail relay servers for distribution.  This activity caused massive headaches for the ISP, as server utilization soared, bandwidth costs increased, and they would receive a torrent of angry calls from other ISPs for relaying so much spam.  The solution was to impose access restrictions on the mail relay servers so that only authenticated users from within the ISP&#8217;s network would be able to access them.  While effective in protecting the ISP&#8217;s mail relay servers, the tactics of the spammers shifted to work around this obstacle.</p>
<p>With direct access to the mail relay servers of the ISP blocked, hackers turned to using the large <a href="http://en.wikipedia.org/wiki/Botnet" target="_blank"><strong>BotNets</strong></a> of <a href="http://en.wikipedia.org/wiki/Zombie_co mputer" target="_blank"><strong>Zombie Computers</strong></a>.  These compromised systems were used by the hackers to run their own mail relay servers and so the spam continued to flood the mail systems.  In order to reduce the effectiveness of this strategy, the ISPs  blocked all traffic for port 25 (the standard communication port for mail relay service) to their customers&#8217; systems.  This prevented these systems from proxying spam throughout the email delivery systems.</p>
<p>In order to run a mail server, the restrictions imposed by the ISP must be overcome.  In some cases, simply contacting the customer support of the ISP can result in a lifting of the restrictions on the connection.  However, some ISPs do not have a flexible policy in place for customers wishing to run their own mail servers and so extra effort must be made in order to work around the situation.  Typically, there are two main blocks that must be overcome for mail service to be fully functional:  <strong>inbound blocking</strong> and <strong>outbound blocking</strong>.  The majority of ISPs implement both types of blocks, but occasionally only one or the other form of blocking is implemented.</p>
<h3>Service Requirements</h3>
<p>In order to work around the inbound or outbound blocks imposed by the ISP, an additional service provider must be used.  <a href="http://www.dyndns.com/" target="_blank">DynDNS.com</a> offers several services that can be used to work around the ISP restrictions.  There are several other service providers that may have similar offerings, so you may wish to shop around.</p>
<p>The <a href="http://www.dyndns.com/services/mailhop/relay.html" target="_blank">MailHop Relay</a> service offers the ability to redirect incoming mail from the standard mail relay port (port 25) to an alternate port which is not blocked.  In addition, it provides a number of other benefits including:  spam filtering, white-listing, black-listing, virus scanning, and back-up queueing (which safely stores any incoming mail if your mail server should be temporarily unavailable).</p>
<p>The <a href="http://www.dyndns.com/services/mailhop/outbound.html" target="_blank">MailHop Outbound</a> service offers the ability to bypass any outbound restrictions your ISP may have in place.  It is able to accept mail destined for other domains on an alternate port and so avoid a block placed on the standard mail relay port.  In addition, it offers a secure, authenticated mail relay connection (via SSL), the ability to send mail from any network, outgoing virus scanning, and detailed usage graphs.</p>
<h3>Inbound Blocking</h3>
<p>Inbound blocking prevents <em>other</em> mail servers from relaying mail to <em>your</em> mail server.  This means that mail which originates from another domain will not be able to be delivered to your email system.  Mail which originates from within your domain will not be affected by this type of restriction.  The MailHop Relay service offered by DynDNS is able to work around this restriction by accepting mail on behalf of your domain and then relaying it to your domain on an alternate port.</p>
<ol>
<li>Subscribe to and setup the MailHop Relay service on the DynDNS site.
<ol>
<li>Specify the destination mail server (e.g. example.com)</li>
<li>Specify the alternate relay port (e.g. 10025)</li>
<li>Enable any additional services desired (spam checking, virus scanning, etc.)</li>
<li>Ensure the Mail Exchange (MX) Records are setup correctly for the domain</li>
</ol>
</li>
<li>Create a port-forwarding rule on your gateway device to forward incoming connections from the alternate relay port specified (e.g. 10025) to the local mail server and standard mail relay port (e.g. mail.example.com, port 25).
<pre>Protocol   External Port    Destination Address    Destination Port
   TCP         10025          mail.example.com            25</pre>
</li>
<li>Verify inbound mail service is working properly by using Yahoo Mail to send a message to a test account in your domain.  It may take a few minutes for the DNS changes to propagate fully, so be patient if the mail does not appear quickly.</li>
</ol>
<h3>Outbound Blocking</h3>
<p>Outbound blocking prevents mail originating from <em>your</em> server from being relayed to any <em>other</em> mail server.  Mail sent from within the domain to other members within the domain will not be affected.  The MailHop Outbound service offered by DynDNS is able to work around this restriction by accepting mail originating from your domain on an alternate port and then forwarding it on to the destination mail servers.</p>
<ol>
<li>Subscribe to the MailHop Outbound service on the DynDNS site.</li>
<li>Open the <strong>Server Admin</strong> application and connect to the server hosting the mail service.</li>
<li>Select the <strong>Mail</strong> service from the list of available services.</li>
<li>Click on the &#8220;Settings&#8221; icon and select the &#8220;General&#8221; tab.</li>
<li>Enable the &#8220;Relay outgoing mail through host&#8221; option.</li>
<li>Enter the MailHop Outbound server address and port.
<pre>outbound.mailhop.org:10025</pre>
</li>
<li>Enable the &#8220;Authenticate to relay with user name&#8221; option.</li>
<li>Enter the account name and password <em>for your DynDNS account</em> in the appropriate fields.</li>
<li>Restart the Mail service.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://wiki.springsurprise.com/2009/07/10/working-around-isp-mail-server-blocks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

