<?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 &#187; server</title>
	<atom:link href="http://www.jonsblog.org/tag/server/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>8</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="340" /><br />Watch this video on YouTube</a> Embedded with WP YouTube Lyte.</noscript><script type="text/javascript"><!-- 
 (function(){var d=document;var w=window;if(w.addEventListener){w.addEventListener('load', insert, false)}else{w.onload=insert};setTimeout(insert, 1000);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=1.0.0';h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(lytescr, h)}};}()) 
 --></script></div>
<div class="lL"></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>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>
		<item>
		<title>OSX Server Mailman Tricks</title>
		<link>http://www.jonsblog.org/2010/10/02/osx-mailman-tricks/</link>
		<comments>http://www.jonsblog.org/2010/10/02/osx-mailman-tricks/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 03:44:42 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[Mailman]]></category>
		<category><![CDATA[osx server]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=191</guid>
		<description><![CDATA[We have been using XServes as our primary mail servers at my organization for about two years now, we upgraded from an older Linux system and we could not be happier, since moving over to the 10.6 platform, we have enjoyed almost no email downtime, very easy to manage mail system and of course all [...]]]></description>
			<content:encoded><![CDATA[<p>We have been using XServes as our primary mail servers at my organization for about two years now, we upgraded from an older Linux system and we could not be happier, since moving over to the 10.6 platform, we have enjoyed almost no email downtime, very easy to manage mail system and of course all the goodies that you would expect to run, some of which I have already mentioned (<a href="http://www.jonsblog.org/2010/01/23/squirrelmail-ldap-sieve/">Squirrelmail</a>) and also Mailman. Through my time configuring the server, migrating data and through other requests I have compiled a list of a few tips and tricks for working with Mailman on the OSX platform.</p>
<p><strong>1. Migrating Mailman data from one server to another.</strong><br />
I had many problems making sure that mailing lists, users, and archives were preserved when moving from our old server to our new server. Here are the following things you must do in order to ensure that the lists are preserved.</p>
<p>You must backup the old mailman lists these are more than likely stored in the /var/mailman directory</p>

<div class="wp_syntax"><div 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;">cp</span> <span style="color: #660033;">-Rp</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mailman <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>setting-backups<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Once your ready to restore the files to the new server run</p>

<div class="wp_syntax"><div 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;">cp</span> <span style="color: #660033;">-Rp</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>setting-backups<span style="color: #000000; font-weight: bold;">/</span>mailman <span style="color: #000000; font-weight: bold;">/</span>var</pre></div></div>

<p>the -Rp flags relate to the fact that it is a folder and that you are going to restore the permissions, once your done you will need to login through SSH or on the server itself and run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mailman<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>genaliases</pre></div></div>

<p>the ./genaliases command will take the lists, and it will generate aliases for them. This plagued me for a while before I realized that when you migrate to the server, this database needs to be built.<br />
<span id="more-191"></span><br />
<strong>2. Change the hostname of of your Mailman Server</strong><br />
I have had to do this as well, normally the mailman web interface can be found at http://example.com/mailman/admin for the administrative side or http://example.com/mailman/listinfo for the list information side. If you are going to change the hostname of your server to example2.com then you will need to use the command line tools to move the lists over.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mailman<span style="color: #000000; font-weight: bold;">/</span>bin
.<span style="color: #000000; font-weight: bold;">/</span>withlist <span style="color: #660033;">-l</span> <span style="color: #660033;">-r</span> fix_url <span style="color: #007800;">$listname</span> <span style="color: #660033;">-v</span></pre></div></div>

<p>This will update the host names for $listname from the main configuration file, and -v shows you what the changes are. Remember to change $listname with the actual name of your list, you will have to do this for every list you can however run all of the lists at once by running the command multiple times like so.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mailman<span style="color: #000000; font-weight: bold;">/</span>bin
.<span style="color: #000000; font-weight: bold;">/</span>withlist <span style="color: #660033;">-l</span> <span style="color: #660033;">-r</span> fix_url <span style="color: #007800;">$listname</span> <span style="color: #660033;">-v</span>
.<span style="color: #000000; font-weight: bold;">/</span>withlist <span style="color: #660033;">-l</span> <span style="color: #660033;">-r</span> fix_url <span style="color: #007800;">$listname1</span> <span style="color: #660033;">-v</span>
.<span style="color: #000000; font-weight: bold;">/</span>withlist <span style="color: #660033;">-l</span> <span style="color: #660033;">-r</span> fix_url <span style="color: #007800;">$listname2</span> <span style="color: #660033;">-v</span>
.<span style="color: #000000; font-weight: bold;">/</span>withlist <span style="color: #660033;">-l</span> <span style="color: #660033;">-r</span> fix_url <span style="color: #007800;">$listname3</span> <span style="color: #660033;">-v</span></pre></div></div>

<p><strong>3. Retrieving a text list of users subscribed to a list</strong><br />
I have seen this question asked in almost every forum that I have visited, there are multiple ways to do this however I recently found out that Mailman has a built in tool that will automatically grant you what your looking for in the form of an email daemon. First, you must be an administrator or moderator of the list in question. Second you must know the password to the administration area for the list in question.</p>
<p>You can get a list of users by sending an email to the list at $listname-request@yourdomain.com where $listname is the name of your mailing list. With the the following command in the subject line and the message body.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">who</span> <span style="color: #007800;">$listpassword</span></pre></div></div>

<p>where $listpassword is the password of the list in question, the list of users will be sent back to you in the form of an email.</p>
<p><strong>4. Create a Mailman auditing script</strong><br />
These commands can be used to export a list of users and then have that list automatically emailed to you so that you can regularly be reminded to make sure that your mailman lists are free from errors, and or people that should no longer be on the lists. I have created two scripts that do this.</p>
<p>Script #1: The list querying script</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mailman<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
.<span style="color: #000000; font-weight: bold;">/</span>list_members <span style="color: #660033;">-f</span> Internal <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;/scripts/lists/audit/Internal.txt&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #ff0000;">&quot;/scripts/lists/Internal.txt&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;XXX Mailing List -- For Auditing Purposes <span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span> This is an automated email, please check your list of subscribers for accuracy, if there is a change that needs to be made please contact XXX, at XXX@XXX.XXX, thank you. <span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;/scripts/lists/Internal.txt&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #ff0000;">&quot;/scripts/lists/audit/Internal.txt&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;/scripts/lists/Internal.txt&quot;</span>
&nbsp;
<span style="color: #007800;">SUBJECT</span>=<span style="color: #ff0000;">&quot;XXX Mailing List&quot;</span>
&nbsp;
<span style="color: #007800;">EMAIL</span>=<span style="color: #ff0000;">&quot;XXX@XXX.XXX&quot;</span>
&nbsp;
<span style="color: #007800;">EMAILMESSAGE</span>=<span style="color: #ff0000;">&quot;/scripts/lists/Internal.txt&quot;</span>
&nbsp;
mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SUBJECT</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$EMAIL</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$EMAILMESSAGE</span>&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #ff0000;">&quot;/scripts/lists/Internal.txt&quot;</span></pre></div></div>

<p>This script runs the commands and generates the list, it then adds on the email text above the list of users and then sends it out as an email. I would name this script the name of the list so for example $listname.sh and then chmod the script 700 so that it is executable. You will want to use the above template for each of your mailing lists and save this into multiple scripts.</p>
<p>Script #2: The the scheduled script</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;/scripts/&quot;</span>
&nbsp;
.<span style="color: #000000; font-weight: bold;">/</span>list1.sh
.<span style="color: #000000; font-weight: bold;">/</span>list2.sh
.<span style="color: #000000; font-weight: bold;">/</span>list3.sh
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-R</span> <span style="color: #ff0000;">&quot;/scripts/lists/audit&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #ff0000;">&quot;/scripts/lists/audit&quot;</span></pre></div></div>

<p>You will want to schedule this script, I have mine set to once a month, what it does is, it runs all the scripts listed each script above uses the first template to query Mailman, generate the lists, append with email text and then send out to the list moderators.</p>
<p>There is a bit of trial and error here, first of all the user account must have sudo rights, so you may need to add the user running these scripts to the sudoers file or make them an administrator. Scheduling is a matter of setting up a crontab, I am using</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span>	<span style="color: #000000;">0</span>	<span style="color: #000000;">1</span>	<span style="color: #000000; font-weight: bold;">*</span>	<span style="color: #000000; font-weight: bold;">*</span>	<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>run.sh</pre></div></div>

<p>this will make sure that it runs on the first day of each month.</p>
<p><strong>5. Reset the Mailman master password</strong><br />
I do this from time to time to make sure that I and the IT Staff at our organization have access to every list on the Mailman roster, but also as a security point, the password changes once every quarter. You can do this via the command line by running.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mailman<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mmsitepass</pre></div></div>

<p>It will prompt you to enter a password, and confirm. I suggest that you choose a strong password. You can also change a single list password through the command line as well.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>mailman<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>withlist <span style="color: #660033;">-l</span> mylistnamehere
import sha
m.password = sha.new<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'supersecretpasswordhere'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>.hexdigest<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
m.Save<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>ctrl-D<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>The above will change the admin lists password and encrypt it at the same time.</p>
<p>Well I hope you enjoyed my Mailman tips and tricks, please feel free to tell me of any other Mailman tricks that might help out the Mac community, as always comments are very welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/10/02/osx-mailman-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Understanding Mobile Access Server</title>
		<link>http://www.jonsblog.org/2010/07/13/understanding-mobile-access-server/</link>
		<comments>http://www.jonsblog.org/2010/07/13/understanding-mobile-access-server/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 02:23:33 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[mobile access]]></category>
		<category><![CDATA[server]]></category>

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

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

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

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

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

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

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

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

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

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

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

<p> this will find any reference to the word ethiopia located in a Excel file. I let this run and again slow but effective it revealed more results but nothing. I explained to the gentleman that I could try looking at the tape backups but it would take me some time.  He asked me if I could do that.</p>
<p>It was a long walk back upstairs, I loaded the first tape into the drive and got ready. I began the search. Not 10 minutes later did I get a phone call back saying, that he had found the file on a thumb drive that he had. Go figure, turns out that no matter how many cool ways there are to search a hard drive none of them will index a thumb drive in someones pocket.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/29/missing-a-file-scrub-that-hard-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10.6.2 Split Horizon DNS</title>
		<link>http://www.jonsblog.org/2010/01/23/10-6-2-split-horizon-dns/</link>
		<comments>http://www.jonsblog.org/2010/01/23/10-6-2-split-horizon-dns/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 23:50:20 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[DNS Settings]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[split horizon]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=28</guid>
		<description><![CDATA[The DNS interface in Server Admin.app is not suitable for doing a split-horizon DNS configuration. It simply doesn&#8217;t expose all of the flexibility of bind that you need to pull off such a configuration. If you poke around the bind config files on your OS X Server, you&#8217;ll be able to see how apple has [...]]]></description>
			<content:encoded><![CDATA[<p>The DNS interface in Server Admin.app is not suitable for doing a split-horizon DNS configuration. It simply doesn&#8217;t expose all of the flexibility of bind that you need to pull off such a configuration.</p>
<p>If you poke around the bind config files on your OS X Server, you&#8217;ll be able to see how apple has set them up so that you can edit them directly without confusing the GUI. /var/named contains zone files that you may edit, and they include corresponding files in /var/named/zones which you should not edit. They&#8217;ve done something similar for /etc/named.conf and the files in /etc/dns/.</p>
<p>Having said that, I recommend not doing both internal and external resolving for split-horizon DNS on your server, mainly because:</p>
<ol>
<li>It&#8217;s kind of complicated, and you lose any convenience you had when you were able to use the GUI exclusively</li>
<li>You have NAT, which makes it even more complicated</li>
<li>There are solutions available from third parties that are better-performing, cheap/free, and more robust</li>
</ol>
<p>In my organization, we use DNS in Mac OS X Server extensively for the internal part of a split-horizon setup. We use the &#8220;Advanced DNS&#8221; part of a network solutions account for the external part. It comes free with the domains we&#8217;ve purchased, and has redundancy and speed far greater than what I could justify for hosting a handful or externally-resolving names myself.</p>
<p>You need to reconfigure BIND to use &#8220;views&#8221; with two different versions of your zone file, such that access from inside your network gives the 192.168.1/24 (internal) addresses, but requests forwarded from outside (via your 2-Wire router) give out your static public IP.<span id="more-28"></span></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">acl internal <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    127.0.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8</span>;
    192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
view <span style="color: #ff0000;">&quot;internal&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    match-clients <span style="color: #7a0874; font-weight: bold;">&#123;</span> internal; <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
    zone <span style="color: #ff0000;">&quot;mydomain.com&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> master;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/internal/db.mydomain.com&quot;</span>;
     <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
view <span style="color: #ff0000;">&quot;external&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    match-clients <span style="color: #7a0874; font-weight: bold;">&#123;</span> any; <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
    zone <span style="color: #ff0000;">&quot;mydomain.com&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> master;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/external/db.mydomain.com&quot;</span>;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;</pre></td></tr></table></div>

<p>For more information check this out it is a <a href="http://www.howtoforge.com/two%5Fin%5Fone%5Fdns%5Fbind9%5Fviews">How To with more detailed instruction</a>s for Split Horizon DNS configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/23/10-6-2-split-horizon-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

