<?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>Wed, 11 Jan 2012 19:33:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>10.7 Web Server Admin Alternatives</title>
		<link>http://www.jonsblog.org/2012/01/11/10-7-web-server-admin-alternatives/</link>
		<comments>http://www.jonsblog.org/2012/01/11/10-7-web-server-admin-alternatives/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 19:30:54 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Web Server]]></category>
		<category><![CDATA[musings]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=488</guid>
		<description><![CDATA[If you are using 10.7 server to administer any sort of website then you may have noticed that Apple has removed the bulk of the administration capabilities once found in the Server Admin app, and shifted a tiny fraction of that functionality to the Server app. Now one could speculate that if indeed Apple is shifting to a home server market, and it is currently frowned upon to run a robust website over a shared internet connection from ones living room that Apple may have done this to discourage users from using their new OS for that reason, however for those of us who need to run websites on 10.7 for our job or because we absolutely love OSX Servers then there are a few alternatives. ]]></description>
			<content:encoded><![CDATA[<p>If you are using 10.7 server to administer any sort of website then you may have noticed that Apple has removed the bulk of the administration capabilities once found in the Server Admin app, and shifted a tiny fraction of that functionality to the Server app. Now one could speculate that if indeed Apple is shifting to a home server market, and it is currently frowned upon to run a robust website over a shared internet connection from ones living room that Apple may have done this to discourage users from using their new OS for that reason, however for those of us who need to run websites on 10.7 for our job or because we absolutely love OSX Servers then there are a few alternatives.</p>
<p>I have been playing around with two pieces of software that promise to help bring back this lost functionality in an easy to use GUI tool and perhaps even restore a little sanity to running a website on Lion. The first application that I reviewed was called <a title="VirtualHostX" href="http://clickontyler.com/virtualhostx/" target="_blank">VirtualHostX</a>.</p>
<blockquote><p>VirtualHostX 3.0 is the easiest way to host and share multiple websites on your Mac. It&#8217;s the perfect solution for web designers working on more than one project at a time. (Aren&#8217;t we all?) No more nesting folders or asking the programmer across the cubicle for help. With VirtualHostX you can easily create and manage Apache virtual hosts with just a few clicks.</p></blockquote>
<p>The other feature that I love about this tool is that you can share a private webpage or site that you are working on, that is not publicly available and share it with anyone publicly through a secure password protected connection. This is great if you need to show people updates of your site and their not on the local subnet. This tool allows you to code custom directives (If you need a list you can check out my last post <a title="10.7 Server Web Administration: Missing Manual" href="http://www.jonsblog.org/2011/12/09/10-7-server-web-administration-missing-manual/">Missing Manual</a>). <span id="more-488"></span></p>
<p><img class="size-full wp-image-489 aligncenter" title="" src="http://www.jonsblog.org/wp-content/uploads/2012/01/vhx3-ss1.png" alt="" width="460" height="337" /></p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-491" title="vhx3-ss4" src="http://www.jonsblog.org/wp-content/uploads/2012/01/vhx3-ss4.png" alt="" width="460" height="347" /></p>
<p>Out of the box this product works with popular platforms like WordPress and it uses the built in Apache that comes with OSX. Alternatively you can even set it to manage any instance of apache on your server.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-490" title="vhx3-ss3" src="http://www.jonsblog.org/wp-content/uploads/2012/01/vhx3-ss3.png" alt="" width="444" height="260" /></p>
<p>Lastly you can even backup the changes that it makes to your system so that you can performa  seamless migration or just for your own peace of mind. I love this software and its an amazing alternative to using the Server app.</p>
<p>The other tool that I found that handles Apache administration on 10.7 is <a title="WebMon" href="http://cutedgesystems.com/software/WebMonForLion/" target="_blank">WebMon</a>. Webmon does not look as cool as VirtualHostX however it does have greater support for Custom Directives out of the box in the form of GUI interface.</p>
<blockquote><p>WebMon configures OS X&#8217;s built-in web server to support server-side includes, execCGI, PHP, SSL (including support for inserting Intermediate CA certs) and WebDAV, for multiple domains running on the same server.</p>
<p>With WebDAV turned on, your web server <a href="http://cutedgesystems.com/software/WebMonForLion/#iDisk">acts like an iDisk</a>, allowing you to connect to the WebDAV folder remotely, securely, and directly from the Finder, so you can save, share, and distribute your files and folders. You can also use the WebDAV folder to <a href="http://cutedgesystems.com/software/WebMonForLion/#iCal">share your iCal calendars</a>.</p>
<p>WebMon also helps you set up the web server so that you can <a href="http://cutedgesystems.com/software/WebMonForLion/#log">monitor its log file</a> from a remote machine. WebMon is able to help you monitor any number of web servers from a single remote machine.</p></blockquote>
<p>With WebMon you can setup and manage SSL Certificates, turn on CGI Support and much much more. This tool certainly restores almost all of the lost functionality . If you run multiple Web Servers than you might also like its built in monitoring service that makes sure that Apache is running soundly on other systems.</p>
<p>The great thing about both of these solutions is that they work well together, so you can use both or one of them but for the beginner web server administrator these tools restore a little more control when it comes to Apache administration.</p>
<p>I hope that you all found this article and walkthrough educational, as always please feel free to interact with me by posting questions and comments and I will answer them as best as I can. If you feel like any of this is wrong or could be improved upon also please leave a comment below, thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2012/01/11/10-7-web-server-admin-alternatives/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10.7 Server Web Administration: Missing Manual</title>
		<link>http://www.jonsblog.org/2011/12/09/10-7-server-web-administration-missing-manual/</link>
		<comments>http://www.jonsblog.org/2011/12/09/10-7-server-web-administration-missing-manual/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 00:44:04 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[10.7]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[OSX Lion]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=474</guid>
		<description><![CDATA[I just started using 10.7 Lion Server at my organization and I have to admit it is nice in some ways and infuriating in others. Apple has certainly fixed and introduced quite a few new features such as Profile Manager but have removed features like Mobile Access. The hardest hit service in my opinion when it comes to 10.7 server administration is the Web service. Apple has stripped this service completely out of the Server Admin app and has added a dumbed down version of the service to the Server app. If your unfamiliar the Server app is a program called "Server" that has the worst possible GUI interface and the least possible settings for all services that run through it which is a shame.]]></description>
			<content:encoded><![CDATA[<p>I just started using 10.7 Lion Server at my organization and I have to admit it is nice in some ways and infuriating in others. Apple has certainly fixed and introduced quite a few new features such as Profile Manager but have removed features like Mobile Access. The hardest hit service in my opinion when it comes to 10.7 server administration is the Web service. Apple has stripped this service completely out of the Server Admin app and has added a dumbed down version of the service to the Server app. If your unfamiliar the Server app is a program called &#8220;Server&#8221; that has the worst possible GUI interface and the least possible settings for all services that run through it which is a shame.</p>
<p>The purpose of this entry is to talk about 10.7 server and show you how to accomplish everything that you could accomplish from the Server Admin application through commands using terminal or edits to system files in the operating system. Everything below requires that you be logged in as the root user on the server in order to avoid permission issues.</p>
<p><strong>How to enable PHP </strong><br />
Run this command to check if PHP is enabled on 10.7 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;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd.conf<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> libphp5.so</pre></td></tr></table></div>

<p>If the output 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;">LoadModule php5_module libexec<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>libphp5.so</pre></td></tr></table></div>

<p>and not</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: #666666; font-style: italic;">#LoadModule php5_module libexec/apache2/libphp5.so</span></pre></td></tr></table></div>

<p>then PHP is enabled. If it is the other way around with a # in the beginning of the line you can just edit the httpd.conf file manually with <span id="more-474"></span></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> pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></td></tr></table></div>

<p>and remove the bracket manually and then restart the web server with</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> apachectl restart</pre></td></tr></table></div>

<p>Alternatively you can also enable this via a checkbox in the terrible server.app in 10.7.</p>
<p><strong>How to change the default file type </strong><br />
By default the landing page on all new sites is index.html if you would like to change this or the order in which a webpage searches for the index page then you need to change the default file type.</p>
<p>To do this edit the configuration file appropriate to your site name. Meaning you have to have already configured a site in the 10.7 server.app program once you have a site then you need to edit the site configuration file. If your site was called apple.com then your site configuration would be in /etc/apache2/sites/apple.com.conf or something like that.</p>
<p>You need to edit that file</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span>nameofyoursite.conf</pre></td></tr></table></div>

<p>look for the following in the file</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;">&lt;</span>IfModule mod_dir.c<span style="color: #000000; font-weight: bold;">&gt;</span>
    DirectoryIndex index.html
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>If you want to change the main page to index.php instead of index.html then replace index.html with index.php. If you want to add it as a secondary load page then you can change it to this.</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;">&lt;</span>IfModule mod_dir.c<span style="color: #000000; font-weight: bold;">&gt;</span>
    DirectoryIndex index.html index.php
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>once done save and restart apache.</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> apachectl restart</pre></td></tr></table></div>

<p><strong>How to enable .htaccess </strong><br />
If you are going to be using mod_rewwrite at all for redirects or pretty permalinks (which is very common now) then you need to have this enabled. Again as stated before you have to have a site setup on the server through the server.app program. Once done locate your configuration file as outlined above and make the following changes.</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span>nameofyoursite.conf</pre></td></tr></table></div>

<p>Once your in the file look for something that looks similar to the following.</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; font-weight: bold;">&lt;</span>Directory <span style="color: #ff0000;">&quot;/Users/yourname/Sites/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
     Options Indexes +MultiViews
     AllowOverride All
     Order allow,deny
     Allow from All
<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>It won&#8217;t look exactly the same but what you want to do is replace it with what you see above that will enable the .htaccess or mod_rewrite the line of code that actually does this is the &#8220;AllowOverride All&#8221; command. </p>
<p><strong>How to enable WebDav</strong><br />
To configure WebDAV Sharing for such users, follow these instructions before enabling any WebDAV share points.</p>
<p>Note: The instructions in this article include editing configuration files. You must have root access to edit these files. You should make a backup copy of each file prior to editing it.</p>
<p>This step is optional but highly recommended: Acquire and install a trusted SSL certificate, and use Server App to configure Web Service to use the certificate. You can use the server&#8217;s default, self-signed certificate for WebDAV Sharing, but iWork and other applications may warn that the certificate is &#8220;invalid&#8221;.</p>
<p>You need to edit the following configuration file</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd_webdavsharing.conf</pre></td></tr></table></div>

<p>Find the line &#8220;AuthType Digest&#8221; change Digest to Basic. This makes WebDAV Sharing use Basic authentication, which is required for Active Directory users.</p>
<p>Now edit this configuration file</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>webapps<span style="color: #000000; font-weight: bold;">/</span>com.apple.webapp.webdavsharing.plist</pre></td></tr></table></div>

<p>find these lines</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: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>sslPolicy<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>integer<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&lt;/</span>integer<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Change the 0 to 1. This makes WebDAV Sharing require SSL, which is the only secure way to use Basic authentication. Advise users to configure the iWork clients on their iOS devices with an &#8220;https&#8221; WebDAV URL, like: https://example.com/webdav</p>
<p><strong>How to enable the directory listing </strong><br />
Again as stated before you have to have a site setup on the server through the server.app program. Once done locate your configuration file as outlined above and make the following changes. </p>
<p>You need to edit that file</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span>nameofyoursite.conf</pre></td></tr></table></div>

<p>find the words &#8220;AllowOverride&#8221; in that block where these words are you need to add this line. This line may already be in your file but it may be different simply update it to reflect these changes</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;">Options <span style="color: #660033;">-Indexes</span> FollowSymLinks</pre></td></tr></table></div>

<p><strong>How to enable SSI</strong><br />
If you need to use Server Side Includes in your scripts or website files then do the following to enable it.</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> pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></td></tr></table></div>

<p>look for these lines</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: #666666; font-style: italic;"># AddType text/html .shtml</span>
<span style="color: #666666; font-style: italic;"># AddHandler server-parsed .shtml</span></pre></td></tr></table></div>

<p>Uncomment those 2 lines (remove the # in front of each of them). Now look in the same file for the following</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;">Options FollowSymLinks</pre></td></tr></table></div>

<p>Add &#8220;Includes&#8221; to the 2nd line so it looks like</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;">Options FollowSymLinks Includes</pre></td></tr></table></div>

<p>save the file and restart apache</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> apachectl restart</pre></td></tr></table></div>

<p><strong>How to enable VHOSTS</strong><br />
VHOSTS or Virtual Hosts enable you to have multiple domain names mapped to the same site or IP address. To enable this edit the httpd.conf file</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> pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></td></tr></table></div>

<p>find this line</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: #666666; font-style: italic;">#Include /private/etc/apache2/extra/httpd-vhosts.conf</span></pre></td></tr></table></div>

<p>change it to</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;">Include <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>extra<span style="color: #000000; font-weight: bold;">/</span>httpd-vhosts.conf</pre></td></tr></table></div>

<p>this will effectively enable VHOSTS. Now you should restart apache.</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> apachectl restart</pre></td></tr></table></div>

<p><strong>How to enable CGI</strong><br />
Again as stated before you have to have a site setup on the server through the server.app program. Once done locate your configuration file as outlined above and make the following changes.</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span>nameofyoursite.conf</pre></td></tr></table></div>

<p>Once your in the file look for something that looks similar to the following.</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;">     Options Indexes +MultiViews</pre></td></tr></table></div>

<p>It won&#8217;t look exactly the same but what need to do is add &#8220;-ExecCGI&#8221; after &#8220;+MultiViews&#8221; it should look something 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;">     Options Indexes +MultiViews <span style="color: #660033;">-ExecCGI</span></pre></td></tr></table></div>

<p>This will enable CGI and allow you to run CGI scripts in Apache. Now you should restart apache.</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> apachectl restart</pre></td></tr></table></div>

<p><strong>How to enable Logging</strong><br />
This one boggled my mind, by default website logging is not enabled and again there is no way to enable it in the GUI. You will want to have this enabled to catch errors and fix faulty code. To enable this again we are assuming you already have a site configured with the server.app program. Once done locate your configuration file as outlined above and make the following changes.</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span>nameofyoursite.conf</pre></td></tr></table></div>

<p>find the line &#8220;DocumentRoot&#8221;, Under that line paste the following</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;">CustomLog <span style="color: #ff0000;">&quot;/var/log/apache2/access_log&quot;</span> combinedvhost
ErrorLog <span style="color: #ff0000;">&quot;/var/log/apache2/error_log&quot;</span></pre></td></tr></table></div>

<p>it should now look like this</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;">DocumentRoot <span style="color: #ff0000;">&quot;/path/to/your/website/&quot;</span>
CustomLog <span style="color: #ff0000;">&quot;/var/log/apache2/access_log&quot;</span> combinedvhost
ErrorLog <span style="color: #ff0000;">&quot;/var/log/apache2/error_log&quot;</span></pre></td></tr></table></div>

<p>Now you should restart apache.</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> apachectl restart</pre></td></tr></table></div>

<p><strong>How to add a domain alias</strong><br />
This is a common thing that most web admins do to map domains to a single site. This again has been removed from the functionality of the server.app on 10.7 server but is a pretty easy to add. To enable this again we are assuming you already have a site configured with the server.app program. Once done locate your configuration file as outlined above and make the following changes.</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;">pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span>nameofyoursite.conf</pre></td></tr></table></div>

<p>in the site definition file, look for a line that says</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;">ServerName example.com
ServerAlias www.example.com</pre></td></tr></table></div>

<p>where example.com is the domain of your site. You can have more than one alias, just separate them by a spaces on the same line like so.</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;">ServerName example.com
ServerAlias www.example.com alias2.example.com alias3.example.com</pre></td></tr></table></div>

<p>Now you should restart apache.</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> apachectl restart</pre></td></tr></table></div>

<p><strong>How to restore factory settings to 10.7 Web Service</strong><br />
This one is important. As stated above you should be backing up these config files before you edit them and then making your changes. In the event that something went wrong you can always reset them back to the original settings. </p>
<p>Run this command</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 <span style="color: #7a0874; font-weight: bold;">command</span> web:<span style="color: #007800;">command</span>=restoreFactorySettings</pre></td></tr></table></div>

<p>I got this command by calling Apple directly they also suggested restarting the machine after the restore command, once the computer is back up turn off and then turn on web service to ensure it is working propperly.</p>
<p><strong>Conclusion</strong><br />
All of these commands allow you to leverage Apache and accomplish the tasks that were once easy to accomplish with the Server Admin tool in 10.6 server. There are two options here, learn to love the command line or do not upgrade to 10.7 Lion. Apple is streamlining their GUI interfaces for their tools however there is still power under the hood. Do not be afraid to re-configure these systems Apache, PHP and MYSQL can be installed, modified and improved all from the command line and in some cases they work better after you do. Its not time to quit in my opinion its time to roll up our sleeves and start learning the core of what makes an OSX server truly great and that starts with understanding the open source software that comes bundled with them.</p>
<p>I hope that you all found this article and walkthrough educational, as always please feel free to interact with me by posting questions and comments and I will answer them as best as I can. If you feel like any of this is wrong or could be improved upon also please leave a comment below, thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/12/09/10-7-server-web-administration-missing-manual/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stay off of blacklists: Limit postfix recipients</title>
		<link>http://www.jonsblog.org/2011/11/30/stay-off-of-blacklists-limit-postfix-recipients/</link>
		<comments>http://www.jonsblog.org/2011/11/30/stay-off-of-blacklists-limit-postfix-recipients/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 18:24:30 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=458</guid>
		<description><![CDATA[I have heard this story it seems over and over again, I also have been the topic of many email horror stories. They usually go like this

“I just setup a new server and within days we were on a corporate email blacklist, I contacted the company in question and asked why are we on your blacklist, why won’t you deliver our email. They shared with me an email log of thousands of emails being sent from my mail server through several legitimate email accounts. I ensured that my server was not an open relay so I asked these users, if they had indeed sent this many emails in one shot without any kind of unsubscribe link in the footer of their email. They had! I was so shocked, now what do I do?”

This is an uncomfortable and very perilous position. You want to allow your users to send email to get their job done however you as a systems administrator need to comply with the “Can Spam Act” passed by the FCC to ensure that email continues to flow. You also have companies out there who will block you for violating this act as a precaution on their part. All the while your users can not be bothered to learn about proper email procedures.]]></description>
			<content:encoded><![CDATA[<p>I have heard this story it seems over and over again, I also have been the topic of many email horror stories. They usually go like this</p>
<blockquote><p>&#8220;I just setup a new server and within days we were on a corporate email blacklist, I contacted the company in question and asked why are we on your blacklist, why won&#8217;t you deliver our email. They shared with me an email log of thousands of emails being sent from my mail server through several legitimate email accounts. I ensured that my server was not an open relay so I asked these users, if they had indeed sent this many emails in one shot without any kind of unsubscribe link in the footer of their email. They had! I was so shocked, now what do I do?&#8221;</p></blockquote>
<p>This is an uncomfortable and very perilous position. You want to allow your users to send email to get their job done however you as a systems administrator need to comply with the &#8220;Can Spam Act&#8221; passed by the FCC to ensure that email continues to flow. You also have companies out there who will block you for violating this act as a precaution on their part. All the while your users can not be bothered to learn about proper email procedures. </p>
<p>In my experience the only thing you can do at this point is to limit how many emails are allowed to be sent at any given time. If you are using OSX Server for Mail or Postfix for Sendmail then this walkthrough will talk about how to limit email recipients and stay off those dreaded blacklists.</p>
<p>Here are the basics that you should know, the following are all settings that can be added to the /etc/postfix/main.cf file of your postfix setup.</p>
<p><strong>smtpd_recipient_limit (default 1000)</strong> parameter controls how many recipients the SMTP server will take per message delivery request. You can&#8217;t restrict this to a to/cc/bcc field &#8211; <strong>it&#8217;s for all recipients</strong>. For that you&#8217;d have to use a regular expression in header_checks to arbitrarily limit the length of each header to something reasonable.<span id="more-458"></span></p>
<p><strong>smtpd_recipient_overshoot_limit (default 1000)</strong> The number of recipients that a remote SMTP client can send in excess of the hard limit specified with smtpd_recipient_limit, before the Postfix SMTP server increments the per-session error count for each excess recipient.</p>
<p><strong>smtpd_hard_error_limit (default 20)</strong> parameter to know at what number of errors it will disconnect.</p>
<p>So you technically need to consider the 3 values here which affect both inbound &amp; outbound mail. Then there&#8217;s the throttling tools.</p>
<p><strong>smtpd_client_recipient_rate_limit (default: 0 no limit)</strong> The maximum number of recipient addresses that an SMTP client may specify in the time interval specified via anvil_rate_time_unit (default: 60s -careful adjusting this affects other things)&#8221; and note that this is &#8220;regardless of whether or not Postfix actually accepts those recipients&#8221; Those over will receive a 450 4.7.1 Error: too many recipients from [the.client.ip.address] It&#8217;s up to the client to deliver those recipients at some later time.</p>
<p><strong>smtpd_client_connection_rate_limit (default: 0)</strong> The maximal number of connection attempts any client is allowed to make to this service per time unit. The time unit is specified with the anvil_rate_time_unit configuration parameter.</p>
<p><strong>smtpd_client_message_rate_limit (default: 0)</strong> The maximal number of message delivery requests that any client is allowed to make to this service per time unit, regardless of whether or not Postfix actually accepts those messages. The time unit is specified with the anvil_rate_time_unit configuration parameter.</p>
<p>The purpose of these features are to limit abuse, as opposed to regulating legitimate mail traffic, but I use them that way in order to mitigate spam blacklisting. In my organization we limit the recipients from one email to 25 you can see the code from my sample /etc/postfix/main.cf. If your file does not have these values you can add them to the bottom of the file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">smtpd_recipient_limit = <span style="color: #000000;">50</span>
smtpd_recipient_overshoot_limit = <span style="color: #000000;">51</span>
smtpd_hard_error_limit = <span style="color: #000000;">20</span>
smtpd_client_recipient_rate_limit = <span style="color: #000000;">50</span>
smtpd_client_connection_rate_limit = <span style="color: #000000;">10</span>
smtpd_client_message_rate_limit = <span style="color: #000000;">25</span>
default_extra_recipient_limit = <span style="color: #000000;">50</span>
duplicate_filter_limit = <span style="color: #000000;">50</span>
default_destination_recipient_limit = <span style="color: #000000;">50</span>
smtp_destination_recipient_limit = <span style="color: #007800;">$default_destination_recipient_limit</span></pre></td></tr></table></div>

<p>Once done you need to restart postfix</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> postfix reload</pre></div></div>

<p>I hope that you all found this article and walkthrough educational, as always please feel free to interact with me by posting questions and comments and I will answer them as best as I can. If you feel like any of this is wrong or could be improved upon also please leave a comment below, thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/11/30/stay-off-of-blacklists-limit-postfix-recipients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MYSQL on OSX Lion Server</title>
		<link>http://www.jonsblog.org/2011/11/28/installing-mysql-on-osx-lion-server/</link>
		<comments>http://www.jonsblog.org/2011/11/28/installing-mysql-on-osx-lion-server/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 20:40:19 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Bug Fixes]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[OSX Lion]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=448</guid>
		<description><![CDATA[It is a fact that Apple has migrated itself away from MYSQL. It is also a fact that most people who continue to buy Apple Servers have been using MYSQL for some time and have websites or other content that sill relies on this technology. Just because it is not endorsed or pre-configured by Apple however does not mean that it can not be used. On the contrary installing and configuring MYSQL to run on an OSX Lion server is moderately easy and gives greater insight as to how MYSQL works (If your a novice to intermediate MYSQL user like me). Lets get started with a brief walkthrough of how to install MYSQL on an OSX Lion Server.]]></description>
			<content:encoded><![CDATA[<p>It is a fact that Apple has migrated itself away from MYSQL. It is also a fact that most people who continue to buy Apple Servers have been using MYSQL for some time and have websites or other content that sill relies on this technology. Just because it is not endorsed or pre-configured by Apple however does not mean that it can not be used. On the contrary installing and configuring MYSQL to run on an OSX Lion server is moderately easy and gives greater insight as to how MYSQL works (If your a novice to intermediate MYSQL user like me). Lets get started with a brief walkthrough of how to install MYSQL on an OSX Lion Server.</p>
<p><strong>Installation &#038; Configuration</strong></p>
<p>1. Download and install the 64-bit 10.6+ version of MYSQL installer package together with the startup files <a href="http://mysql.he.net/Downloads/MySQL-5.5/mysql-5.5.14-osx10.6-x86_64.dmg">here</a>.</p>
<p>http://dev.mysql.com/downloads/mysql/</p>
<p>2. Mount the Disk Image (I mean open/double-click the DMG file) and install MySQL server by double-clicking the PKG file (in my case mysql-5.5.14-osx10.6-x86_64.pkg) and follow onscreen instructions. ( It will ask for Master password, as it installs MySQL server in /usr/local )</p>
<p>Current latest version is 5.5.14 which I’ll be using to install on my server.</p>
<p>Open the DMG and you will see that the first item is the MySQL software, the 2nd item allows MySQL to start when the Mac is booted and the third is a System Preference that allows start/stop operation and a preference to enable it to start on boot. Run all of these.</p>
<p>Once the installs are done you can start the mysql server right from the System Preferences which has a new preference in the “Other” category called “MySQL” click start and now it is running. <span id="more-448"></span></p>
<p>To find the MySQL version from the terminal, type at the prompt <!--more--></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>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">-v</span></pre></td></tr></table></div>

<p>If you got the error: ERROR 2002 (HY000): Can&#8217;t connect to local MySQL server through socket &#8216;/tmp/mysql.sock&#8217; </p>
<p>then mysql was not started, go back to the System Preference and start the database.</p>
<p>3. Run the following commands</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: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>support-files<span style="color: #000000; font-weight: bold;">/</span>my-small.cnf <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>my.cnf
open <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>my.cnf</pre></td></tr></table></div>

<p>replace &#8220;/tmp/mysql.sock&#8221; with &#8220;/var/mysql/mysql.sock&#8221; at two places near the top.<br />
Create a folder called &#8220;mysql&#8221; (if you don&#8217;t already have one) in the /var directory with the right permissions:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td 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>var
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> mysql
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> mysql mysql 
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</span> mysql</pre></td></tr></table></div>

<p>This command will circumvent the dreaded mysql 2002 socket error.</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: #c20cb9; font-weight: bold;">sudo</span> <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>mysql
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql.sock <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>mysql.sock</pre></td></tr></table></div>

<p>4. Create your alias, this is important so that you can run MYSQL queries through the terminal.</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;">alias</span> mysql <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql
<span style="color: #7a0874; font-weight: bold;">alias</span> mysqladmin <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysqladmin</pre></td></tr></table></div>

<p>optionally you can edit the ~/.profile file to make your aliases (This should be done as root)</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;">pico ~<span style="color: #000000; font-weight: bold;">/</span>.profile</pre></td></tr></table></div>

<p>then add this line below</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: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #007800;">$PATH</span></pre></td></tr></table></div>

<p>*Please note /usr/local/mysql is only symlink to /usr/local/mysql-5.5.14-osx10.6-x86_64 which means when you upgrade to new version symlink will be changed to point to new version but won’t be deleting the older version. However you need to copy your data directory to new location to make sure your existing databases are intact post upgrade.</p>
<p>5. Set the master MYSQL password, there are 2 ways to do this one is a regular way and the other provides additional security and disables all other access</p>
<p><b>Regular Way</b></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;">mysqladmin <span style="color: #660033;">-u</span> root password <span style="color: #ff0000;">'yourpasswordhere'</span></pre></td></tr></table></div>

<p>** use the single quotes. Then when login to mysql to test your password</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;">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-pyourpasswordhere</span></pre></td></tr></table></div>

<p><b>Secure Way</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> mysql_secure_installation
&nbsp;
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE<span style="color: #000000; font-weight: bold;">!</span> PLEASE READ EACH STEP CAREFULLY<span style="color: #000000; font-weight: bold;">!</span>
In order to log into MySQL to secure it, we<span style="color: #ff0000;">'ll need the current
password for the root user. If you'</span>ve just installed MySQL, and
you haven<span style="color: #ff0000;">'t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):</span></pre></td></tr></table></div>

<p>Go ahead and just hit enter if this is a new installation and no password currently exists, follow the prompts to set up a new root password – this is a root password just for mysql separate from the root password of OS X you should set this.</p>
<p>You also get asked about:</p>
<ul>
<li> Removing anonymous users?
<li> Disallow root login remotely?
<li> Remove test database and access to it?
<li> Reload privilege tables now?
<li> If this is a new installation you can just answer yes to  the questions.
</ul>
<p>Once the root user and password is set, you have to interact with mysql with the username and password, so access via command line is (note that there is no space between -p and the password)</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;">mysql <span style="color: #660033;">-u</span> root -p<span style="color: #7a0874; font-weight: bold;">&#91;</span>password<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<p>Now that you have MYSQL running you need to start an instance or a main profile for MYSQL to run. I have found the easiest way to do this is to install PHPMYADMIN and since most people in my opinion (Again novice to intermediate MYSQL user here) use this great tool to navigate around MYSQL on a daily basis. Here is a brief walkthrough on how to install and configure PHPMYADMIN on 10.7 Lion Server</p>
<p><strong>Installation &#038; Configuration</strong></p>
<p>1. Change the socket location in your PHP configuration by editing the php.ini file. You need to do a search and replace here. Search and replace all instances of </p>
<p>/var/mysql/mysql.sock</p>
<p>with </p>
<p>/tmp/mysql.sock</p>
<p>Once done you should be able to run the following command and it should reflect the new updated values you just applied.</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;">grep</span> .default_socket <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></td></tr></table></div>

<p>while editing the php.ini file you need to comment out or enable the following extensions.</p>
<p>extension=php_mysql.dll<br />
extension=php_mysqli.dll</p>
<p>To check your work again you can run this command to ensure they are enabled.</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;">grep</span> mysql <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php.ini<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> ext</pre></td></tr></table></div>

<p>Once done restart Apache</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> apachectl restart</pre></td></tr></table></div>

<p>2. Download PHPMYADMIN to the default web directory in Lion</p>
<p>http://www.phpmyadmin.net/home_page/index.php</p>
<p>The full path is</p>
<p>/Library/Server/Web/Data/Sites/Default</p>
<p>I put my PHPMYADMIN in a folder called PHP so</p>
<p>/Library/Server/Web/Data/Sites/Default/PHP</p>
<p>and I could then browse to it by going to</p>
<p>http://server.domain.name/PHP/</p>
<p>this is assuming that you have already configured or turned on web services which I will not go into here since it is a very basic step. I will write a more in depth article and how to on the complexities of running an 10.7 web server in the future however.</p>
<p>Run this command on the PHP Config 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;">chmod</span> o+<span style="color: #c20cb9; font-weight: bold;">w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Server<span style="color: #000000; font-weight: bold;">/</span>Web<span style="color: #000000; font-weight: bold;">/</span>Data<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>Default<span style="color: #000000; font-weight: bold;">/</span>PHP<span style="color: #000000; font-weight: bold;">/</span>config</pre></td></tr></table></div>

<p>3. Now we are ready to run the set up by going to</p>
<p>http://localhost/PHP/setup</p>
<p>The new server to be configured is the localhost, click new server and then the only other configurations are the local mysql user and the password.</p>
<p>Add in the username, by default “root” is assumed, add in the password, click on save and you are returned to the previous screen.</p>
<p>Make sure you click on save, then a config.inc.php is now in the /config directory, move this file to the root level of /phpmyadmin and then remove the empty /config directory.</p>
<p>Now going to http://localhost/PHP/ will now allow you to interact with your mysql databases.</p>
<p>I hope that you all found this article and walkthrough educational, as always please feel free to interact with me by posting questions and comments and I will answer them as best as I can. If you feel like any of this is wrong or could be improved upon also please leave a comment below, thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/11/28/installing-mysql-on-osx-lion-server/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A defining moment in history</title>
		<link>http://www.jonsblog.org/2011/10/08/a-defining-moment-in-history/</link>
		<comments>http://www.jonsblog.org/2011/10/08/a-defining-moment-in-history/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 01:12:46 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Letter to the Editor]]></category>
		<category><![CDATA[remember]]></category>
		<category><![CDATA[steve jobs]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=437</guid>
		<description><![CDATA[I don't really know what to say. I never met him, I never knew him. I was and am such a huge fan, I always watched the keynotes and was so inspired that all I wanted to do was to was to work with the technology that Steve inspired. I became a Certified Apple Technician, and went on to get all of Apples Server Certifications.]]></description>
			<content:encoded><![CDATA[<p>Subject: I am who I am because of you.<br />
To: rememberingsteve@apple.com</p>
<p>I don&#8217;t really know what to say. I never met him, I never knew him. I was and am such a huge fan, I always watched the keynotes and was so inspired that all I wanted to do was to was to work with the technology that Steve inspired. I became a Certified Apple Technician, and went on to get all of Apples Server Certifications. I was hired by a non profit, they use all Apple technology from the computers to servers and everything in between.</p>
<p>I love my job because I love the technology that I work with and I am truly happy with my life and its all because of Apple and so much of Apple was Steve Jobs. He made it possible for me to be happy and enjoy my life and my job. I am so passionate about this technology. The biggest goal of my life was to eventually meet Steve Jobs or even just be in the same room as him. </p>
<p>I got the go ahead to be at the last WWDC but was not able to acquire tickets. It feels like a big blow to know that I will never meet or see in person the man who has made my life what it is today. I feel a big void in my heart and I truly miss him. I guess I am writing this because I wanted someone to know how much he has touched my life even if it was touched indirectly. It has changed me and made me who I am today.</p>
<p>Thanks Steve.</p>
<p>Jon Brown<br />
IT Director<br />
Food &amp; Water Watch</p>
<p>http://www.foodandwaterwatch.org</p>
<p>Huge Apple Fan <span id="more-437"></span></p>
<p>http://www.jonsblog.org</p>
<p>P.S. One of my most favorite clips.<br />
<iframe src="http://www.youtube.com/embed/CW0DUg63lqU" frameborder="0" width="502" height="360"></iframe></p>
<h4>I want to know how you feel, share below, leave a comment.</h4>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/10/08/a-defining-moment-in-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better Quota notifications for OSX Server</title>
		<link>http://www.jonsblog.org/2011/10/07/better-quota-notifications-for-osx-server/</link>
		<comments>http://www.jonsblog.org/2011/10/07/better-quota-notifications-for-osx-server/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 23:15:49 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[bash script]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[quota]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=418</guid>
		<description><![CDATA[OSX Server comes pre-packaged with Dovecot one of the best IMAP services out there and one of the most extensible and flexible in my opinion. That is its flexible and extensible as long as you know how to configure Dovecot which most OSX Server Administrators are not. I had a conversation with a co-worker not too long ago about being an OSX Server Administrator and I joked that Apple made great hardware and a great OS but most if not all of the services under the hood for Web, Mail, Mailing Lists, etc... were all borrowed open source technologies and that Apple really does not offer any sort of support base for the open source technologies that they use. However without these pieces of software their entire PR Campaign would hold no water. What I praise Apple for is taking these tools and utilizing them and making them easier to use while leaving the ability to tinker and improve these services.]]></description>
			<content:encoded><![CDATA[<p>OSX Server comes pre-packaged with Dovecot one of the best IMAP services out there and one of the most extensible and flexible in my opinion. That is its flexible and extensible as long as you know how to configure Dovecot which most OSX Server Administrators are not. I had a conversation with a co-worker not too long ago about being an OSX Server Administrator and I joked that Apple made great hardware and a great OS but most if not all of the services under the hood for Web, Mail, Mailing Lists, etc&#8230; were all borrowed open source technologies and that Apple really does not offer any sort of support base for the open source technologies that they use. However without these pieces of software their entire PR Campaign would hold no water. What I praise Apple for is taking these tools and utilizing them and making them easier to use while leaving the ability to tinker and improve these services.</p>
<p>One such service is the topic today, Dovecot. Dovecot is integrated with Server Admin, Apples GUI Server Administration tool. You can set two different kind of notifications to trigger here, a quota notification that will send an email out when someone is over a certain percentage of email quota and an email warning them when they have gone over quota. In my experience it takes more than a couple emails to make a user clean up their inbox.</p>
<p>What I wanted was a way to say, send out an email when a user goes over a specified limit and then send an email every ten percent they go over the original limit. When they reach ten percent before their quota is exceeded increase the email notification rate to one email every percent until they reach their quota and then at that time continue to send an email a day until their quota has been reduced. On top of that I wanted it to also notify me of people who have gone over quota so that I can prove to them that they did indeed get the notification. For me a good solution was having all quota notifications CC&#8217;d to our help desk which in turn opened a ticket on the behalf of the offender in a sense sending them two emails each time they went over quota. I am going to cover the necessary steps needed to accomplish this task on your OSX Mail server.<br />
<span id="more-418"></span><br />
** Note what we are about to do will mean that you will no longer be able to use Server Admin to manage email notifications.</p>
<h4>1. Locate the Dovecot Configuration file.</h4>

<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: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>dovecot.conf</pre></td></tr></table></div>

<h4>2. Edit the file</h4>

<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> pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>dovecot.conf</pre></td></tr></table></div>

<h4>3. Find this line</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"> quota_warning = <span style="color: #007800;">storage</span>=<span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh</pre></td></tr></table></div>

<p>we are going to modify this line and add the following lines.</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
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">  quota_warning = <span style="color: #007800;">storage</span>=<span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning2 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning3 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">98</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning4 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">97</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning5 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">96</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning6 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">95</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning7 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">94</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning8 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">93</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning9 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">92</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning10 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">91</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning11 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">90</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-exceeded.sh
  quota_warning12 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">87</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-warning.sh
  quota_warning13 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">85</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-warning.sh
  quota_warning14 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-warning.sh
  quota_warning15 = <span style="color: #007800;">storage</span>=<span style="color: #000000;">75</span><span style="color: #000000; font-weight: bold;">%%</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>quota-warning.sh</pre></td></tr></table></div>

<p>What we are saying here is that we are going to send out an email every time someone is over their limit. Here the limit is 75% and every 5% they go over they will get another warning until they get to 90% then the warnings become more frequent one every 1%. Not only that but there are two different messages the quota-warning and the quota-exceeded.</p>
<h4>4. We are going to create a new quota-warning.sh file</h4>

<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;">cd</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>dovecot
<span style="color: #c20cb9; font-weight: bold;">sudo</span> pico quota-warning.sh</pre></td></tr></table></div>

<p>This is the current default Apple script that triggers the default email created in Server Admin.</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: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">_quota_txt</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>quota_warning.txt
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$_quota_txt</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$_quota_txt</span> <span style="color: #000000; font-weight: bold;">|</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>deliver <span style="color: #660033;">-d</span> <span style="color: #007800;">$USER</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>We are going to modify this script to send out an email of our choice and to do so to another recipient so we have a record of users getting notifications.Here is the script that I wrote that does just that.</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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">PERCENT</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">FROM_SMTP</span>=<span style="color: #ff0000;">&quot;support@somedomain.com&quot;</span>
<span style="color: #007800;">FROM</span>=<span style="color: #ff0000;">&quot;FWW Support &lt;support@somedomain.com&gt;&quot;</span>
<span style="color: #007800;">TO</span>=<span style="color: #ff0000;">&quot;FWW Support &lt;mail-server-admini@somedomain.com&gt;&quot;</span>
<span style="color: #007800;">qwf</span>=<span style="color: #ff0000;">&quot;/tmp/quota.warning.$$&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;From: <span style="color: #007800;">$FROM</span>
To: <span style="color: #007800;">$USER</span>
Subject: Quota Notification
Content-Type: text/plain; charset=&quot;</span>UTF-<span style="color: #000000;">8</span><span style="color: #ff0000;">&quot;
&nbsp;
Hello-
This is a warning email that was automatically sent. You are nearing your quota limit. The current quota is 1 GB of storage space per user. However you can store more offline.
&nbsp;
Q: What can I do now?
&nbsp;
A: Start backing up your emails and storing them in a folder under the On My Mac heading, this will ensure that your emails will still be stored and it will free up space on your online account.
&nbsp;
If you need more assistance please contact Jon Brown at 
support@somedomain.com.
&nbsp;
Thank you for your cooperation!
&nbsp;
-- Some Organization Mail Server&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$qwf</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$FROM_SMTP</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$USER</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;From: <span style="color: #007800;">$USER</span>
To: support@somedomain.com
Subject: Quota Notification
Content-Type: text/plain; charset=&quot;</span>UTF-<span style="color: #000000;">8</span><span style="color: #ff0000;">&quot;
&nbsp;
Hello  -
&nbsp;
<span style="color: #007800;">$USER</span> Is nearing their quota. Please follow these steps.
&nbsp;
1. Call the user and make sure they understand how to archive their email.
&nbsp;
2. Explain to the user that they can sort their email by largest size, tell them to discard or remove the largest emails first.
&nbsp;
3. Ensure that the quota has been reduced in Server Admin, do not increase the quota unless it is an emergency.
&nbsp;
-- Some Organization Mail Server&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$qwf</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$FROM_SMTP</span> <span style="color: #ff0000;">&quot;support@somedomain.com&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>You must replace the above script with the old script entirely. This will negate the ability to use the text file that Server Admin uses for email notifications but allows you to send the notification to multiple people.</p>
<h4>4. We are going to create a new quota-exceeded.sh file</h4>

<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;">cd</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>dovecot
<span style="color: #c20cb9; font-weight: bold;">sudo</span> pico quota-warning.sh</pre></td></tr></table></div>

<p>This is the current default Apple script that triggers the default email created in Server Admin.</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: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">_quota_txt</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>quota_exceeded.txt
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$_quota_txt</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$_quota_txt</span> <span style="color: #000000; font-weight: bold;">|</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>dovecot<span style="color: #000000; font-weight: bold;">/</span>deliver <span style="color: #660033;">-d</span> <span style="color: #007800;">$USER</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>We are going to re-write this script and use the following to do similar to the above but at a more aggressive rate.</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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">PERCENT</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">FROM_SMTP</span>=<span style="color: #ff0000;">&quot;support@somedomain.com&quot;</span>
<span style="color: #007800;">FROM</span>=<span style="color: #ff0000;">&quot;FWW Support &lt;support@somedomain.com&gt;&quot;</span>
<span style="color: #007800;">TO</span>=<span style="color: #ff0000;">&quot;FWW Support &lt;mail-server-admin@somedomain.com&gt;&quot;</span>
<span style="color: #007800;">qwf</span>=<span style="color: #ff0000;">&quot;/tmp/quota.warning.$$&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;From: <span style="color: #007800;">$FROM</span>
To: <span style="color: #007800;">$USER</span>
Subject: FWW ***You're Over Your Quota***
Content-Type: text/plain; charset=&quot;</span>UTF-<span style="color: #000000;">8</span><span style="color: #ff0000;">&quot;
&nbsp;
Hello-
This is a warning email that was automatically sent. You are nearing your quota limit. The current quota is 1 GB of storage space per user. However you can store more offline.
&nbsp;
Q: What can I do now?
&nbsp;
A: Start backing up your emails and storing them in a folder under the On My Mac heading, this will ensure that your emails will still be stored and it will free up space on your online account.
&nbsp;
If you need more assistance please contact Jon Brown at support@somedomain.com.
&nbsp;
Thank you for your cooperation!
&nbsp;
-- FWW Mac Server&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$qwf</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$FROM_SMTP</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$USER</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;From: <span style="color: #007800;">$USER</span>
To: support@somedomain.com
Subject: FWW ***You're Over Your Quota***
Content-Type: text/plain; charset=&quot;</span>UTF-<span style="color: #000000;">8</span><span style="color: #ff0000;">&quot;
&nbsp;
Hello  -
&nbsp;
<span style="color: #007800;">$USER</span> Is nearing their quota. Please follow these steps.
&nbsp;
1. Call the user and make sure they understand how to archive their email.
&nbsp;
2. Explain to the user that they can sort their email by largest size, tell them to discard or remove the largest emails first.
&nbsp;
3. Ensure that the quota has been reduced in Server Admin, do not increase the quota unless it is an emergency.
&nbsp;
4. Explain to the user that their email will stop working if they reach 99% capacity.
&nbsp;
-- FWW Mac Server&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$qwf</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$FROM_SMTP</span> <span style="color: #ff0000;">&quot;support@somedomain.com&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$qwf</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>That is it, once you are done you must restart dovecot.</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: #c20cb9; font-weight: bold;">sudo</span> serveradmin stop mail
<span style="color: #c20cb9; font-weight: bold;">sudo</span> serveradmin start mail</pre></td></tr></table></div>

<p>Once done you will now be able to enjoy the fruits of your labor. Your users will now get a lot more notifications which will mean that they will be more likely to tame their unruly inboxes on their own and you will be notified as to when they are getting notifications so that you can better assist them with this task. As always I encourage your comments, suggestions and questions. I hope you all enjoyed my post and thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/10/07/better-quota-notifications-for-osx-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy Studio Server to the Rescue</title>
		<link>http://www.jonsblog.org/2011/07/30/deploy-studio-server-to-the-rescue/</link>
		<comments>http://www.jonsblog.org/2011/07/30/deploy-studio-server-to-the-rescue/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 04:02:48 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Product Reviews]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[studio]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=385</guid>
		<description><![CDATA[As a Mac System Admin working in the Private sector, I must confess I find myself like a kid in the candy store looking, and trying out new products created by third party vendors that make my life, job and the user experience for my clients easier and more productive. I must stress that most [...]]]></description>
			<content:encoded><![CDATA[<p>As a Mac System Admin working in the Private sector, I must confess I find myself like a kid in the candy store looking, and trying out new products created by third party vendors that make my life, job and the user experience for my clients easier and more productive. I must stress that most admins can not fully share in my joy due to job or security restrictions. Admins in the Government sector for example can only use sanctioned tools and or methods for dealing with common Server Admin problems. These often lead to long, lenghtly solutions that could be eased with the use of third party software solutions. The restrictions are in place to keep security measures tight and ensure that proper procedures are followed.</p>
<p>Again, since I do not have any looming restrictions in my workplace I have found a piece of software that would never be allowed in larger Government facilities but works nicely for what I need. The problem, from time to time I need to re-image or re-core a massive amount of computers, sometimes hundreds of computers. I have a team of two, me and a Helpdesk Technician. This is a daunting task and since I do not like to work weekends, I find that Deploy Studio Server helps me keep my sanity in such situations.</p>
<p>This freeware tool can be used to create deployment files using Netboot, external USB or FireWire drives, or any AFP, SMB, or NFS sharepoint on the network. DeployStudio works with Mac OS X 10.4.11 to 10.6.8 at this point, and is updated regularly to include new OS versions. The package consists of DeployStudio Server, DeployStudio Assistant, DeployStudio Admin, and diffPackageMaker.</p>
<p>DeployStudio Server creates a network based deployment server containing the images. Assistant is used to configure the server and to create the NetInstall sets, while Admin is used to monitor deployments, manage disk images and scripts, enter configurations, and more. diffPackageMaker can look at the difference between two file system snapshots and create installation packages based on what has been changed or added. <span id="more-385"></span></p>
<p><center>
<div class="lyte" id="WYL_YIV6Bt3L1ks" style="width:480px;height:360px;"><noscript><a href="http://youtu.be/YIV6Bt3L1ks"><img src="http//img.youtube.com/vi/YIV6Bt3L1ks/0.jpg" alt="" width="480" height="360" /><br />Watch this video on YouTube.</a></noscript><script type="text/javascript"><!-- 
 (function(){var d=document;var w=window;if(w.addEventListener){w.addEventListener('load', insert, false)}else{w.onload=insert} function insert(){if(!d.getElementById('lytescr')){lytescr=d.createElement('script');lytescr.async=true;lytescr.id='lytescr';lytescr.src='http://www.jonsblog.org/wp-content/plugins/wp-youtube-lyte/lyte/lyte-min.js?wylver=0.9.4';h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(lytescr, h)}};}()) 
 --></script></div>
<p></center></p>
<p>I highly recommend using this fine product if you are in the fortunate position as myself and you are not under any pressure or regulations. This requires the use of an in-house server and it installs itself as a service on it. You configure the service to deploy images that you create, and the best part is that it can perform common tasks that will save you time after the re-imaging process is completed. Tasks like setting the computer name, setting up local accounts, binding the computer to a directory server and much more. I describe it as Apple Netboot + Apple Automater = Deploy Studio Server. This is a useful tool that I highly recommend. Check out this instructional video that goes over how to set it up and use it.</p>
<p>I use Deploy Studio Server in my workplace and can field any questions you may have regarding its functionality, setup and configuration and ease of use. Write me a comment below and I will be happy to help!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/07/30/deploy-studio-server-to-the-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Reader, Network Accounts &amp; 10.6.8 Server</title>
		<link>http://www.jonsblog.org/2011/07/23/adobe-reader-network-accounts-10-6-8-server/</link>
		<comments>http://www.jonsblog.org/2011/07/23/adobe-reader-network-accounts-10-6-8-server/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 03:41:01 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Bug Fixes]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[acrobat]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[fixes]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[reader]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=380</guid>
		<description><![CDATA[There has been a lingering issue with running Network Accounts and letting the users of those network accounts use Adobe Acrobat Reader on an OSX Leopard &#038; Snow Leopard server environment for a while. The issue presents itself as a hard crash of Adobe Reader, while the user is trying to use the program. After [...]]]></description>
			<content:encoded><![CDATA[<p>There has been a lingering issue with running Network Accounts and letting the users of those network accounts use Adobe Acrobat Reader on an OSX Leopard &#038; Snow Leopard server environment for a while. The issue presents itself as a hard crash of Adobe Reader, while the user is trying to use the program. After much trial and investigation, I have narrowed down the reason for the crash to the fact that the program is trying to save temporary cache files to the users Documents folder. Since the folder is a network based folder (Network account, running mobile home folders off of the server), the program crashes as it is unable to create those files in the remote network location. </p>
<p>This is quite frustrating and for the System Admins trying to use Network Accounts, waiting for Adobe to fix this issue has been a waiting game that so far has not come to an end. The obvious solution of course that I tell my users is to use Preview instead of Adobe Acrobat Reader to read their PDF files. This does solve their problems in the short term however my users quickly point out that they need Adobe Acrobat Pro which causes the same issue. Since Preview is no substitution for Adobe Acrobat Pro, this poses a real challenge for the user and the System administrator.</p>
<p>I have been scouring the web trying to find a solution and finally I got a break. A user on an Adobe Forum post, posted a temporary fix that worked wonders for my problem. It was so great I wanted to be sure that this solution gets the exposure that it so rightly deserves. You can read the entire <a href="http://forums.adobe.com/thread/794726">post</a> here and the solution below.</p>
<blockquote><p><em><br />
&#8220;Hi I have seen this issue on Network accounts for quite a while. It also affects Adobe Acrobat Pro and we have come up with a temporary fix until something is done about the issue. The main problem as I understand it is Adobe Reader does not like writing to network locations.<br />
<span id="more-380"></span><br />
If you are logged in as a network user then your home directory is going to be something like smb://server/home/user which Adobe does not like and causes the app to crash. To get around this issue we have created a small login hook that creates a symlink in ~/Application\ Support/Adobe which redirects the data to /Users/shared which is stored locally on the machine. </p>
<p>Here is the login hook we&#8217;re using if it helps anyone.&#8221;</em>
</p></blockquote>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>Network<span style="color: #000000; font-weight: bold;">/</span>Servers<span style="color: #000000; font-weight: bold;">/</span>yourservername<span style="color: #000000; font-weight: bold;">/</span>homes<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</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>Adobe
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>Shared<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>Shared<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>Shared<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">/</span>Network<span style="color: #000000; font-weight: bold;">/</span>Servers<span style="color: #000000; font-weight: bold;">/</span>yourservername<span style="color: #000000; font-weight: bold;">/</span>homes<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</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>Adobe
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>

<blockquote><p><em>I throw this in /Library/Preferences and call it symlink.sh and then run the following command to setup the login hook</p>
<p>sudo defaults write com.apple.loginwindow LoginHook /Library/Preferences/symlink.sh</p>
<p>You will find the adobe Reader / Pro and other adobe apps will now work with network accounts. Not the nicest solution but a working one.</em></p></blockquote>
<p>I can verify that the solution works well. The script runs, creates the appropriate symlinks and then allows the program to continue to function. The files are created locally for the network user. The only drawback to this is that if you have temporary accounts using computers you will need to clean-up these files from time to time. If the users move about from workstation to workstation then the files will be re-created for that user on multiple machines. These are minor inconveniences that are less noticeable for the user and enable them to get their work done while using Network based accounts in OSX. Let us know what your experiences have been, and if this solution works for you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/07/23/adobe-reader-network-accounts-10-6-8-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10.6.8 Installing SSL Certificates Correctly</title>
		<link>http://www.jonsblog.org/2011/07/16/10-6-8-installing-ssl-certificates-correctly/</link>
		<comments>http://www.jonsblog.org/2011/07/16/10-6-8-installing-ssl-certificates-correctly/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 02:46:57 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[SSL Encryption]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=367</guid>
		<description><![CDATA[I am well aware of how to install and setup SSL certificates in OSX Server but that was not always the case. I am writing this how to for those less experienced who may find this article helpful. There are two types of SSL certificates, that you can use on your OSX Server. Self Signed [...]]]></description>
			<content:encoded><![CDATA[<p>I am well aware of how to install and setup SSL certificates in OSX Server but that was not always the case. I am writing this how to for those less experienced who may find this article helpful. There are two types of SSL certificates, that you can use on your OSX Server. Self Signed Certificates are ones that are created on the server and are not digitally verified by a third party service. You can use these certificates to encrypt or secure your servers services but you will ultimately confuse users due to the never ending string of warnings about untrusted certificates. The second type of certificate requires a self signed certificate as the base but then gets verified by a third party service. We use <a href="https://www.godaddy.com/ssl/ssl-certificates.aspx">GoDaddy</a> for our certificates and they work pretty well, there are many other services out there that offer moderately priced certificate verification services that will offer a trusted connection. This type of certificate is transparent to the user and simply encrypts the data without any warning message. </p>
<p>What I struggled with for a while as a System Administrator with little experience in the SSL realm was that no matter how many ways I tried to install the certificate for use on my server users would still get warnings saying that the certificate was not trusted. Through some trial and error and luck I figured out the proper steps to making sure that all of your services and your users can use SSL without the heartache of untrusted warning messages. The steps to follow are simple:</p>
<ol>
1. Create your Self Signed certificate in Server Admin.<br />
2. Generate a CSR request.<br />
3. Import the CSR into the SSL Certificate authority.<br />
4. Import the returned signed certificate into your server.<br />
5. Import the returned intermediary certificate into your server.<br />
6. Configure Apache to work with your certificate.<br />
7. Restart and re-assign certificates to your services.</ol>
<p><span id="more-367"></span><br />
<strong>Step 1:</strong><br />
Launch Server Admin and select the hostname of the server that you are configuring. Chose the Certificate icon to display the &#8220;Default&#8221; self-signed certificate. You&#8217;ll need to edit this to something appropriate for your server. It&#8217;s important that you set the &#8220;Common Name&#8221; field to the fully qualified domain A-name of your server. Once you&#8217;ve edited your self-signed Default certificate, you next need to generate the CSR.</p>
<p><strong>Step 2:</strong></p>
<p>In the same pane in Server Admin is the little sprocket pull-down with the option to &#8220;Generate a Certificate Signing Request (CSR)&#8230;&#8221;. A window will pull down with a field to enter an email address. Don&#8217;t bother with this. Just drag the certificate icon to your desktop. Sitting on on your desktop is a text clipping that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">-----BEGIN</span> CERTIFICATE REQUEST-----
MIIBnTCCAQYCAQAwXTELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRIw
EAYDVQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGFkbWluQHNlcnZlci5l
eGFtcGxlLmRvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAr1nYY1Qrll1r
uB<span style="color: #000000; font-weight: bold;">/</span>FqlCRrr5nvupdIN+3wF7q915tvEQoc74bnu6b8IbbGRMhzdzmvQ4SzFfVEAuM
MuTHeybPq5th7YDrTNizKKxOBnqE2KYuX9X22A1Kh49soJJFg6kPb9MUgiZBiMlv
tb7K3CHfgw5WagWnLl8Lb+ccvKZZl+8CAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4GB
AHpoRp5YS55CZpy+wdigQEwjL<span style="color: #000000; font-weight: bold;">/</span>wSluvo+WjtpvP0YoBMJu4VMKeZi405R7o8oEwi
PdlrrliKNknFmHKIaCKTLRcU59ScA6ADEIWUzqmUzP5Cs6jrSRo3NKfg1bd09D1K
9rsQkRc9Urv9mRBIsredGnYECNeRaK5R1yzpOowninXC
<span style="color: #660033;">-----END</span> CERTIFICATE REQUEST-----</pre></div></div>

<p><strong>Step 3:</strong><br />
Here is where you will actually purchase the certificate. Head over to <a href="https://www.godaddy.com/ssl/ssl-certificates.aspx">GoDaddy</a> or any other vendor that sells SSL certificates and enter your information. When it asks you for your CSR enter the text in your text clipping. Be sure to include the &#8220;&#8212;BEGIN CERTIFICATE REQUEST&#8230;&#8212;&#8221; and &#8220;&#8212;END&#8230;&#8212;&#8221; lines! Once your certificate request has been verified you will be ready to proceed to the next step.</p>
<p><strong>Step 4:</strong><br />
Usually within a couple hours, you should get an email with your new SSL certificate. The email will come with instructions, but if you have a stock Snow Leopard Server, it might be better to do it &#8220;the Mac way&#8221; instead of using their generic Apache instructions.</p>
<p>Back in Server Admin, select that self-signed certificate you edited earlier in Step 1, go to that little sprocket thing again, and this time choose &#8220;Add Signed or Renewed Certificate from Certificate Authority&#8230;&#8221;. You&#8217;ll have a window drop down&#8211;drag and drop all of the .crt files you got from your SSL provider here. That&#8217;s your signed certificate. Server Admin will put all the parts where they belong.</p>
<p><strong>Step 5:</strong><br />
Here is where most inexperienced Server Admins stop, this is not the last step. The certificate is valid in Server Admin however, it relies on the Keychain in the OSX Server to validate requests. Open Keychain Access, you&#8217;ll see that it says (in red letters) &#8220;This certificate was signed by an unknown authority.&#8221; You need add the intermediary certificate to your server. To do so double click on the gd_intermediate.crt file and it should automatically update that certificate to a nice green color and render it as valid.</p>
<p><strong>Step 6:</strong><br />
Now that you have Server Admin configured and the Keychain is happy, you need to add the gd_bundle.crt file and configure Apache. This is less daunting then you might think. You should get a gd_bundle.crt file when you purchase your certificate. If you have a .crt file that has the word &#8220;Bundle&#8221; somewhere in it then this is the file you need to use. Copy this file to the /etc/apache2/ folder on your server. You will need to copy it as root! If your file is named gd_bundle.crt then copy and replace the one that exists on your server. Once done your finished with this step.</p>
<p>If your file is not named this way then copy the file into your /etc/apache2/ folder and modify the http.conf file located there and update this path, see below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_ssl.c<span style="color: #000000; font-weight: bold;">&gt;</span>
    SetEnvIf User-Agent <span style="color: #ff0000;">&quot;.*MSIE.*&quot;</span> nokeepalive ssl-unclean-shutdown
    SSLPassPhraseDialog <span style="color: #7a0874; font-weight: bold;">exec</span>:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>getsslpassphrase
    SSLSessionCache shmcb:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>ssl_scache<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">512000</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    SSLSessionCacheTimeout <span style="color: #000000;">300</span>
    SSLMutex <span style="color: #c20cb9; font-weight: bold;">file</span>:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>ssl_mutex
    SSLRandomSeed startup <span style="color: #7a0874; font-weight: bold;">builtin</span>
    SSLRandomSeed connect <span style="color: #7a0874; font-weight: bold;">builtin</span>
    AddType application<span style="color: #000000; font-weight: bold;">/</span>x-x509-ca-cert crt
    AddType application<span style="color: #000000; font-weight: bold;">/</span>x-pkcs7-crl crl
    SSLCertificateChainFile <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>the_name_of_your_ssl_bundle_file.crt
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>After saving httpd.conf, test out your Apache 2.2 configuration file by invoking this command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">bash-<span style="color: #000000;">3.2</span><span style="color: #666666; font-style: italic;"># apachectl -t</span>
Syntax OK</pre></div></div>

<p><strong>Step 7:</strong><br />
This last step is the one that had me banging my head against a wall for the longest time. You must restart your server once done, you must go through all of the services running on your server and un-assign, save and then re-assign and save the SSL certificates you need. This is the only way that I was able to get my Mail service and Web services (web sites) working with SSL consistently. Once done another restart does not hurt. Test and verify that everything is working. </p>
<p>I really hope that you find this walkthrough useful. If you did please leave a comment below, post a question or suggest a better, easier or different way to manage and install SSL certificates on an OSX Server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/07/16/10-6-8-installing-ssl-certificates-correctly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>10.6.8 Server high CPU usage, hwmond culprit</title>
		<link>http://www.jonsblog.org/2011/07/10/10-6-8-server-high-cpu-usage-hwmond-culprit/</link>
		<comments>http://www.jonsblog.org/2011/07/10/10-6-8-server-high-cpu-usage-hwmond-culprit/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 15:13:35 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=359</guid>
		<description><![CDATA[It seems no matter how careful Apple is each OS update (especially server updates) reveals its own challenges for the user, that leaves them wishing that they had not left their stable platform for the bug fixes that made that update so desirable. the 10.6.8 server update was no different it claimed to fix such [...]]]></description>
			<content:encoded><![CDATA[<p>It seems no matter how careful Apple is each OS update (especially server updates) reveals its own challenges for the user, that leaves them wishing that they had not left their stable platform for the bug fixes that made that update so desirable. the 10.6.8 server update was no different it claimed to fix such long time bugs as Server Side Rules which has been a thorn in the side of OSX Server Administrators everywhere who use OSX Servers as their primary email server. So many of us including myself, downloaded the update and wished for the best. Once done, we all noticed the same bug, extremely high CPU usage on XServes running the new 10.6.8 software and the culprit, hwmond. Hey, hwmond, you are supposed to monitor the hard drives in the XServe and not hog all the resources what gives? Was my initial reaction so I started Googling I found that the hwmond was a service that Apple launches to monitor hardware, it can not be unloaded easily like other launch daemons I ran </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl unload <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>com.apple.hwmond.plist</pre></div></div>

<p> which initially threw an odd error, looked at the list of loaded items by running launchctl list on the server and noticed that it was gone. I restarted my XServe and sure enough it had loaded itself. Figuring that there must be something in the OS automatically loading this on each reboot I started searching ways to modify or disable hwmond on my server. In my case I needed to stop the high CPU usage so badly that I was willing to make the tradeoff, of not having hardware monitoring enabled on my system for a modicum of stability for my users, and since this was an email server it seemed like a fair tradeoff. Especially since it looked like the hwmond process could be the process that would cause the most damage to my system if it was allowed to continue and then would be the thing to notify me that the hardware had failed due to extremely high CPU usage over a long period of time. I ran across a post made by Apple <a title="http://support.apple.com/kb/TS2066" href="http://support.apple.com/kb/TS2066">http://support.apple.com/kb/TS2066</a> and decided to take a read, basically the issue that this resolves is hwmond not working and having a tag in the plist file that disables hwmond. Since this was my goal I did the opposite of what the knowledge base suggested, instead of removing the said code from the plist, I put the code into the plist and then rebooted my XServe.<span id="more-359"></span></p>

<div class="wp_syntax"><div 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//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>plist <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&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.apple.hwmond<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>OnDemand<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>false<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>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>hwmond<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>hwmond<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>string<span style="color: #000000; font-weight: bold;">&gt;</span>-s255<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>ServiceIPC<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>false<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>Disabled<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>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></div></div>

<p>Once the server rebooted I was back in business. My server&#8217;s CPU usage was back to normal and life was grand. Three days later, I restarted my server for an update to Virusbarrier the software I use to help block unwanted attacks on my server, and the high CPU issue returned. I looked at the hwmond.plist file and sure enough it had been re-enabled. I applied the fix above and restarted and it seemed to take. Well this is by no means a permanent fix but then I found this forum post <a href="https://discussions.apple.com/thread/3138473?start=0&#038;tstart=0">https://discussions.apple.com/thread/3138473?start=0&#038;tstart=0</a> It seems as though Apple has been informed of the issue and they are working on a fix. But as an update sceptic I find myself chuckling inside, the 10.6.9 update will claim to fix the hwomond cpu issue but what new issues will lie lurking in the wings to terrorize my system? Only Apple knows or maybe they just don&#8217;t have a clue. Hopefully they will come up with a fix, until then I have learned my lesson, I will not update my system so cavalierly in the future. I welcome your feedback and let me know what you have done to combat this issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2011/07/10/10-6-8-server-high-cpu-usage-hwmond-culprit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

