<?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>Musings of an Apple Systems Administrator</title>
	<atom:link href="http://www.jonsblog.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonsblog.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 01 Aug 2010 05:56:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>10.6.4 Group Calendars in iCal officially supported</title>
		<link>http://www.jonsblog.org/2010/07/24/10-6-4-group-calendars-in-ical-officially-supported/</link>
		<comments>http://www.jonsblog.org/2010/07/24/10-6-4-group-calendars-in-ical-officially-supported/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 22:07:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wiki Server]]></category>
		<category><![CDATA[group calendars]]></category>
		<category><![CDATA[iCal]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=182</guid>
		<description><![CDATA[Group calendars in Apples Wiki Server has been an uncomfortable conversation piece among 10.4, 10.5 and 10.6 Apple Systems Administrators. Ever since Apple has given us the ability to use web based group calendars its been a cat and mouse game to get some level of support in iCal. In 10.4 when these calendars first [...]]]></description>
			<content:encoded><![CDATA[<p>Group calendars in Apples Wiki Server has been an uncomfortable conversation piece among 10.4, 10.5 and 10.6 Apple Systems Administrators. Ever since Apple has given us the ability to use web based group calendars its been a cat and mouse game to get some level of support in iCal. In 10.4 when these calendars first came out it was a very cool idea give users their own calendars and give them a web interface to use it. Allow them to subscribe to their calendars in iCal which allowed the user read only access to their calendar.</p>
<p>When 10.5 server came out not only were there personal calendars but group calendars. The difference was that the personal calendars allowed the user to fully manage their calendar both on the web and in iCal however Apple still maintained that group calendars would be only subscribe-able in iCal. The difference here was that many users found workarounds that allowed the fully managed solution of group calendars in iCal by using the following methods.</p>
<p>Method A: Creating a user account and changing the server path with the &#8220;groups&#8221; variable. (<a href="http://www.macosxhints.com/article.php?story=20080410162942908">Solution</a>)</p>
<p>Method B: Creating a user account and changing the server path with the &#8220;wikis&#8221; variable. (<a href="http://discussions.apple.com/message.jspa?messageID=10132577#10132577">Solution</a>)</p>
<p>This worked but much needed security updates broke both of these solutions causing unnecessary stress on the Apple user and the Apple systems administrator. The most <a href="http://lists.apple.com/archives/rockies-edu/2010/Jun/msg00039.html">recant update</a> to 10.6.4 caused the group calendars in iCal to stop working entirely and cause an almost never-ending string <span id="more-182"></span>of login failed errors on the users computer. This made it very frustrating for Administrators who are trying to sell the idea of a wiki server as being a great web based and iCal based interface for users. In Apples defense they never officially claimed to support group calendaring in iCal.</p>
<p>One of the reasons for this was probably because of the volatile nature of the group account. In 10.5 server group calendars were maintained and created using workgroup manager in 10.6 server they were separated entirely and now the administration of group wikis is all done through their web interface. Due to the separation groups that once had a unique UID, username and password were demoted to the basic functionality of a web folder and directory for the purpose of internet data organization.</p>
<p>With this in mind I was very pleased when Apple released its <a href="http://support.apple.com/kb/DL1062">10.6.4 Wiki Server update</a>. The thing that really made me happy was the fact that now they have officially come out and are supporting group calendars in iCal. This is awesome finally what we have been waiting for. The best thing is that in true Apple fashion their update offers an elegant and much faster solution.</p>
<p>So how do you setup group calendars in 10.6.4? The answer is not really surprising as it takes some of the steps used in previous solutions.</p>
<div id="_mcePaste">In order to view the group calendars, open iCal, open its Preferences, and click on the Accounts tab.</div>
<div id="_mcePaste">
<ol>
<li>There you will create an account by hitting the &#8220;+&#8221; sign.</li>
<li>Choose automatic enter the full account name and or email address that has access to the group calendar in question. Enter the users password.</li>
</ol>
</div>
<div>iCal will contact the server and if the user is found an account will be setup. Once it is setup follow these steps.</div>
<div id="_mcePaste">
<ol>
<li>Click on the server settings tab. The server path URL here is what needs to be modified.</li>
<li>By default the path will look like this /principals/__uids__/USERID/ change the path to this /principals/__uids__/wiki-nameofgroupcalendarhere/</li>
<li>Go back to the account information tab and re-enter the users password.</li>
<li>Change the calendar description.</li>
<li>Close the preferences window, once done the calendar will refresh itself it may take some time. You can speed up the process by quitting iCal and re-launching.</li>
</ol>
</div>
<p>Oddly enough this solution was and should be credited to a <a href="http://discussions.apple.com/thread.jspa?threadID=2140008&amp;tstart=0">user on this post </a>who had originally tried to get group calendars in iCal working in 2009! Looks like Apple took some much needed advice in this arena and I am very happy that they have officially started supporting this much needed feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/07/24/10-6-4-group-calendars-in-ical-officially-supported/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Mobile Access Server</title>
		<link>http://www.jonsblog.org/2010/07/13/understanding-mobile-access-server/</link>
		<comments>http://www.jonsblog.org/2010/07/13/understanding-mobile-access-server/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 02:23:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[mobile access]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=167</guid>
		<description><![CDATA[Well if you were like me you were thrilled about the idea of Apples new Snow Leopard Server feature Mobile Access server. So great what is it, what does it do? Well it keeps your private web, ical and mail data secure without the use of a VPN and its really easy to setup. Great [...]]]></description>
			<content:encoded><![CDATA[<p>Well if you were like me you were thrilled about the idea of Apples new Snow Leopard Server feature Mobile Access server. So great what is it, what does it do? Well it keeps your private web, ical and mail data secure without the use of a VPN and its really easy to setup. Great I was sold, and I started down the path of figuring out the Mobile Access Server. The more I got down into the nitty gritty of the setup the more I realized just what a 1.0 feature this really is. After some trial and error I decided to share my experience with others in the hopes of fully Understanding the Mobile Access Server.</p>
<p>Alright first thing you have to understand put aside any notion of running mobile access server on any other server you may already have. Mobile access server is meant to run on a gateway server. A gateway server is a server that routes traffic to multiple destinations. Meaning its a stand alone server whose primary function is to keep your private data private.It translates public requests and serves up private content. You must run mobile access server on a separate server from the servers which contain your private data.</p>
<p>The second mental hurdle to get over is that yes, the gateway server or your mobile access server must be on the same subnet as the other private servers for which public requests will be relayed. The server has to have some sort of direct line of communication to the private server or servers in question. The next hurdle is DNS, yes DNS can be a huge headache but here are a few things to understand. <span id="more-167"></span>The Public DNS that will be routed through the gateway server should point to the gateway server.</p>
<p>The gateway server in turn should be able to resolve all of those DNS names into private IP addresses meaning you must have internal DNS setup with the appropriate zones and records. I learned this the hard way, the Mobile Access service looks to internal DNS do not point to an external private DNS server for internal DNS it must be running on the same server as the Mobile Access service.</p>
<p>The last hurdle is this once DNS is setup and the service is started and you feel like you have configured everything correctly and when your so exhausted and you go to try your Mobile Access server settings and they do not work the first time, do not be surprised as I said this is a very 1.0 feature. Be prepared to check, and re-check your settings. Be prepared to start and stop DNS multiple times. Mobile Access server is a great service and works great once configured correctly.</p>
<p>I am now open to field questions you may have reagarding setup or ideas for further posts to explain in more detail. I hope this at least clears up some of the misconceptions that I had with the service for you ahead of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/07/13/understanding-mobile-access-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>III Syncing a failover website : Scheduling the sync</title>
		<link>http://www.jonsblog.org/2010/05/31/iii-syncing-a-failover-website-scheduling-the-sync/</link>
		<comments>http://www.jonsblog.org/2010/05/31/iii-syncing-a-failover-website-scheduling-the-sync/#comments</comments>
		<pubDate>Mon, 31 May 2010 22:29:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cronjob]]></category>
		<category><![CDATA[schedule]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=147</guid>
		<description><![CDATA[So now we have our backup script, we have our secure SSH tunnel between the two servers and we have successfully synced our two databases and our files. Now we just have to schedule this task so that we do not have to manually run this each time we need to synchronize our systems. On [...]]]></description>
			<content:encoded><![CDATA[<p>So now we have our backup script, we have our secure SSH tunnel between the two servers and we have successfully synced our two databases and our files. Now we just have to schedule this task so that we do not have to manually run this each time we need to synchronize our systems. On Mac OSX Servers you have two options you can use Crontab and run a Cronjob, or you can use Launchd. If your running a Linux server then your pretty limited to just a Cronjob. We will talk about both types of scheduling methods and which one makes the best sense for your setup. </p>
<p>Crontab is one of the longest lasting scheduling daemons around, its part of any linux / unix system and uses a file that will trigger a script at a specific time at specific intervals. Cron can be pretty amazing but pretty daunting too if you are unsure about how to use cron, I recommend starting out easy and using this GUI for Mac OSX called <a href="http://code.google.com/p/cronnix/">Cronnix</a>.</p>
<p><a href="http://code.google.com/p/cronnix/">Cronnix</a> is a great tool because it lets you modify, save and create crontab cronjobs in a very easy to use interface. Before <a href="http://code.google.com/p/cronnix/">Cronnix</a> you basically had to use the VI editor in order to edit the crontab file manually which did not always prove successful. Once your ready to make your first schedule then you need to know what time or at what intervals you want the backup to run. I had my backup script run at midnight every-night so my crontab looked like this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>my<span style="color: #000000; font-weight: bold;">/</span>sync<span style="color: #000000; font-weight: bold;">/</span>script.sh</pre></td></tr></table></div>

<p><span id="more-147"></span><br />
Here are some other popular crontab examples that might give you some greater insight and understanding on the whole cronjob scheduling schema.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span>          <span style="color: #660033;">--</span> midnight every day
<span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">1</span>-<span style="color: #000000;">5</span>        <span style="color: #660033;">--</span> midnight every weekday
<span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">15</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span>       <span style="color: #660033;">--</span> midnight on 1st and 15th
                      of month
<span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">5</span>          <span style="color: #660033;">--</span> midnight on 1st of month
                      and every Friday</pre></td></tr></table></div>

<p>The second method for scheduling tasks on a Mac OSX Server platform is Launcd. This is the timer system that Apple has written and sanctioned as being the best way to schedule tasks, the reason is that unlike a cronjob where if you want to pause the job, you must remove it from the system entirely and then re-enter it when you want it to resume. With launchd you can unload / or load schedules to run at startup or on regularly scheduled intervals. I would be lying if I told you I was a launchd master, but I do like the advantages that launchd has to offer. </p>
<p>While getting my script up and running I used <a href="http://www.macresearch.org/tutorial_backups_with_launchd">This tutorial</a> to get me started. The launchd file below is what I used in order to get my backup scheduled. In order to install your launchd file place it in one of these locations.</p>
<p>/System/Library/LaunchDaemons (admin level system daemons)<br />
/System/Library/LaunchAgents (admin level user agents)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span> ? xml <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #007800;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> ? <span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;!</span>DOCTYPE plist PUBLIC <span style="color: #ff0000;">&quot;-//Apple Computer//DTD PLIST 1.0//EN&quot;</span> \ <span style="color: #ff0000;">&quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Label<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>com.macresearch.backup<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>LowPriorityIO<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>true<span style="color: #000000; font-weight: bold;">/&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Program<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;/</span>Users<span style="color: #000000; font-weight: bold;">/</span>gohara<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Scripts<span style="color: #000000; font-weight: bold;">/</span>backup.sh<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>ProgramArguments<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>array<span style="color: #000000; font-weight: bold;">&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>backup.sh<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;/</span>array<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>WatchPaths<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>array<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;/</span>Volumes<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;/</span>array<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>plist<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Once you have your launchd file installed you must register the launchd file with your system by running</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">  launchctl load ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchAgents</pre></td></tr></table></div>

<p>Then issue</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"> launchctl list</pre></td></tr></table></div>

<p>Then you should see something like this</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Voyager:~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Scripts<span style="color: #7a0874; font-weight: bold;">&#93;</span> gohara<span style="color: #000000; font-weight: bold;">%</span> launchctl list
com.macresearch.backup</pre></td></tr></table></div>

<p>for my sync script I chose to use a crontab, because my knowledge of launchd is limited and my experience with cronjobs is more extensive I found that adding a cronjob was faster, quicker and more efficient for permanent scheduled items on my servers. I would love to get your feedback however and learn more about launchd from you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/05/31/iii-syncing-a-failover-website-scheduling-the-sync/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>II Syncing a failover website : The Sync script</title>
		<link>http://www.jonsblog.org/2010/05/22/syncing-a-failover-website-the-sync-script/</link>
		<comments>http://www.jonsblog.org/2010/05/22/syncing-a-failover-website-the-sync-script/#comments</comments>
		<pubDate>Sat, 22 May 2010 18:41:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[bash script]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=134</guid>
		<description><![CDATA[In this article we are picking up where we left off, we now have the ability to connect from our primary server to our secondary server without the need to enter a password with the help of a secret key. If you are lost at this point please refer to the last article Syncing a [...]]]></description>
			<content:encoded><![CDATA[<p>In this article we are picking up where we left off, we now have the ability to connect from our primary server to our secondary server without the need to enter a password with the help of a secret key. If you are lost at this point please refer to the last article <a href="http://www.jonsblog.org/2010/03/12/creating-an-ssh-key-for-secure-development">Syncing a failover website : Creating an SSH key</a>. At this point all we need to do is setup the bash script. We will create the script to log all of its activity so that we know if the process is having problems. The log file will be kept in a directory on the primary server. You will need to know the absolute path to this file and the file must be writable and readable by the system, so a chmod of 755 or 777 should do the trick.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Sync started <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Sync_log.txt
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Now starting rsync&quot;</span></pre></div></div>

<p>At this point we are ready for the sync to start, we will start by syncing the files from the primary server to the secondary server. This is a one way sync, whatever we add to the primary server will be copied over to the secondary server. Whatever is deleted from the primary server will also be deleted from the secondary server we accomplish this via the use of rsync. <span id="more-134"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-avz</span> <span style="color: #660033;">--delete</span> <span style="color: #ff0000;">&quot;/Volumes/PrimaryWebsite/&quot;</span> <span style="color: #660033;">--rsh</span>=<span style="color: #ff0000;">'ssh -p8286'</span> username<span style="color: #000000; font-weight: bold;">@</span>XX.18.XX.22:www<span style="color: #000000; font-weight: bold;">/</span>domains<span style="color: #000000; font-weight: bold;">/</span>SecondaryWebsite</pre></div></div>

<p>Notice that the first line is the path to our primary website, the second value is the port number that you use to ssh into your secondary server if they require that. The third option is the username and the ip address or hostname of the secondary server and then the path to the files on the secondary server. Again in order for this to work you really have to have completed the first step if this is not working refer back to the article that covers the appropriate way to ssh into your remote server <a href="http://www.jonsblog.org/2010/03/12/creating-an-ssh-key-for-secure-development">Syncing a failover website : Creating an SSH key</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Now starting modifications&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-oPort</span>=<span style="color: #000000;">8286</span> <span style="color: #ff0000;">&quot;/Volumes/modifications/wp-config.php&quot;</span> username<span style="color: #000000; font-weight: bold;">@</span>XX.18.XX.22:www<span style="color: #000000; font-weight: bold;">/</span>domains<span style="color: #000000; font-weight: bold;">/</span>SecondaryWebsite</pre></div></div>

<p>What we are doing above is copying a modified version of the wp-config.php file because we use wordpress installations as our main CMS platform, the configuration settings on the primary server will not always match exactly the configuration settings on your secondary server. Which means that if you failover and the settings on the secondary server are the ones from your first server, and the secondary server uses a different database prefix, username or password the failover will succeed but it will failover to a website that will give you the dreaded &#8220;Cannot connect to database&#8221; error.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Now starting database sync&quot;</span>
&nbsp;
mysqldump <span style="color: #660033;">--user</span>=primarymysqlusername <span style="color: #660033;">--password</span>=primarymysqlpassword primarydatabasename <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> secondarysshusername<span style="color: #000000; font-weight: bold;">@</span>XX.18.XX.22 <span style="color: #660033;">-p8286</span> mysql <span style="color: #660033;">--user</span>= secondarymysqlusername <span style="color: #660033;">--password</span>= secondarymysqlpassword secondarydatabasename
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Sync finished <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Sync_log.txt</pre></div></div>

<p>The above code, will allow you to sync your database with the database in your secondary location. You will need to modify the settings to match your primary username and password for mysql. Your secondary username and passwords for mysql and the primary and secondary database names in mysql. What this does is it empties the target database and then it re-imports all the content from your primary server. Then it logs a line in the log, stating when it has completed. Here is what the finished script looks like.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Sync started <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Sync_log.txt
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Now starting rsync&quot;</span>
&nbsp;
rsync <span style="color: #660033;">-avz</span> <span style="color: #660033;">--delete</span> <span style="color: #ff0000;">&quot;/Volumes/PrimaryWebsite/&quot;</span> <span style="color: #660033;">--rsh</span>=<span style="color: #ff0000;">'ssh -p8286'</span> username<span style="color: #000000; font-weight: bold;">@</span>XX.18.XX.22:www<span style="color: #000000; font-weight: bold;">/</span>domains<span style="color: #000000; font-weight: bold;">/</span>SecondaryWebsite
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Now starting modifications&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-oPort</span>=<span style="color: #000000;">8286</span> <span style="color: #ff0000;">&quot;/Volumes/modifications/wp-config.php&quot;</span> username<span style="color: #000000; font-weight: bold;">@</span>XX.18.XX.22:www<span style="color: #000000; font-weight: bold;">/</span>domains<span style="color: #000000; font-weight: bold;">/</span>SecondaryWebsite
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Now starting database sync&quot;</span>
&nbsp;
mysqldump <span style="color: #660033;">--user</span>=primarymysqlusername <span style="color: #660033;">--password</span>=primarymysqlpassword primarydatabasename <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> secondarysshusername<span style="color: #000000; font-weight: bold;">@</span>XX.18.XX.22 <span style="color: #660033;">-p8286</span> mysql <span style="color: #660033;">--user</span>= secondarymysqlusername <span style="color: #660033;">--password</span>= secondarymysqlpassword secondarydatabasename
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Sync finished <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Sync_log.txt</pre></div></div>

<p>Thats about it, in our next and final article on the topic of syncing multiple websites on multiple servers for failover purposes we will talk about the proper way to schedule your sync.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/05/22/syncing-a-failover-website-the-sync-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I Syncing a failover website : Creating an SSH key</title>
		<link>http://www.jonsblog.org/2010/03/12/creating-an-ssh-key-for-secure-development/</link>
		<comments>http://www.jonsblog.org/2010/03/12/creating-an-ssh-key-for-secure-development/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 18:09:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[ssh tunnel]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=104</guid>
		<description><![CDATA[Recently at our organization we were charged with the task of creating an auto failover solution for our websites. Basically the idea here is that we have our web server sitting in a data center but if for some reason the server were to ever go down then the website would fail over to a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at our organization we were charged with the task of creating an auto failover solution for our websites. Basically the idea here is that we have our web server sitting in a data center but if for some reason the server were to ever go down then the website would fail over to a second server where a duplicate of the website is waiting to be accessed in the event that the primary ever had an issue. This is doable but it requires that you have all your ducks in a row.</p>
<p>First, you must have DNS that can process a failover, you must have a script that will sync your files and your databases and most importantly of all you must have an open SSH tunnel between the two servers so that the sync can perform in a secure way without risk of any hacking happening. In this article I am going to outline the process of creating an ssh key for your second server, using terminal, and CPANEL. The failover hosting company we chose uses CPANEL and before we started we had to ask our host to enable jailed SSH access on our account in order to proceed.</p>
<p>Once enabled we must go through the process of creating a set of keys, a public key, and a private key. You must create the key on the computer that is considered to be the primary or the computer that will be running the sync script. Once your logged into that computer run these commands in terminal to create your private and public keys.<span id="more-104"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-b</span> <span style="color: #000000;">1024</span> <span style="color: #660033;">-t</span> dsa <span style="color: #660033;">-f</span> id_dsa <span style="color: #660033;">-P</span> <span style="color: #ff0000;">''</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">400</span> id_dsa</pre></div></div>

<p>Now in your ~/.ssh folder you should have an id_dsa file, an id_dsa.pub and a file called authorized_keys. The first file is your private key. The second file is your public key. The last file is a file that protects your primary server, meaning no one will be able to ssh into your primary server without the public or private keys as a form of authorization.</p>
<p>On the secondary server with CPANEL login to your control panel and choose SSH from the list of options. Once there, press the &#8220;Import Keys&#8221; button and you will see two fields one for a public key one for the private key. Copy and paste the contents of your private key id_dsa on your primary server into the private key field. Copy the contents of id_dsa.pub into the second field labeled public key. Name the key, in the top field and press save.</p>
<p>Now that you have the keys there, you must authorize the keys, once you have you will be able to ssh into your secondary server from your primary server without entering your password. Your host may have you connect to their ssh tunnel using a custom port, if this is the case then this is the syntax.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-p8569</span> username<span style="color: #000000; font-weight: bold;">@</span>host_name</pre></div></div>

<p>This will give you access to your account area, in our next article we will talk about how to create the sync script and sync your files, and databases over from the primary server to the secondary server on a scheduled basis.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/03/12/creating-an-ssh-key-for-secure-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Missing a file? Scrub that hard drive</title>
		<link>http://www.jonsblog.org/2010/01/29/missing-a-file-scrub-that-hard-drive/</link>
		<comments>http://www.jonsblog.org/2010/01/29/missing-a-file-scrub-that-hard-drive/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 20:48:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Data Recovery]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[missing]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=94</guid>
		<description><![CDATA[Today one of the most dreaded things happened to me, the phrase that makes every IT professional shudder. I can not find my file. Ok, after running through all of the basic questions and making sure that they saved it and that it was not accidentally deleted I decided to search their hard drive. After [...]]]></description>
			<content:encoded><![CDATA[<p>Today one of the most dreaded things happened to me, the phrase that makes every IT professional shudder. I can not find my file. Ok, after running through all of the basic questions and making sure that they saved it and that it was not accidentally deleted I decided to search their hard drive. </p>
<p>After many un-sucessfull attempts at using the search functionality (Spotlight), I decided to do some research on other methods for searching for files on the OSX platform. I came across the &#8220;locate&#8221; command for the Terminal.</p>
<p>I had never used this command before so I did some reading and I ran</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>locate.updatedb</pre></td></tr></table></div>

<p> this ran the initial database rebuild which added many new entries into its database. I then ran</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">locate</span> <span style="color: #ff0000;">'File Name here.txt'</span></pre></td></tr></table></div>

<p> and came up with a nice list  of files on the users computer, however the problem was that all of the files we found were older revisions of the file that he had lost. I decided that the only way we were going to find his file was to use a much more aggressive approach. </p>
<p>I decided to use the &#8220;find&#8221; command, this works similar to the &#8220;locate&#8221; command but it searches the folder, directory or <span id="more-94"></span>  entire volume that you want. It allows you to be as specific or as vague as you want as well. For example</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'filename.txt'</span></pre></td></tr></table></div>

<p>  will search the entire volume for a file with the name filename.txt. You can also search for wildcards as well</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.txt'</span></pre></td></tr></table></div>

<p> which will generate a list of all of the text files on the computer. Notice I used a period here instead of a slash, these are where you can customize the location of the search.</p>
<p>So I let this run, the &#8220;find&#8221; command is considerably slower than the &#8220;locate&#8221; command because it does not use a database rather it searches live through the hard drive on the system that you are using. After about 20 minutes letting it scan the entire hard drive, every user account and every directory we came up with a few more results but again nothing that had his new content. I was really hoping that at this point he had accidentally deleted it or something.</p>
<p>I decided to ask him for a phrase located in the text file that could be used as a search term. To search for a phrase in a text document in the terminal run</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.xlsx'</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-li</span> <span style="color: #ff0000;">'ethiopia'</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;</pre></td></tr></table></div>

<p> this will find any reference to the word ethiopia located in a Excel file. I let this run and again slow but effective it revealed more results but nothing. I explained to the gentleman that I could try looking at the tape backups but it would take me some time.  He asked me if I could do that.</p>
<p>It was a long walk back upstairs, I loaded the first tape into the drive and got ready. I began the search. Not 10 minutes later did I get a phone call back saying, that he had found the file on a thumb drive that he had. Go figure, turns out that no matter how many cool ways there are to search a hard drive none of them will index a thumb drive in someones pocket.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/29/missing-a-file-scrub-that-hard-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad The Good, The Bad, The Ugly&#8230;</title>
		<link>http://www.jonsblog.org/2010/01/29/ipad-the-good-the-bad-the-ugly/</link>
		<comments>http://www.jonsblog.org/2010/01/29/ipad-the-good-the-bad-the-ugly/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 01:40:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=82</guid>
		<description><![CDATA[The iPad was recently announced and it has gotten a lot of people talking. A lot of people looking back at the old Mac Tablet rumor sites and wishing it was what is isn&#8217;t an interactive Tablet Computer. However ever since I can remember no matter what the Apple product was as soon as it [...]]]></description>
			<content:encoded><![CDATA[<p>The iPad was recently announced and it has gotten a lot of people talking. A lot of people looking back at the old Mac Tablet rumor sites and wishing it was what is isn&#8217;t an interactive Tablet Computer. However ever since I can remember no matter what the Apple product was as soon as it was announced people immediately became vocal about what they felt was missing from their new device.</p>
<p>Comments like, the Apple TV should have included a Tuner and a DVR, or the Apple Hi-Fi should have been made as a more portable unit with more functionality.  I guess no matter what the product is there are two truths, it&#8217;s not meant to be a perfect product for everyone simply the masses and with every product no matter how intuitive or ingenious there is always room for improvement.  </p>
<p>The good thing about the iPad is that Apple has figured out another way to sell great content. The iPod  brought us the iTunes music store. The Apple TV brought us movies that we could rent. The iPhone brought us the App Store. Now the iPad brings yet another venue the iBook Store. Trying hard to compete with devices like the Kindle, Apple has staked claim on yet another content niche.</p>
<p>Soon enough there will be keynote presentations where Apple will claim that they are the largest Music, Video and Book content provider in the world and at that time the iPad will be more of a modern institution rather than a foreign entity.<span id="more-82"></span> So what you can do with the iPad, you can do many good things. Listen to music, watch videos, browse the internet, use apps, read books, play games and more. Could it do more? Sure, it could. Will it eventually? Sure it will.</p>
<p>The bad thing about the iPad is that it is not what everyone really wanted when they were first thinking about what this product would eventually be. Who knows, maybe there is a tablet computer rolling around in Job&#8217;s head. But for those of us, myself included who were hoping for a computer, <a href="http://usa.autodesk.com/adsk/servlet/pc/index?id=6848332&amp;siteID=123112" target="_blank">a graphics tablet</a>, a stylus interface, and a breakthrough in how we look at performing our day to day tasks, well we will have to keep dreaming, and hoping for the future. For some of us with the cash, we can live the dream now by getting the<a href="http://www.axiotron.com/index.php?id=modbook" target="_blank"> ModBook by Axiotron.</a> This device is what many Mac fans were expecting.</p>
<p>From the perspective of a systems administrator, this <em>could b</em><em>e</em> a technical and logistical nightmare when you consider people doing work on these on secured networks where encryption is important. From a hardware perspective if you ever had to perform your own battery replacement or even from the philosophical angle, is this a computer, or is it just a cool content viewer. If it is the later, then will or should IT Departments support such a device.</p>
<p>The Ugly thing that I believe is more of a philosophical debate is the slow agonizing death of the printed word in its truest format. While we all know Print Media is dying and we have known that for a long time, many will argue that bookstores and books are not going anywhere while that may be true I lived in a state recently and witnessed the death of its last newspaper.</p>
<p>Thats right, in the state of Maine every newspaper has gone out of business. I am not saying that the iPad is or will kill off traditional media or that it has but its just one device closer to its extinction. Perhaps I am just nostalgic for the days when I used to like to read the comics as a kid, getting them out of the middle of the sunday paper, was and always will be a special memory for me.</p>
<p>No matter what, side of the fence you land on, Apple has made a smart move by entering into this market. Apple is a company and I am sure they have a plan for everything that they do. They have methodically created each new device over the past 4 years and released each one with a new content store. Perhaps Apple is planning a takeover of all digital content, and its syndication rights. Only one man knows and it certainly is not me. For now I will just sit back and watch my Apple stock soar, thanks Steve.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/29/ipad-the-good-the-bad-the-ugly/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>10.6.2 Mail Server draws a blank, subject?</title>
		<link>http://www.jonsblog.org/2010/01/26/10-6-2-mail-server-draws-a-blank-subject/</link>
		<comments>http://www.jonsblog.org/2010/01/26/10-6-2-mail-server-draws-a-blank-subject/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 00:14:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[blank]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[subject]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=71</guid>
		<description><![CDATA[So we upgraded from 10.5.8 Mail server to 10.6.2 and everything went very smoothly. Mailstores were migrated and the transition from Cyrus to Dovecot was great. However once all the email was moved over and all the settings were double, and triple checked. People started complaining that every once in a while their email was [...]]]></description>
			<content:encoded><![CDATA[<p>So we upgraded from 10.5.8 Mail server to 10.6.2 and everything went very smoothly. Mailstores were migrated and the transition from Cyrus to Dovecot was great. However once all the email was moved over and all the settings were double, and triple checked. People started complaining that every once in a while their email was not getting through the server, it was getting bounced back to the sender. At first I thought that it was an internal issue with the users on our network, then I got a complaint from someone from outside the organization trying to send an email to one of our users.</p>
<p>Great, another strange Apple bug I thought until someone was able to forward me the bounced email to my personal email account. Further insight in the error showed that the message was getting bounced back due to a blank subject line.  As you can see from the example below its due to a blank or empty subject heading. Yes, apparently Apple has added this as an actual &#8220;Feature&#8221;. You can turn this off however by commenting out the only line of code in the file /etc/postfix/custom_header_checks.<br />
<span id="more-71"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">=====================================
This is the mail system at host mail.xxxxxxx.org.
&nbsp;
I<span style="color: #ff0000;">'m sorry to have to inform you that your message could not
be delivered to one or more recipients. It'</span>s attached below.
&nbsp;
For further assistance, please send mail to postmaster.
&nbsp;
If you <span style="color: #000000; font-weight: bold;">do</span> so, please include this problem report. You can
delete your own text from the attached returned message.
&nbsp;
The mail system
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>user<span style="color: #000000; font-weight: bold;">@</span>domain.org<span style="color: #000000; font-weight: bold;">&gt;</span>: host
mail.domain.org http:<span style="color: #000000; font-weight: bold;">//</span>xx.xxx.xxx.xxx said: <span style="color: #000000;">550</span> 5.7.1 empty subject
=====================================</pre></td></tr></table></div>

<p>Turn off the mail service before you do this. Once the mail service is off edit the file using sudo pico.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>^subject: <span style="color: #000000; font-weight: bold;">*</span>$<span style="color: #000000; font-weight: bold;">/</span> REJECT empty subject header <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
into:
&nbsp;
<span style="color: #666666; font-style: italic;">#/^subject: *$/ REJECT empty subject header in /etc/</span></pre></td></tr></table></div>

<p>Start mail back up again and you will notice that the blank subject line blues are gone away.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/26/10-6-2-mail-server-draws-a-blank-subject/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>10.6.2 Migrate Wiki Server &amp; DNS</title>
		<link>http://www.jonsblog.org/2010/01/25/10-6-2-migrate-dns-wiki-server/</link>
		<comments>http://www.jonsblog.org/2010/01/25/10-6-2-migrate-dns-wiki-server/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 12:08:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[DNS Settings]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[Wiki Server]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=63</guid>
		<description><![CDATA[While migrating our servers services from 10.5 to our 10.6.2 production server one of the easiest migrations that I had found was to migrate the 10.5 Wiki. Simply copying files and making sure that the permissions remain in tact are really all you need. However in 10.6.2 there is a detachment from the way you [...]]]></description>
			<content:encoded><![CDATA[<p>While migrating our servers services from 10.5 to our 10.6.2 production server one of the easiest migrations that I had found was to migrate the 10.5 Wiki. Simply copying files and making sure that the permissions remain in tact are really all you need. </p>
<p>However in 10.6.2 there is a detachment from the way you authenticate. You create access for each blog based on the settings in the web interface rather than in Workgroup Manager. This threw me off a bit the first time due to the fact that I had already had our previous wiki server split up into groups using workgroup manager. </p>
<p>Here is how I migrated our wiki, the default directory for wiki and blogs on 10.5 and 10.6 is</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Collaboration</pre></td></tr></table></div>

<p>Inside that folder, you’ll find a Groups folder of interest.  You’ll want to repeat the following procedure for each group:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> serveradmin stop teams
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">&lt;</span>Group Folder from Backup<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Collaboration<span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> _teamsserver:_teamsserver <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Collaboration<span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/&lt;</span>group_directory<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Collaboration<span style="color: #000000; font-weight: bold;">/</span>dataVersion.plist
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Collaboration<span style="color: #000000; font-weight: bold;">/</span>globalIndex.db
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Application Support<span style="color: #000000; font-weight: bold;">/</span>Apple<span style="color: #000000; font-weight: bold;">/</span>WikiServer<span style="color: #000000; font-weight: bold;">/</span>directoryIndex.db
<span style="color: #c20cb9; font-weight: bold;">sudo</span> serveradmin start teams</pre></td></tr></table></div>

<p><span id="more-63"></span><br />
Once you complete those steps, you’ll need to login as an administrator and set the permissions for the wiki(s).  10.6 removes the privileges for wikis from Workgroup Manager and instead allows for security management via the wiki web interface.</p>
<p>Once we were done with the wiki, we had to migrate over DNS this was a little bit scary however retyping our DNS records was equally as scary. I decided to try to migrate the settings since it was sanctioned by Apple. </p>
<p>Basically the first step was to stop DNS service on your Snow Leopard server. I then created a backup of my DNS config files that lived on my Snow Leopard server in the event that everything went bad.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>dns; <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dns <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>named.conf <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>backupsdns</pre></td></tr></table></div>

<p>I then preceded to copy the following files and folders from Leopard server into the same locations on Snow Leopard Server</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dns
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>named.conf
<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>named</pre></td></tr></table></div>

<p>Once done start DNS via the command line on Snow Leopard server</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> serveradmin start dns</pre></td></tr></table></div>

<p>Next I urge you if you are going to try this test, test, test, test and test again. I got it almost 100% however there are a few fields in the DNS settings in Server Admin that do not exist in 10.5 Server. Also I did notice that it messed up my FQDN&#8217;s in some places. Tell me your migration headache story, or lack thereof.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/25/10-6-2-migrate-dns-wiki-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>10.6.2 Dovecot Mail Backups</title>
		<link>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/</link>
		<comments>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 00:08:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=33</guid>
		<description><![CDATA[Before migrating to 10.6 Server we were running our entire mailstore on the 10.5.8 platform. Say what you will about Leopard, once we had it set up correctly it ran fine. We migrated because of the greater benefits of Dovecot over Cyrus. Many of the other features intriqued us as well such as the improved [...]]]></description>
			<content:encoded><![CDATA[<p>Before migrating to 10.6 Server we were running our entire mailstore on the 10.5.8 platform. Say what you will about Leopard, once we had it set up correctly it ran fine. We migrated because of the greater benefits of Dovecot over Cyrus. Many of the other features intriqued us as well such as the improved Wiki server and iCal server. However we were really excited about Dovecots ability to repair itself basically doing away with the need to ever have to rebuild a users mailbox.</p>
<p>The one great thing about 10.5.8 was the development of <a href="http://osx.topicdesk.com/content/view/41/41/">Mailbfr</a> this was an amazing script that would help you backup your entire mailstore, recover email accounts, repair quotas, and of course rebuild or repair the entire mail-store. This was an invaluable tool, however since switching we have had to come up with our own solution.</p>
<p>We tried at first to get RSYNC running however this did not work because we did not have the permission to copy the mailstore with the permissions in tact. The reason is that while the root account does have access to look at the mailstore the secondary user on the mailstore folder is the mail user itself. Without running the script as each user then its near impossible to use RSYNC to move the mailstore or to even perform a simple backup.<span id="more-33"></span></p>
<p>Our solution was to create a backup script that use SCP with SCP we were able to move our mail-store to another drive on the server. It copies the store over and it resets the permissions to the administrator account. This solution works very well however after some time with a large mailstore you will run out of space on the target volume. Unlike RSYNC which uses hard links to save space SCP creates a new copy of the mailstore each time it is run.</p>
<p>In order to save space on the backup volume the oldest 2 weeks worth of backed up email gets dumped to DVD and removed from the drive on a monthly basis. This is fine but not optimal. Here is a copy of the script that we use on our server.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> backup started daily backup <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>EMAIL\ BACKUP<span style="color: #000000; font-weight: bold;">/</span>Backup<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Backup_log.txt
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>Mailstore-Location<span style="color: #000000; font-weight: bold;">/</span>spool <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>EMAIL\ BACKUP<span style="color: #000000; font-weight: bold;">/</span>Email-Backups<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #7a0874; font-weight: bold;">&#41;</span>-$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #7a0874; font-weight: bold;">&#41;</span>-$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>backup 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> backup daily backup completed <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>EMAIL\ BACKUP<span style="color: #000000; font-weight: bold;">/</span>Backup<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>Backup_log.txt</pre></td></tr></table></div>

<p>This will backup the mailstore and then log each time that it does so. To recover an email to the original mailstore is not as hard as it seems. Navigate to the backed up mailstore destination and match up the name of the folder to the users UID of which you want to recover. For example if the users UID is 7458-58713-952554-544226 then you would look for a folder with the same name. Once in the folder you can copy or look at individual email files. Find the ones or one that you need and copy it to the folder of the original mailstore. In order to do this you will have to use sudo. For example this is how you would restore the entire folder</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;Volumes/EMAIL\ BACKUP/Email-Backups/7458-58713-952554-544226/.*&quot;</span> <span style="color: #ff0000;">&quot;/Volumes/Mailstore-Location/spool/7458-58713-952554-544226/.*&quot;</span></pre></td></tr></table></div>

<p>Until <a href="http://osx.topicdesk.com/content/view/41/41/">Mailbfr</a> comes back for Dovecot this is how we are protecting ourself against the accidental loss of email. I am not saying that this is the best method it is simply the one we are using. If you have another solution that works bette than please let me know and share your own experience!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/24/10-6-2-dovecot-mail-backups/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
