<?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>IrisInk Technical Blog - IT, Marketing, Business &#38; More &#187; Mac OS X Server</title>
	<atom:link href="http://blog.irisproservices.com/category/mac-os-x-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.irisproservices.com</link>
	<description>IrisInk, Information Technology</description>
	<lastBuildDate>Mon, 02 Aug 2010 21:57:51 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Apple’s Open Directory PDC to authenticate Linux Samba servers</title>
		<link>http://blog.irisproservices.com/2010/01/26/using-apple%e2%80%99s-open-directory-pdc-to-authenticate-linux-samba-servers/</link>
		<comments>http://blog.irisproservices.com/2010/01/26/using-apple%e2%80%99s-open-directory-pdc-to-authenticate-linux-samba-servers/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 00:56:38 +0000</pubDate>
		<dc:creator>Iain Morris</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.irisink.com/?p=643</guid>
		<description><![CDATA[Samba is the result of some clever reverse-engineering to create reliable Windows file sharing without the headaches of a Windows server.  Mac OS X clients can also use these shares, making Samba a great option for cross-platform environments.  It’s not a common scenario to use an Open Directory server to control Linux systems, [...]]]></description>
			<content:encoded><![CDATA[<p>Samba is the result of some clever reverse-engineering to create reliable Windows file sharing without the headaches of a Windows server.  Mac OS X clients can also use these shares, making Samba a great option for cross-platform environments.  It’s not a common scenario to use an Open Directory server to control Linux systems, but here’s how to do it if you have one already, and want to use Samba on Linux with your OD users.  If you are finding the Xserve platform to be a little out of your budget for the amount of performance you get, or you don’t want to administrate yet another Mac OS X Server system, this could be a great alternative to an AFP solution for your Macs.</p>
<p>We could host SMB shares directly on our OD server, but ideally we keep our OD server just as a directory and authentication server, and let other servers do the file sharing heavy lifting.<span id="more-643"></span></p>
<p>We’ll be using a Mac OS X Server 10.5 OD master to authenticate a Red Hat Enterprise Linux 5 system with the distro Samba package, but this should work on any of the Samba distributions out there.  We’ll make a simple share point for some OD users to access their files in a collaborative way.</p>
<p>First, we’ll configure the Open Directory server.  In Server Admin, make sure you have activated SMB as a service under “Services” in the general section of your OD server’s entry.</p>
<p><img src="http://www.irisink.com/img/article_20100125/services.png" alt="services" /></p>
<p>Assuming this is an OD master, click on the new SMB entry on the left panel, and change the server’s role from Standalone Server to Primary Domain Controller (PDC).</p>
<p>Enter a description, computer name, and domain for your new PDC.</p>
<p><img src="http://www.irisink.com/img/article_20100125/samba_conf1.png" alt="samba conf 1" /></p>
<p>Unless you need Windows95 support (shudder), it is a good idea to un-check “LAN Manager” authentication under “Access” as this is generally considered insecure these days.</p>
<p><img src="http://www.irisink.com/img/article_20100125/samba_conf2.png" alt="samba conf 2" /></p>
<p>Samba requires a few ports open on your host firewall to be browseable and accessible.  Under Firewall on the left panel of Server Admin, you’ll need to make sure the following are open for “full-service” Samba:</p>
<ul>
<li>Microsoft Domain Server (445 TCP)</li>
<li>WINS – Windows Internet Naming Service (137 UDP)</li>
<li>NETBIOS datagram – Windows browsing (138 UDP)</li>
<li>SMB/CIFS – Windows file service (139 TCP)</li>
</ul>
<p>Be sure any firewalls upstream are also allowing this traffic to this specific host.  Be conservative on what networks get access, as there have been numerous security issues initiated with breaches on these services.  Some services, such as WINS, may not be necessary for your specific installation.</p>
<p>Now to the Linux server…</p>
<p>On Red Hat systems and many others, the core configuration for Samba is in <code>/etc/samba/smb.conf</code>.  Open this file in your favorite editor.</p>
<p>Under “Network Related Options” enter:</p>
<pre>workgroup = MYCOMPANYGROUP</pre>
<p>Under “Domain Members Options” enter:</p>
<pre>security = domain
encrypt passwords = yes
password server = ODSERVER1</pre>
<p>Under “Share Definitions” enter:</p>
<pre>[mynewshare]
comment = My test share
path = /myshare
writable = yes
browseable = yes
valid_users = @od_group1</pre>
<p>Next, we need to join the Samba server to the PDC.  You’ll need your directory administrator password for this:</p>
<pre>net join –S odserver1 -U diradmin</pre>
<p>Restart your Samba service to bring in the new config.  On Red Hat:</p>
<pre>service smb restart</pre>
<p>To make permissions function cleanly, we’ll want to make our linux server aware of our OD server users.  To do this in Red Hat, you can edit the PAM entries directly, or use one of the available utilities.  We’ll use authconfig-tui here.  Be very careful to restrict access when doing this if you allow authentication from your OD server (via sshd_config, pam, etc) as this will potentially allow anyone in your OD domain to log in to the linux server.  This is most likely not your intended configuration.</p>
<p>Under “User Information”, select “Use LDAP”.  If you want users to log in via other means, under “Authentication”, select “Use Kerberos”.</p>
<p><img src="http://www.irisink.com/img/article_20100125/authconfig1.jpg" alt="authconfig 1" /></p>
<p>Choose “Next”.</p>
<p>Select “Use TLS” (highly recommended, but you need to install the CA cert for your OD server locally on the linux server).</p>
<p>For “Server” enter the url to your ldap server:  ldap://odserver1.mycompany.com/</p>
<p>“Base DN” should be the DN assigned by your Mac OS X Server at install:  dc=odserver1,dc=mycompany,dc=com</p>
<p><img src="http://www.irisink.com/img/article_20100125/authconfig2.jpg" alt="authconfig 2" /></p>
<p>For “Kerberos Settings”:</p>
<p>Realm: ODSERVER1.MYCOMPANY.COM</p>
<p>KDC: odserver1.mycompany.com:88</p>
<p>Admin Server: odserver1.mycompany.com:749</p>
<p><img src="http://www.irisink.com/img/article_20100125/authconfig3.jpg" alt="authconfig 3" /></p>
<p>Finally, we need to make sure the share point /myshare exists and has the right permissions.  If you want everyone in the OD group to be able to be able to edit and share files in the directory, set the sgid bit on the /myshare directory and change ownership to the group od_group1:</p>
<pre>chown nobody:od_group1 /myshare
chmod 2770 /myshare</pre>
<p>If you don’t want users deleting each others’ files, you can also set the suid or “sticky” bit:</p>
<pre>chmod o+t /myshare</pre>
<p>If you are running SELinux in Enforcing mode, you will need to change security contexts on the /myshare directory:</p>
<pre>chcon –t samba_share_t /myshare</pre>
<p>The last step is to ensure the linux server host firewall is allowing smb access, as we did with the OD server above.</p>
<p>&#8212;</p>
<p><strong>About Iris Professional Services</strong><br />
Iris Professional Services is a <a href="http://www.irisink.com/">computer consulting company</a> operating offices in both <a href="http://www.irisink.com/contact/seattle">Seattle</a> and <a href="http://www.irisink.com/contact/portland">Portland</a>. Businesses throughout the Pacific Northwest rely on our expert <a href="http://www.irisink.com/">IT consultants</a> for all their <a href="http://www.irisink.com/services/technology_infrastructure/">network IT support services</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.irisproservices.com/2010/01/26/using-apple%e2%80%99s-open-directory-pdc-to-authenticate-linux-samba-servers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Make some new friends automatically using iChat Server and launchd</title>
		<link>http://blog.irisproservices.com/2010/01/15/make-some-new-friends-automatically-using-ichat-server-and-launchd/</link>
		<comments>http://blog.irisproservices.com/2010/01/15/make-some-new-friends-automatically-using-ichat-server-and-launchd/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 17:41:13 +0000</pubDate>
		<dc:creator>Iain Morris</dc:creator>
				<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://blog.irisink.com/?p=557</guid>
		<description><![CDATA[The iChat Server module in Mac OS X Server provides a great interface to the jabberd daemon, getting you up and running quickly with standard and Kerberos authentication using your Open Directory users.  Unfortunately, there are a few useful features that are not yet accessible in Server Admin.  One of these is a [...]]]></description>
			<content:encoded><![CDATA[<p>The iChat Server module in Mac OS X Server provides a great interface to the jabberd daemon, getting you up and running quickly with standard and Kerberos authentication using your Open Directory users.  Unfortunately, there are a few useful features that are not yet accessible in Server Admin.  One of these is a simple tool for automatically setting everyone to be a buddy with each other.  In smaller organizations, it&#8217;s a great way to get in touch with everyone without having to ask everyone to become a buddy individually.<span id="more-557"></span></p>
<p>The executable for this function is <code>/usr/sbin/jabber_autobuddy</code>.  The documentation says it&#8217;s not intended to be invoked by users directly, but we&#8217;ll do it with a scheduled script here.  <code>jabber_autobuddy</code> is a simple binary that modifies entries in the SQLite database (<code>/var/jabberd/sqlite/jabberd2.db</code>) containing your jabberd users.</p>
<p>First, let&#8217;s create a new script as an administrator called auto_buddy.sh.  To that file, add:</p>
<pre>#!/bin/sh
/usr/sbin/jabber_autobuddy -D -m</pre>
<p>The -D provides some verbose output to keep track of issues, while the -m does the actual &#8220;buddifying&#8221; of the users in your chat user database.</p>
<p>We&#8217;ll need to make this script executable:</p>
<pre>chmod u+x auto_buddy.sh</pre>
<p>Put it in a location where you keep other scripts you like to run, such as <code>/usr/local/bin</code>, or <code>~/bin</code>.</p>
<p>It might seem a bit over the top to make a new script for a single command, but makes things a little more flexible using <code>launchd</code>, as we&#8217;ll see in a moment.</p>
<p>Running this script will make any initialized user in iChat server (any user that has logged in before) a buddy of everyone else.  But what if I want to add a new user?  They won&#8217;t be included until the next run of jabber_autobuddy.  We need to schedule a job for this, and we&#8217;ll do it with Apple&#8217;s preferred scheduler and master process, <code>launchd</code>.</p>
<p>Launchd uses xml plist files to decide what to do.  We&#8217;re going to add a new file to <code>/Library/LaunchDaemons</code> called <code>com.mycompany.autobuddy.plist</code>.</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
   "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;

&lt;dict&gt;
	&lt;key&gt;Disabled&lt;/key&gt;
	&lt;false/&gt;

	&lt;key&gt;Label&lt;/key&gt;
	&lt;string&gt;com.mycompany.autobuddy&lt;/string&gt;

	&lt;key&gt;ProgramArguments&lt;/key&gt;
	&lt;array&gt;
		&lt;string&gt;/private/var/root/bin/auto_buddy.sh&lt;/string&gt;
	&lt;/array&gt;

	&lt;key&gt;KeepAlive&lt;/key&gt;
	&lt;false/&gt;

	&lt;key&gt;StartInterval&lt;/key&gt;
	&lt;integer&gt;1800&lt;/integer&gt;
&lt;/dict&gt;

&lt;/plist&gt;</pre>
<p>Here, I&#8217;m assuming the script <code>auto_buddy.sh</code> will sit in <code>~root/bin</code>, and I want it to execute every 30 minutes (1800 seconds).</p>
<p>The final step is to load the plist file into launchd:</p>
<pre>launchctl load com.mycompany.autobuddy.plist</pre>
<p>You should see your process loaded in launchd with:</p>
<pre>launchctl list | grep autobuddy</pre>
<p>Whenever anyone joins the iChat server for the first time, they are registered in the SQLite database.  Once autobuddy runs in its scheduled window, at the next login, the new user will be buddied up with everyone else in the list.</p>
<p>If you ever want to unload the process from launchd, use:</p>
<pre>launchctl unload com.mycompany.autobuddy</pre>
<p>You will need to do this if you change the StartInterval value.  You might see the value of putting more complex commands in a container script, so you can edit the script without having to unload/load the launchctl plist file each time you change the switches on the ProgramArguments line.  Note that it would seem simpler to just add a cron entry for this process, and you would probably be right.  However, cron is technically deprecated in the latest versions of Mac OS X Server.  My guess is cron isn&#8217;t going anywhere anytime soon, but who knows?</p>
<p>&#8212;</p>
<p><strong>About Iris Professional Services</strong><br />
Iris Professional Services is a <a href="http://www.irisink.com/">computer consulting company</a> operating offices in both <a href="http://www.irisink.com/contact/seattle">Seattle</a> and <a href="http://www.irisink.com/contact/portland">Portland</a>. Businesses throughout the Pacific Northwest rely on our expert <a href="http://www.irisink.com/">IT consultants</a> for all their <a href="http://www.irisink.com/services/technology_infrastructure/">network IT support services</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.irisproservices.com/2010/01/15/make-some-new-friends-automatically-using-ichat-server-and-launchd/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using Mac OS X Server&#8217;s RADIUS service with third-party devices</title>
		<link>http://blog.irisproservices.com/2009/12/18/using-mac-os-x-servers-radius-service-with-third-party-devices/</link>
		<comments>http://blog.irisproservices.com/2009/12/18/using-mac-os-x-servers-radius-service-with-third-party-devices/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 20:15:02 +0000</pubDate>
		<dc:creator>Iain Morris</dc:creator>
				<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[radius]]></category>

		<guid isPermaLink="false">http://blog.irisink.com/?p=378</guid>
		<description><![CDATA[Mac OS X Server builds on well-known and powerful unix tools, tools which are at your full disposal if you understand how they work.  One of these is the FreeRADIUS server included with 10.5 and 10.6 Server.
As is typical of Mac OS X Server, Server Admin makes it easy to add Apple base stations to [...]]]></description>
			<content:encoded><![CDATA[<p>Mac OS X Server builds on well-known and powerful unix tools, tools which are at your full disposal if you understand how they work.  One of these is the FreeRADIUS server included with 10.5 and 10.6 Server.</p>
<p>As is typical of Mac OS X Server, Server Admin makes it easy to add Apple base stations to authenticate against Open Directory using RADIUS.  But what if you want to use the RADIUS server for other devices?  Most decent managed switches and routers can authenticate to RADIUS.  Wouldn&#8217;t it be great to have them authenticate against Open Directory?  Read on.<span id="more-378"></span></p>
<h2>First, what is RADIUS and why do I need it?</h2>
<p>RADIUS stands for Remote Authentication Dial-In User Service.  It is a well-known and heavily-used protocol, most often associated with managed switches, routers, modem pools, and other network devices.  On embedded systems like these, RADIUS is almost always available as a centralized authentication option.  RADIUS provides three important components to your network:  <strong>Authentication</strong>, <strong>Authorization</strong>, and <strong>Accounting</strong>.</p>
<p>WPA/WPA2 pre-shared keys (PSK) are often used for AirPort base stations and other wireless devices.  Everyone uses the same PSK, usually saved in Network Preferences for convenience.  PSKs are considered secure transport, but do not scale well in a large organization.  If an employee is fired or a laptop is stolen, the PSK has to be changed and everyone in the organization has to be made aware of it.  This quickly becomes a problem with more than a few people.  With RADIUS, the employee&#8217;s access is instantly disabled when the account is deactivated in Open Directory, or the employee can change her password if her laptop is stolen.  Much easier!</p>
<p>Centralized authentication and authorization also allows for accounting.  You can see where your employees are accessing your network and when they did it.  Industry compliance requirements often dictate you need to be in control of this information.</p>
<h2>So how do I get my devices talking to my RADIUS server?</h2>
<p>Mac OS X Server comes with a full install of the FreeRADIUS server, a highly configurable and complex server involving a number of config files in /etc/raddb.  When you add a new base station in Server Admin, the data is stored in an SQLite database at <code>/etc/raddb/sqlite_radius_client_database</code>.  However, you don&#8217;t have to insert devices into this database to have RADIUS acknowledge them.  By modifying the file <code>/etc/raddb/clients.conf</code>, you can add additional devices to authenticate.</p>
<p>Here I have added some security appliances sitting at 10.10.3.1 and 10.11.80.1 to clients.conf:</p>
<p style="padding-left: 30px;">
<pre>
client 10.10.3.1 {
   secret        = k34nu3jsogls
   shortname       = parisgw
}

client 10.11.80.1 {
   secret          = 928jv2lkss0df
   shortname       = tokyogw
}
</pre>
<p>On the security devices I simply add the IP address of the RADIUS server as an auth mechanism, include the shared secret I&#8217;ve designated in my clients.conf file, make sure it is connecting to port 1812, and ensure I have a clear path through firewalls to the RADIUS server on this port.  After restarting the RADIUS service on Mac OS X Server, the client will be authenticating to Open Directory.  Great!</p>
<p>But what if I want to limit certain groups to certain devices?  Server Admin only lets you limit a certain group to all basestations in the list.  This is a major limitation.  Perhaps we don&#8217;t want our Paris users to be able to use the Tokyo service.  Or perhaps only IT administrators should be able to access the admin areas on switches.  By adding some entries to the huntgroups file, you can solve this problem:</p>
<p style="padding-left: 30px;">
<pre>
paris   NAS-IP-Address == 10.10.3.1
           Group = france_users,

tokyo   NAS-IP-Address == 10.11.80.1
            Group = japan_users,

switch01928    NAS-IP-Address == 10.11.20.3
              Group = net_admin,
</pre>
<p>Where france_users, japan_users, and net_admin are OD groups with the members you wish to access the access point.</p>
<p>This is only the tip of the iceberg with FreeRADIUS configuration.  Apple has made a big step towards making it accessible to non-propeller-heads.  But with a little extra legwork, you can make the service much more valuable and flexible to your organization.  Happy authenticating!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.irisproservices.com/2009/12/18/using-mac-os-x-servers-radius-service-with-third-party-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallels Server for Mac &#8211; Roll your own snapshots with prlctl</title>
		<link>http://blog.irisproservices.com/2009/01/26/parallels-server-for-mac-roll-your-own-snapshots-with-prlctl/</link>
		<comments>http://blog.irisproservices.com/2009/01/26/parallels-server-for-mac-roll-your-own-snapshots-with-prlctl/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 21:48:21 +0000</pubDate>
		<dc:creator>Iain Morris</dc:creator>
				<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://blog.irisink.com/?p=246</guid>
		<description><![CDATA[Here's a simple script for taking snapshots of your VMs in Parallels Server for Mac]]></description>
			<content:encoded><![CDATA[<p>The 8-core Xserve platform has often seemed overpriced and overkill for many IT server applications that require less performance, but must have server isolation for industry compliance, security, and high availability.  Parallels has made a welcome step forward in virtualization on the Xserve platform, with <strong>Parallels Server for Mac</strong>.  For an initial release, it has proven quite dependable despite a few issues with recent X Server updates.  No doubt this product will continue to improve in the near future, and it&#8217;s exciting to see the Xserve hardware used more efficiently.</p>
<p><span id="more-246"></span></p>
<p>One feature missing from the initial Server release is the ability to perform VM snapshots of both disk and memory within the admin application.  There&#8217;s no easy way to schedule jobs out for automation in a backup strategy.  Parallels Desktop 4 has this functionality, but it has yet to show up in the Server product.  One solution is to roll your own snapshot system using the command line tool /usr/bin/prlctl and a bit of scripting.  A few people out there have started making their own backup systems using prlctl, and here is only one example of what you can do with this tool.</p>
<p>I&#8217;ve attached a basic perl script that calls the prlctl tool to get a list of all active VMs, suspend each VM (which dumps a copy of memory to the disk to resume), copy the full VM to a new location of your choosing and optionally compress, date-stamp, and archive, and finally resume the VM after copy.</p>
<p>I&#8217;ve added a flag in the script to compress the image into a date-stamped archive if I choose to, though this adds some time to the copy and subsequent restoration of the archive.  I have found it saves a considerable amount of disk space, which could make a difference for your backup times to a network volume or tape.  The entire process leaves the VM suspended for under 10 minutes on my storage systems.  You will need to decide for yourself what is considered acceptable downtime to get the snapshot.  The archives are obviously quite large, so it may be best to do the wholesale VM copy in your weeklies, while getting client VM system-level copies daily.  These are big files!  However, if you forgo compression, you can be up and running on new hardware literally within seconds, with an identical point-in-time of your virtual host.</p>
<p>This particular script uses ditto to archive as a .cpz and make the transfer, but rsync or a gzipped tar setup would work just as well.</p>
<p>I&#8217;m sure there are some tricks to be made with your company&#8217;s backup solution to get incrementals of the full copy over time, but that can be left as an (easy) exercise for the reader, as every environment has its own circumstances.  Time Machine increments come to mind as a cool option.</p>
<p>Once you have your script dialed in, throw it into your crontab, or better yet, build a launch daemon plist file for it and load it in with launchctl (interestingly, cron is considered depreciated in Mac OS X these days).  All backups should be automated, even if they only run once a week or month.</p>
<p>Here&#8217;s an example of com.yourcompany.vmsnapshot.plist, which should execute your backup at 9pm nightly (the script will need to be executable):</p>
<pre>bash-3.2# cat com.yourcompany.vmbackup.plist
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
        &lt;key&gt;Disabled&lt;/key&gt;
        &lt;false/&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;com.yourcompany.vmbackup&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;/private/var/root/bin/vm_backup.pl&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;KeepAlive&lt;/key&gt;
        &lt;false/&gt;
        &lt;key&gt;StartCalendarInterval&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;Hour&lt;/key&gt;
                &lt;integer&gt;21&lt;/integer&gt;
                &lt;key&gt;Minute&lt;/key&gt;
                &lt;integer&gt;0&lt;/integer&gt;
        &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p>Copy this file to your /Library/LaunchDaemons directory, and launchctl load com.yourcompany.vmbackup.plist.  Do a quick confirmation with launchctl list | grep vmbackup, and you should be good to go.</p>
<p>Feel free to adapt and expand as you need, but please remember this is just a suggestion, not a released backup product!  The utility prlctl provides error codes, so some basic error checking would be a good addition here.  We would love to see this expanded and improved, so post back with any additions or changes!  Happy virtualizing.</p>
<p><a href="http://blog.irisink.com/wp-content/uploads/2009/01/vm_backuppl.zip">vm_backup.pl</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.irisproservices.com/2009/01/26/parallels-server-for-mac-roll-your-own-snapshots-with-prlctl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leopard Server Stuck in Server Assistant Mode</title>
		<link>http://blog.irisproservices.com/2007/12/23/leopard-server-stuck-in-server-assistant-mode/</link>
		<comments>http://blog.irisproservices.com/2007/12/23/leopard-server-stuck-in-server-assistant-mode/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 21:06:00 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Mac OS X Server]]></category>

		<guid isPermaLink="false">http://blog.irisink.com/?p=126</guid>
		<description><![CDATA[If after an update is applied to Mac OS X 10.5.x Server you find yourself unexpectedly looking at Server Assistant upon restart you might try this to get your server backup to normal. At least in my case this problem was solved by doing the following:

Start up in Single User mode by holding down the [...]]]></description>
			<content:encoded><![CDATA[<p>If after an update is applied to Mac OS X 10.5.x Server you find yourself unexpectedly looking at Server Assistant upon restart you might try this to get your server backup to normal. At least in my case this problem was solved by doing the following:</p>
<p><span id="more-126"></span></p>
<p>Start up in Single User mode by holding down the Command and S keys at boot, then run these commands:</p>
<pre><code>/sbin/mount -uw /
rm /var/db/.SoftwareUpdate*
reboot</code></pre>
<p>You can also delete the problem files by logging into the server via SSH and executing the rm command, provided that you still have SSH turned on of course. </p>
<p>Under some circumstances when a software update fails for any reason under Leopard and Leopard Server it appears to not properly remove the /var/db/.SoftwareUpdateAtLogout and /var/db/.SoftwareUpdateOptions files. If those files are present they can cause Leopard Server to invoke the Server Assistant mode at startup. Force quitting the Server Assistant just causes the Server Assistant to relaunch. Instead boot into single user mode and delete the offending files. </p>
<p>/var/db/.SoftwareUpdateOptions appears to be an XML-formatted .plist with settings for Software Update while /var/db/.SoftwareUpdateAtLogout is just an empty file which if present causes the system to run Software Update and install any pending updates at next logout or restart. Why these files are causing Leopard Server to start up in Server Assistant is beyond me but is almost certainly a bug. There is another file in /var/db called .AppleSetupDone which if missing will cause Mac OS X to run the Setup Assistant/Server Assistant once upon startup, this bug is reminiscent of that &#8216;feature.&#8217;</p>
<p>This fix was inspired by Mark Douma&#8217;s post and fix for the same issue happening to Leopard client in the <a href="http://discussions.apple.com">Apple Discussion Forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.irisproservices.com/2007/12/23/leopard-server-stuck-in-server-assistant-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Map &#8220;Network Drives&#8221; on Mac OS X Part 1.</title>
		<link>http://blog.irisproservices.com/2007/05/28/map-network-drives-on-mac-os-x-part-1/</link>
		<comments>http://blog.irisproservices.com/2007/05/28/map-network-drives-on-mac-os-x-part-1/#comments</comments>
		<pubDate>Mon, 28 May 2007 21:00:32 +0000</pubDate>
		<dc:creator>Zack Smith</dc:creator>
				<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://blog.irisink.com/?p=8</guid>
		<description><![CDATA[ Updated: 6/6/2007  I added some Apple script for all you Googlers. 
First a little background: for a while now I have been teaching about &#8220;URL Fun&#8221; in my server classes. Its a pretty universal concept that you find server admins implementing on Mac OS X clients: the idea of an alias, link, script [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong> Updated: 6/6/2007 </strong> I added some Apple script for all you Googlers. </em></p>
<p>First a little background: for a while now I have been teaching about &#8220;URL Fun&#8221; in my <a href="http://www.themacstore.com/macu/techclasses.php" target="_blank">server classes</a>. Its a pretty universal concept that you find server admins implementing on Mac OS X clients: the idea of an alias, link, script or application that connects to a server on login. The windows folks normally refer to this conceptually as a &#8220;Mapped Network Drive&#8221; which is why I choose it for the name of this article. I actually find it humorous how often I get asked to make a link to the &#8220;x&#8221; or &#8220;q&#8221; drive when doing consulting, its actually a testment to how simple this works on windows, people have no idea of the shares name, just the drive letter ( for better or worse sometimes ). Now there are multiple ways of accomplishing this on OS X ,some are better or fancier then others. All of them try at best to get around requiring users to use <a href="http://docs.info.apple.com/article.html?artnum=151664" target="_blank">&#8220;Go&#8221; &gt; &#8220;Connect To Server&#8221;</a></p>
<p>Part 1: <strong><a href="http://blog.irisink.com/?p=8">&#8220;Aliases&#8221; and &#8220;Location&#8221; Files</a></strong></p>
<p>Part 2: <strong>AppleScript and Login items</strong></p>
<p>Part 3:<strong> Shell Scripts and Login Hooks</strong></p>
<p>Part 4: <strong>Automounts with Directory Services</strong><span id="more-8"></span></p>
<p style="text-align: left"><strong>Lets take a look at some of the more basic &#8220;Alias&#8221; implementations</strong></p>
<p> The most common and <a href="http://docs.info.apple.com/article.html?artnum=106729" target="_blank">recommend</a> method I see in the field is by dragging a drive&#8217;s icon ,mounted on the Desktop ( or <a href="file:///Volumes/">/Volumes</a> ) to the &#8220;System Preferences&#8221; &gt; &#8220;Accounts&#8221; &gt; &#8220;Login Items&#8221; for the respective user account. Whats going on behind the scenes is that the alias &#8220;data&#8221; that would normally exist in the resource fork of the filesystem has been inserted in to the &#8220;AliasData&#8221; key nested within the &#8220;AutoLaunchedApplicationDictionary&#8221; array of your users ~/Library/Preferences/loginwindow.plist file.<em> There is actually one of these stored in the local <a href="file:///Library">/Library</a> as well but we will cover that in part 2. You can view this &#8220;data&#8221; by runnning the following command ( type it in as you see it i.e. line break aka the &#8220;return&#8221; key is escaped by the &#8220;\&#8221;  or get rid of the &#8220;\&#8221; and type it on one line.) Also some of the code in this article can be dowloaded by clicking on it.</em><a href="files/commands/defaultsreadaadict.zip"><code>defaults read ~/Library/Preferences/loginwindow \AutoLaunchedApplicationDictionary</code></a>In the output you will see the encoded alias data which is, if you make aliases this way in the finder you can view similar data or the  <a href="http://en.wikipedia.org/wiki/Resource_fork" target="_blank">resource fork</a> in the file system using the &#8220;special&#8221; path &#8220;foobar/..namedfork/rsrc&#8221; ( &#8220;foobar/rsrc&#8221; works as well but its deprecated) I find this data easiest to look at with &#8220;<a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/less.1.html" target="_blank">less</a>&#8221; or &#8220;<a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/strings.1.html" target="_blank">strings</a>&#8221; but its mostly meaningless to us humans.<code>less -f /path/to/myalias/..namedfork/rsrc ; reset</code>or to just see the ASCII strings<code>strings /path/to/myalias/..namedfork/rsrc</code>or if you have the developer tools installed you can use <a href="http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man1/DeRez.1.html" target="_blank">DeRez</a><code>/Developer/Tools/DeRez /path/to/myalias </code>This is normally the point where I ask people how many times they have seen a broken alias. Before you answer, I don&#8217;t want to chase any red hearings, aliases are not broken when you see the following behavior ( pictured below ) in your login items preferences pane.</p>
<p style="text-align: center"><img src="http://blog.irisink.com/wp-content/uploads/2007/05/loginmounted.png" alt="Login Mounted" /></p>
<p>This happens because the system can&#8217;t load the icon ( and kind ) when the volume is unmounted. So when the server volume is unmounted you will see the bottom example always. Because of this login aliases are very hard to troubleshoot as their content is encoded and they look the same when they are broken as they do when the are working (and unmounted). Feature or bug i&#8217;ll let you be the judge.</p>
<p style="text-align: center"><img src="http://blog.irisink.com/wp-content/uploads/2007/05/loginunmounted.png" alt="Login Unmounted" /></p>
<p>There are alot of reasons a &#8220;break&#8221; can happen but often the most common is in fact the simplest. When you created this alias data, quite a bit of infomation relating to how you orginally connected to the server is stored. Especially if you used the <a href="file:///Network/" target="_blank">Network Browser</a> then it was based around whatever broadcast protocol was being used to propagate the list at that moment, or if you used the &#8220;Go&#8221; &gt; &#8220;Connect to Server&#8221; ( Command + K ) in the Finder there where multiple ways it could be resolving the address of our server in the alias.such as the following( For fun I have added code snippets if you dont know your server&#8217;s value )</p>
<p style="text-align: center">&nbsp;</p>
<p style="text-align: center"><img src="http://blog.irisink.com/wp-content/uploads/2007/05/connectionfalied.png" alt="Connection Failed" /></p>
<p> The Bonjour (Rendevous) Name:<br />
o
<li>server.local</li>
<p><a href="files/commands/getlocalsubnetname.zip"><code>sudo /usr/sbin/systemsetup -getlocalsubnetname </code></a><em> add .local to the end and this is your <a href="http://en.wikipedia.org/wiki/Multicast_DNS" target="_blank">mDNS</a> aka your Bonjour name </em>Graphically &#8220;System Preferences&#8221; &gt; &#8220;Sharing&#8221; &gt; &#8220;Edit&#8221; Button (shown below )<img src="http://blog.irisink.com/wp-content/uploads/2007/05/bonjourname2.png" alt="Bonjour Name" />The Fully Qualified Domain Name of your server:<br />
o
<li>server.example.com</li>
<p><a href="files/commands/hostname.zip"><code> /bin/hostname # shows the primary hostname only </code></a><code> /usr/bin/host 10.1.0.1 </code><code> /usr/bin/host 206.163.40.59 </code><em> You could have many other hostnames and in fact we are looking up the &#8220;reverse&#8221;(PTR) record, but hopefully that will map back to a &#8220;forward&#8221;(A) record. </em>The IP address (internal, external, multi-homed, etc.):<br />
o
<li>192.168.0.1</li>
<p><a href="/files/commands/ifconfiggrepinet.zip"><code> /sbin/ifconfig | /usr/bin/grep inet </code></a></p>
<p><em>systemsetup and networksetup do exist on client, they are just in a different <a href="file:///System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/">place</a> : /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/</em>This basically means how you orginally connected to the server is how the alias will attempt to connect for then on in. If your servers values never changes this is still a good practice right? Well unfortunately not always no, on top of your servers connection address you might also be injecting a default user name (i.e. the username of the authenticated user who orginally connected to the share that the alias was created from). I for instance saw this at a school district , every local &#8220;student&#8221; account would open the server connection using the orginal admin&#8217;s username (who had created the NetRestore image) already filled in. Bit of hinderance having to blank it out and fill your username wouldnt you say?<em> You actually can control this behavior</em><em> using a preference key outline in <a href="http://docs.info.apple.com/article.html?artnum=303796&amp;coll=cp" target="_blank">this </a> . Its also worthy of note that a proper kerberos setup should prevent this behavior, as you will only be allowed to auth as the <a href="http://docs.info.apple.com/article.html?path=ServerAdmin/10.4/en/c3fs3.html" target="blank">Kerberos</a> user in the case of at least <a href="http://developer.apple.com/documentation/mac/Networking/Networking-223.html" target="blank">AFP</a></em>Before we go through how not to do that lets quickly look at a scenario where you might in fact want to embed say &#8220;guest access&#8221; credentials in the alias. If when originally connecting we use Go Connect To Server, most of this information will be based on the URL we use to connect to the server.for <a href="http://www.ietf.org/internet-drafts/draft-crhertel-smb-url-12.txt" target="_blank">SMS/CIFS URI&#8217;s</a> this is normally just &#8220;guest@&#8221;:<code> smb://guest@server.example.com </code>For AFP Guest access its a little bit different idea as you can (in 10-10.4 at least) have a user actually named &#8220;guest&#8221;, so guest@ wont work,so there is a special string for this commonly found in the mount records (mentioned in later sections of this article) you can use.<code> afp://;AUTH=NO%20USER%20AUTHENT@server.example.com </code>you can in fact embed a password in using this method for many protocols such as AFP, SMB, and FTP  (even SFTP by way of <a href="http://www.panic.com/transmit/" target="_blank">Transmit.app</a> and other 3 party apps ), Perhaps you have a generic login for &#8220;guest&#8221; type access (not the you would ever do that right <img src='http://blog.irisproservices.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) .<code> afp://genericlogin:password@server.example.com/Share </code><code> smb://DOMAIN;user:pass@server.example.com/SHARE </code>Obviously this is not a secure practice unless you know exactly what your doing but as you can see you can make your aliases with more specific information using this method.Now while this would solve some issues in a small environment but it doesn&#8217;t scale well, imagine having to do this for all users in a large network.</p>
<p style="text-align: left"><strong>Internet Location Files: A good first step and a &#8220;Classic&#8221; trick</strong></p>
<ol>Even if you connect omitting the user@ field the alias will still embed it in its connection data,so as an alternative method we can use Internet Location Files. these come in many variations.Creating them is also pretty easy once you learn how. And they have been around along time too and thus are very compatible.</ol>
<p style="text-align: left">Type in the URL in to a new <a href="file:///Applications/TextEdit.app">TextEdit.app</a> Document</p>
<p> <em>If you use spaces in your servers share names (shame on you ) remember to substitute those with &#8220;%20&#8243; i.e. afp://server/My%20Spaced%20Share%20Name</em></p>
<p style="text-align: left">Highlight the text</p>
<p>(if your like me and double click it to highlight, make sure to click once more at the next step. )</p>
<p style="text-align: left">Click and hold on top on the highlighted text until your cursor changes to an &#8220;Arrow&#8221;</p>
<p style="text-align: left">Now drag it out on to your Desktop.</p>
<p><em> I have found people sometimes have problems with this so read below for a non drag &#8216;n drop way using &#8220;Go&#8221; -&gt; &#8220;Connect to Server&#8221; </em></p>
<p style="text-align: left">Depending on the type of URL you typed in you will have created one of the following Location files and corresponding URLs.</p>
<p><strong>foobar.fileloc</strong> <em> a file system URL file:// </em></p>
<p><strong>foobar.afploc </strong><em> an AFP server URL file afp:// </em></p>
<p><strong>foobar.inetloc </strong><em> a Server Message Block (CIFS) URL </em></p>
<p><strong>foobar.webloc </strong><em> a HTTP URL, (not WEBDAV) </em></p>
<p><strong>foobar.ftploc </strong><em> a FTP URL (Finder is read only from the UI)</em><em> There are others as well, but for our purposes this is what we probably want to mount </em></p>
<p>You can also even make them directly from a website&#8217;s links depending on your browser, here is one for &#8211;&gt; <a href="file:///Applications/">Applications</a> &lt;&#8211; that uses the <em>file://</em> URL type If you drag it (the word &#8220;Applications&#8221;) out onto your Desktop you will see a file created called &#8220;Application.fileloc&#8221;, and yes I know you cant click on it from within the browser ( as you might have noticed from my others above and through the rest of this article ) , but you can also drag it to the location bar making it almost as easy to launch.<em>if you dont see the file extention (which is the default) you can <a href="http://www.fileinfo.net/help/mac-show-extensions.html" target="_blank">enable</a> file extentions from the Finder.app&#8217;s &#8220;Finder&#8221; menu (next to the Apple) under &#8220;Preferences&#8221; &gt; &#8220;Advanced&#8221; &gt; &#8220;Show all file extentions&#8221;.</em> or use, <a href="/files/commands/AppleShowAllExtensions.zip"><code> defaults write -g AppleShowAllExtensions -bool YES </code></a>Then if your finder is free to be killed ( i.e. not coping important CEO files ) you can use the following to apply the change<code> killall -HUP Finder </code>You should be able to double click on it and viola there is your Application folder. <em> </em><em> As a cool note many email clients like Mail.app and Entourage with parse these such links natively  ( unlike your browser in the case of file://) making it a cinch to tell your users about a hard to find path like <a href="file:///System/Library/CoreServices/Kerberos.app">file:///System/Library/CoreServices/Kerberos.app</a> </em><em> You can also customise what application handles these URLs with <a href="http://www.macupdate.com/info.php/id/14618" target="_blank">RCDefaultApp</a> a graphical LaunchServices Preference Pane.</em></p>
<ol>
<p style="text-align: center" align="center"><img src="http://blog.irisink.com/wp-content/uploads/2007/05/afp_inte_loc_file.png" alt="Internet Location File" /></p>
</ol>
<p class="p1">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</p>
<p class="p1">&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple Computer//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;</p>
<p class="p1">&lt;plist version=&#8221;1.0&#8243;&gt;</p>
<p class="p1">&lt;dict&gt;</p>
<p class="p1"><span class="Apple-tab-span"></span>&lt;key&gt;URL&lt;/key&gt;</p>
<p class="p1"><span class="Apple-tab-span"></span>&lt;string&gt;afp://afp.example.com&lt;/string&gt;</p>
<p class="p1">&lt;/dict&gt;</p>
<p class="p1">&lt;/plist&gt;</p>
<p>These files are infact the same type that are created by adding a favorite in the &#8220;Go&#8221; -&gt; &#8220;Connect to Server&#8221; dialog box (the little plus sign), they are then stored in ~/Library/Favorites folder. The only exception is the &#8220;Server Address: &#8221; box itself which can be configured with the following command.<code>defaults write ~/Library/Preferences/com.apple.finder \FXConnectToLastURL 'afp://files.example.com/data' </code></p>
<p align="left"> You can in fact add your own items to this menu by way of making these location files and adding them to the folder ( They are greyed out but they work ). If you don&#8217;t specify a user@ then they will default to using the console users &#8220;RealName&#8221; sometime&#8217;s referred to as the &#8220;Long Name&#8221;. If that doesn&#8217;t suite your environment you can put bogus info in here like <code> afp://FILLINYOURUSERNAME@server.example.com/Public </code>To see or script the RealName value for a local user you can use dscl like this:<code> dscl . -read /users/$USER RealName </code> For a network LDAP user you can use:<code>dscl /LDAPv3/iduro.wallcity.lan -read /Users/$USER RealName </code>Or for an Active Directory user:<code> dscl /Active\ Directory/All\ Domains/ -read /Users/$USER RealName </code></p>
<p align="left"> Now that we have files that we can embed specific connection data into, but how do we deploy them? Well as you might guess these can the be added as login items, the only problem is that they will not be embeded in the preference file like they alias data was, they instead will path names to the &#8220;flat&#8221; file locations.  I like to add them to the login items and keep the orginating items in ~/Library/Favorites .The only real problem I have with this is that fact if the user deletes the orginal file , the login item reference is broken. One easy way to stop that from happening is to &#8220;lock&#8221; the favorites so that they cant easily be deleted through &#8220;Go&#8221;-&gt;&#8221;Connect to Server&#8221;, You can do the from the command line for all favorites:</p>
<p><code> chflags uchg ~/Library/Favorites/* </code>or to reverse (unlock) the flag you can use &#8220;no&#8221;, also you can replace the star with a file name if you want to only effect a particular file in the folder.<code> chflags nouchg ~/Library/Favorites/* </code>This will affect only the current set , so users can add remove additional items. You can turn this flag on and off from the finder as well from the File&gt;Get Info ( Command + I ) window.</p>
<p style="text-align: center"><img src="http://blog.irisink.com/wp-content/uploads/2007/05/lockeditem.png" alt="Locked Item" /></p>
<p align="left">If you dont want to deal with &#8220;locking&#8221; then another trick is to hide these files from your users by placing them in a &#8220;dot&#8221; folder</p>
<p><code>mkdir ~/Documents/.LoginItems </code><code>mv ~/Desktop/my.afploc ~/Documents/.LoginItems/ </code><code> open ~/Documents/.LoginItems</code><em> only use &#8220;<a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/mv.1.html" target="_blank">mv</a>&#8221; in 10.4 or later as older styles of these files had important resource fork&#8217;s and older versions of mv did not move them. You can just drag and drop in the finder if you like.</em>That last &#8220;<a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/open.1.html" target="_blank">open</a>&#8221; bit is to open the &#8220;hidden&#8221; folder in the finder . This will prevent all but the savy from easily deleting these items most days. <em> You could just as easily use &#8220;Go&#8221; -&gt; &#8220;To Folder&#8221; </em> or from the keyboard: &#8220;Command + Shift + G&#8221; and drag and drop.You could also put them into a folder in the &#8220;local domain&#8221; such as the local <a href="file:///Library/Application%20Support/">/Library/Application Support/</a>.</p>
<p align="left"> If you use <a href="http://www.apple.com/remotedesktop/" target="_blank">ARD</a> you can automate this process with an Apple Script. Here is a pretty basic Apple Script that has been wrapped in whats known as a &#8220;<a href="http://en.wikipedia.org/wiki/Here_document" target="_blank">here</a>&#8221; document then executed by <a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/osascript.1.html" target="_blank">osascript</a></p>
<p><code> osascript &lt;&lt; EOF </code><code>tell application "System Events" </code><code>make new login item at end of login items with properties  </code><code>{path:"/Library/Application Support/Irisink/Foobar.afploc"} </code><code>end tell </code><code> EOF </code><em> Note: the user has to be logged in for this to work</em></p>
<p>The only real downside of the files that we have not covered is that they won&#8217;t always allow work due to the Network not being active at time of login ( Think Wireless, <a href="http://en.wikipedia.org/wiki/Spanning_tree_protocol">Spanning Tree</a> etc ),So in our next section of this article we will turn our 6 line Apple Script into a 60 line version with pretty dialog boxes, fault tolerance and an artificial delay.So stay tuned for Part 2 of this series:<strike><strong><a href="http://blog.irisink.com/?p=23" target="_blank">AppleScript and Login items</a></strong></strike></p>
<p>Here is a quick taste of how to make an Applescript Login Item to mount multiple drives at the same time, and put in an  artificial delay so we don&#8217;t timeout.First open up the <a href="file:///Applications/Applescript/Script%20Editor.app%3Cbr%3E%3C/a%3E">/Applications/Applescript/Script Editor.app </a>Add the following two lines: <em> Click the code to open it up in Script Editor </em> <a href="applescript://com.apple.scripteditor?action=new&amp;script=delay%205%20%2D%2D%20I%20like%20to%20put%20a%205%2D10%20second%20delay%20in%0Dmount%20volume%20%22smb%3A%2F%2Fuser%40allthestuffabove%2Ecom%2FShare%22%0D%0D"><code> delay 5 -- I like to put a 5-10 second delay in </code><code> mount volume "smb://user@allthestuffabove.com/Share" </code></a></p>
<p>You can continure to add <em><strong>mount volume</strong></em> lines,for any shares using the conventions above.<a href="applescript://com.apple.scripteditor?action=new&amp;script=delay%205%20%2D%2D%20I%20like%20to%20put%20a%205%2D10%20second%20delay%20in%0Dmount%20volume%20%22afp%3A%2F%2Fuser%40allthestuffabove%2Ecom%2FPublic%22%0D"><code> mount volume "afp://user@allthestuffabove.com/Public" </code></a>Those of you using <a href="http://www.thursby.com/products/admitmac.html" target="blank">ADmitMac</a> may want to instead use the <strong><em>open location</em></strong> syntax:<a href="applescript://com.apple.scripteditor?action=new&amp;script=delay%205%20%2D%2D%20I%20like%20to%20put%20a%205%2D10%20second%20delay%20in%0Dopen%20location%20%22cifs%3A%2F%2FDOMAIN%3Buser%40allthestuffabove%2Ecom%2FPublic%22"><code> open location "cifs://DOMAIN;user@allthestuffabove.com/Public" </code></a>When you are done, run your script to make sure it delays and then connects to all the share points listed. Once you have verfied it will workChoose File -&gt; Save Asand choose &#8220;Application Bundle&#8221; from the &#8220;File Format:&#8221; Pop-Up</p>
<p><center><img src="http://blog.irisink.com/wp-content/uploads/2007/06/scripteditor.png" alt="Script editor." /></center>Save wherever you like, perhaps using the ~/Documents/.LoginItems idea above and add to the Login Items for the User in System Preferences &gt; Accounts &gt; Login Items. When this app loads at login it shows up in the dock and then goes away, I dislike this behaviour so I like to make the application a hidden application using the following <code> defaults write /path/to/Login.app/Contents/Info LSUIElement "1"</code><br />
If you would like to be able to use these applications in environments where you are using MCX or parental controls you must also specify a unique identifier.<br />
<code>defaults write /path/to/Login.app/Contents/Info CFBundleIdentifier "org.wallcity.myloginapp"</code><em> beware the line break and insert a space </em>
<p><em>If would you like to <a href="javascript:(function(){var%20a=window,b=document,c=encodeURIComponent,d=a.open(%22http://blog.irisink.com/zack/index.html%22,%22widget_popup%22,%22left=%22+((a.screenX||a.screenLeft)+10)+%22,top=%22+((a.screenY||a.screenTop)+10)+%22,height=680px,width=380px,resizable=1,alwaysRaised=1%22);a.setTimeout(function(){d.focus()},300)})();">contact me</a> with comments or inaccuracies about this article, feel free but support requests will be ignored unless you would like to sign up for <a href="http://www.irisink.com/contact.php">Iris Professional Services service</a>. Thanks  </em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.irisproservices.com/2007/05/28/map-network-drives-on-mac-os-x-part-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Setting up awstats for Mac OS X Server</title>
		<link>http://blog.irisproservices.com/2007/05/07/setting-up-awstats-for-mac-os-x-server/</link>
		<comments>http://blog.irisproservices.com/2007/05/07/setting-up-awstats-for-mac-os-x-server/#comments</comments>
		<pubDate>Tue, 08 May 2007 06:23:50 +0000</pubDate>
		<dc:creator>Chris Williams</dc:creator>
				<category><![CDATA[Mac OS X Server]]></category>

		<guid isPermaLink="false">http://blog.irisink.com/?p=5</guid>
		<description><![CDATA[If you are using Mac OS X Server to host websites, you might want to be able to track how many folks are hitting your websites. One popular and free web statistics package is awstats. 
Read on to find out how to setup awstats on Mac OS X Server.

This article discusses Mac OS X Server [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using Mac OS X Server to host websites, you might want to be able to track how many folks are hitting your websites. One popular and free web statistics package is <a href="http://awstats.sourceforge.net/">awstats</a>. </p>
<p>Read on to find out how to setup awstats on Mac OS X Server.</p>
<p><span id="more-5"></span><br />
This article discusses Mac OS X Server version 10.4. </p>
<p><strong>Modify your logs</strong><br />
oYou should change your log format to one that contains more information than the default common format, and if you host more than one site you should tell the web server (Apache) to split out the logging so each site gets its own log. </p>
<p>  -In Server Admin, go to the Web section then the Settings section. Click on the Sites tab and open the details for the site you are setting up awstats for. Once there click on the Logging tab. Make sure that &#8216;Enable Access log&#8217; is checked. In the Location field for the Access log edit the log name so it contains the name of your site. For example, if it said &#8216;/var/log/httpd/access_log&#8217; before, change it to &#8216;/var/log/httpd/[your site name]_access_log&#8217; </p>
<p>  -while you are there, change the log format to &#8216;combined&#8217;</p>
<p><a href='http://blog.irisink.com/wp-content/uploads/2007/05/log_config_sm.jpg' title='Server Admin log config'><img src='http://blog.irisink.com/wp-content/uploads/2007/05/log_config_sm.jpg' alt='Server Admin log config' /></a></p>
<p><strong>Setting up awstats on Mac OS X Server </strong><br />
o</p>
<p><a href="http://awstats.sourceforge.net/#DOWNLOAD">Download</a> the latest version of awstats (grab either the .zip or .tar.gz files) </p>
<p>Create a folder called awstats in your web documents folder, which is by default in /Library/WebServer. If you are keeping your web documents elsewhere, create your awstats directory there instead. The important thing is that the awstats folder be a subfolder of a web share. </p>
<p>Unpack the download, then place the contents in your awstats folder.</p>
<p>In Terminal, navigate to the tools subfolder of the awstats directory that you created. Next, run the awstats configure script by running ./awstats_configure.pl and answer the questions.<br />
o-look for the section that asks you to define the config file name. Put your web site URL there (i.e. www.example.com) and take note of what you entered. A config file that you will need to edit later will be created with the name awstats.[your config name].conf in your awstats/wwwroot/cgi-bin/ directory.</p>
<p>You will likely need to edit your configuration file, awstats.[your config name].conf. The configuration files are well documented.</p>
<p>Edit the configuration file in your favorite text editor (vi, emacs)<br />
look for the following lines and put in the appropriate values:</p>
<ul>
o
<li>-LogFile=&#8221;[path to the access log that you specified above]&#8220;</li>
<p>  -default log format is Apache combined so as long as you chose that above you should be okay</p>
<p>o
<li>-SiteDomain=&#8221;[your site name]&#8220;</li>
<p>o
<li>-DirData=&#8221;.&#8221;</li>
<p>  -this is where awstats will put the database of site visitation data. Putting a &#8220;.&#8221; here will tell awstats to store its data in the same directory as the awstats.pl file.
</ul>
<p>o<br />
<strong>Schedule awstats to update your statistics</strong></p>
<p>There are several ways you can do this. Mac OS X Server already runs maintenance scripts each night. You can insert the awstats update script into the maintenance script by editing /etc/periodic/daily/600.daily.server </p>
<p>Insert these commands below the line containing &#8220;log_message(&#8220;Starting.&#8221;);&#8221;</p>
<p><code>log_message("update awstats web monitoring statistics");<br />
\`/Library/WebServer/awstats/wwwroot/cgi-bin/awstats.pl -update -config=[config file name]\`;</code></p>
<p>Test out your awstats page by going to http://[your domain name]/awstats/awstats.pl?config=[config file name] in your web browser. The statistics will be updated every morning at 3:15am when your server maintenance periodic scripts normally run. </p>
<p><a href="http://ns3744.ovh.net/awstats/awstats.pl?config=destailleur.fr">awstats sample</a></p>
<p><strong>Bonus: setup geoip country location. </strong></p>
<p>Awstats can display what country your visitors are hailing from if you enable the geoip plugin. </p>
<p>First you must install the Geo::IP::PurePerl module. You can do this using CPAN, the Perl module download and installation utility. Before you can use CPAN you must have XCode installed on your system and you will need to configure CPAN first which it will prompt you to do when you run it for the first time. After you have those dependancies out of the way, issue this command:</p>
<p><code>perl -MCPAN -e 'install Geo::IP:PurePerl'</code></p>
<p>Next you should download the free IP to country database from <a href="http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz">Maxmind</a> and place it somewhere on your system. The awstats directory is one logical place for it.</p>
<p>Now edit the awstats config file for your site. Locate this line and uncomment it by removing the # and put in the correct path to the GeoIP.dat file you just downloaded.</p>
<p><code>#LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"</code></p>
<p>Refresh your awstats page to see your handywork!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.irisproservices.com/2007/05/07/setting-up-awstats-for-mac-os-x-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
