<?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"
	>

<channel>
	<title>Three till Seven &#187; OS X</title>
	<atom:link href="http://www.3till7.net/category/techy/os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.3till7.net</link>
	<description>A geek's personal domain.</description>
	<pubDate>Sat, 16 Aug 2008 19:09:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>make your Mac listen up</title>
		<link>http://www.3till7.net/2008/02/04/make-your-mac-listen-up/</link>
		<comments>http://www.3till7.net/2008/02/04/make-your-mac-listen-up/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 23:21:02 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2008/02/04/make-your-mac-listen-up/</guid>
		<description><![CDATA[I'm so tickled I can't stand it.  All right, so Speech Recognition stuff on a Mac is pretty darn cool by itself, but now I've got a nice Apple Script that opens up Safari with various tabs of my favorite sites, and it does this when I tell my Macbook "Get on it."  [...]]]></description>
			<content:encoded><![CDATA[<p>I'm so tickled I can't stand it.  All right, so Speech Recognition stuff on a Mac is pretty darn cool by itself, but now I've got a nice Apple Script that opens up Safari with various tabs of my favorite sites, and it does this when I tell my Macbook "Get on it."  Here's how I did it:</p>
<ol class="padded">
<li>Under System Preferences &gt; Speech &gt; Speech Recognition, make sure "Speakable Items" is set to "On."  By default, to issue a voice command, you'll have to hold down the Esc key while you talk.  I changed mine to the back tick because I use Esc in other applications to do other things; it's whatever works for you.  If you want to change this, change the "Listening Key".</li>
<li>Open Applications &gt; AppleScript &gt; Script Editor and enter the following code:
<div class="synthi_code" style="display:block;" id="styled_synthi_48adeddc00712">
<h2 class="synthi_header"> AppleScript</h2>
<div class="applescript" style="font-family: monospace;"><span style="color: #b1b100;">property</span> links : <span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;http://mail.google.com/mail/&quot;</span>, <span style="color: #ff0000;">&quot;http://www.3till7.net/wp-admin/&quot;</span>, <span style="color: #ff0000;">&quot;http://dubious.nu/forum/index.php?action=unread&quot;</span>, <span style="color: #ff0000;">&quot;http://icanhascheezburger.com/&quot;</span><span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;Safari&quot;</span><br />
&nbsp; &nbsp; activate<br />
&nbsp; &nbsp; <span style="color: #b1b100;">set</span> currWindow <span style="color: #b1b100;">to</span> <span style="color: #000000; font-weight: bold;">front</span> window<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">repeat</span> <span style="color: #b1b100;">with</span> link <span style="color: #b1b100;">in</span> links<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">make</span> new <span style="color: #000066;">tab</span> at <span style="color: #000000; font-weight: bold;">the</span> <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">of</span> tabs <span style="color: #b1b100;">in</span> currWindow <span style="color: #b1b100;">with</span> properties <span style="color: #66cc66;">&#123;</span>URL:link<span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">repeat</span><br />
<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span></div>
</div>
<p>Thanks to <a href="http://takashi-yoshida.com/?p=18">Takashi Yoshida</a> for the basis of this script.  Feel free to change the links shown to whatever you want Safari to open up with.  I imagine this script could also be customized for Firefox, Opera, or whatever other browser you use, but that might take some fiddling around.</li>
<li>Hit the Compile button in Script Editor and make sure the code gets syntax highlighted nicely, with no warnings displayed.  Go ahead and save this script wherever you would like, but give it a name like "Get on it" or something like that.  Not "get_on_it", but using spaces and everything.</li>
<li>Copy your snazzy new script to Library &gt; Speech &gt; Speakable Items.  If you're copying the script with Finder, that is your local Library, so the one inside your home folder.</li>
<li>Hold down Esc (or whatever you set your Listening Key to be) and say, clearly, "Get on it".  If all goes well, Safari should pop open with your links opened in separate tabs, with a blank tab showing.  If you already have Safari open, this will just open up those links in new tabs, leaving your current tabs alone.</li>
</ol>
<h2>Pronunciation Issues</h2>
<p>Being a southern girl by the grace of God and all that jazz, I have a bit of an accent.  For me, my Apple Script works better if I name it "Getawnit", which looks more akin to how I sound so that the voice recognizer does a better job of understanding me.  You want how the Mac says it to match how you're saying it.  One way to test this is to have the Mac say the written version of what you want to say as your command:</p>
<ol class="padded">
<li>Under System Preferences &gt; Speech &gt; Text to Speech, check "Speak selected text when the key is pressed".  Then choose "Set Key..." to choose which key combination you want to hit to make the Mac read selected text.  Just hit the desired combination while the little window is open.  I have Option+S set for mine.</li>
<li>Open Applications &gt; TextEdit.  Type in how you think you sound when you're saying the desired command.  For example, I made a script that will activate when I say "I'm bored," but for me, my words run together and I speak quickly, so "Mbord" is the name I chose for my script.</li>
<li>Select the text you just typed and hit the key combination you entered in System Preferences (like Option+S).  Does the Mac's voice match how you plan to speak the command?  If so, then you have a good file name for your script.</li>
</ol>
<p><em>Technical note:</em>  you'll need a microphone for this to work, obviously.  I'm using a Macbook with a built-in microphone and I'm running OS X Leopard.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2008/02/04/make-your-mac-listen-up/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chmodding and Ruby</title>
		<link>http://www.3till7.net/2008/02/01/chmodding-and-ruby/</link>
		<comments>http://www.3till7.net/2008/02/01/chmodding-and-ruby/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 20:52:03 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[OS X]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2008/02/01/chmodding-and-ruby/</guid>
		<description><![CDATA[Recently, I switched from a Powerbook to a Macbook, and to copy my files from one to the other, I used a pen drive.  Since my pen drive has a FAT file system, it treats everything as being executable.  This, however, is not the case on a UNIX-like file system like OS X. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I switched from a Powerbook to a Macbook, and to copy my files from one to the other, I used a pen drive.  Since my pen drive has a FAT file system, it treats everything as being executable.  This, however, is not the case on a UNIX-like file system like OS X.  In order to save myself the hassle of manually chmodding thousands of files, I wrote this Ruby script:</p>
<div class="synthi_code" style="display:block;" id="styled_synthi_48adeddc1fe0d">
<h2 class="synthi_header"> Ruby</h2>
<div class="ruby" style="font-family: monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span><br />
<span style="color:#CC0066; font-weight:bold;">require</span> 'find'<br />
<span style="color:#CC0066; font-weight:bold;">require</span> 'fileutils'</p>
<p><span style="color:#008000; font-style:italic;"># Append to/remove from this list as necessary</span><br />
Plain = <span style="color:#006600; font-weight:bold;">&#91;</span>'php', 'txt', 'jpg', 'jpeg', 'gif', 'png', 'html', 'pdf', 'css', 'mp3', 'zip', 'tar.<span style="color:#9900CC;">gz</span>', 'tar', 'htm', 'psd', 'ai', 'ptg', 'cgi.<span style="color:#9900CC;">pl</span>', 'sphp', 'svn-base', 'default'<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">collect</span> <span style="color:#9966CC; font-weight:bold;">do</span> |ext|<br />
&nbsp; &nbsp; <span style="color:#996600;">&quot;.#{ext}&quot;</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span>.<span style="color:#9900CC;">freeze</span></p>
<p><span style="color:#008000; font-style:italic;"># Append to/remove from this list as necessary</span><br />
Executable = <span style="color:#006600; font-weight:bold;">&#91;</span>'pl', 'rb', 'cgi', 'sh'<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">collect</span> <span style="color:#9966CC; font-weight:bold;">do</span> |ext|<br />
&nbsp; &nbsp; <span style="color:#996600;">&quot;.#{ext}&quot;</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span>.<span style="color:#9900CC;">freeze</span><br />
$num_chmodded = <span style="color:#006666;">0</span></p>
<p><span style="color:#9966CC; font-weight:bold;">def</span> chmod_and_puts<span style="color:#006600; font-weight:bold;">&#40;</span> cmd <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> cmd<br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">system</span> cmd<br />
&nbsp; &nbsp; $num_chmodded += <span style="color:#006666;">1</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></p>
<p><span style="color:#9966CC; font-weight:bold;">def</span> chmodder<span style="color:#006600; font-weight:bold;">&#40;</span> start_dir <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; num_skipped = <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; num_plain = <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; num_executable = <span style="color:#006666;">0</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Find.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span> start_dir <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> |path|<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">unless</span> File.<span style="color:#9900CC;">symlink</span>?<span style="color:#006600; font-weight:bold;">&#40;</span> path <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> FileTest.<span style="color:#9900CC;">file</span>? path<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> is_plain? path<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chmod_and_puts <span style="color:#996600;">&quot;chmod 644 <span style="color:#000099;">\&quot;</span>#{path}<span style="color:#000099;">\&quot;</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_plain += <span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">elsif</span> is_executable? path<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chmod_and_puts <span style="color:#996600;">&quot;chmod 755 <span style="color:#000099;">\&quot;</span>#{path}<span style="color:#000099;">\&quot;</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_executable += <span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_skipped += <span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">elsif</span> File.<span style="color:#9900CC;">directory</span>? path<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chmod_and_puts <span style="color:#996600;">&quot;chmod 755 <span style="color:#000099;">\&quot;</span>#{path}<span style="color:#000099;">\&quot;</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_executable += <span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_skipped += <span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_skipped += <span style="color:#006666;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;----------------------------------------------&quot;</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Chmodded #{$num_chmodded} total:&quot;</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>Executable: #{num_executable}&quot;</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>Plain: #{num_plain}&quot;</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Skipped #{num_skipped} files/directories/symlinks&quot;</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></p>
<p><span style="color:#9966CC; font-weight:bold;">def</span> get_extension<span style="color:#006600; font-weight:bold;">&#40;</span> path <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; File.<span style="color:#9900CC;">extname</span><span style="color:#006600; font-weight:bold;">&#40;</span> path <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">downcase</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></p>
<p><span style="color:#9966CC; font-weight:bold;">def</span> is_executable?<span style="color:#006600; font-weight:bold;">&#40;</span> path <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; extension = get_extension<span style="color:#006600; font-weight:bold;">&#40;</span> path <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> Executable.<span style="color:#9966CC; font-weight:bold;">include</span>? extension<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">true</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">false</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></p>
<p><span style="color:#9966CC; font-weight:bold;">def</span> is_plain?<span style="color:#006600; font-weight:bold;">&#40;</span> path <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; extension = get_extension<span style="color:#006600; font-weight:bold;">&#40;</span> path <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> Plain.<span style="color:#9966CC; font-weight:bold;">include</span>? extension<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">true</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">false</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></p>
<p>chmodder<span style="color:#006600; font-weight:bold;">&#40;</span> '.' <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</div>
<p>This goes through all the files and directories within the directory from which you run the script and chmods non-executable files to 644 (read+write on User, read on Group and Other) and executable files to 755 (read+write+execute on User, read+execute on Group and Other).  If you're unfamiliar with the chmod command, you might want to read my <a href="/2005/12/21/beginning-linux-guide/">beginning Linux guide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2008/02/01/chmodding-and-ruby/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DefaultKeyBinding.dict</title>
		<link>http://www.3till7.net/2007/11/06/defaultkeybindingdict/</link>
		<comments>http://www.3till7.net/2007/11/06/defaultkeybindingdict/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 16:11:19 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
		
		<category><![CDATA[Config files]]></category>

		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2007/11/06/defaultkeybindingdict/</guid>
		<description><![CDATA[I take class notes on my Powerbook, and often I take mathematical notes that involve superscripts and subscripts.  To make it more convenient for me to take clean notes, as opposed to notes filled with &#8220;x^2&#8243; and &#8220;y_j&#8221;, I looked into changing the key bindings in OS X.  You need to create a [...]]]></description>
			<content:encoded><![CDATA[<p>I take class notes on my Powerbook, and often I take mathematical notes that involve superscripts and subscripts.  To make it more convenient for me to take clean notes, as opposed to notes filled with &#8220;x^2&#8243; and &#8220;y_j&#8221;, I looked into changing the key bindings in OS X.  You need to create a file at ~/Library/KeyBindings/DefaultKeyBinding.dict, and if the directory KeyBindings doesn&#8217;t exist, you should create it (<code>mkdir ~/Library/KeyBindings</code>).  In this file, you can specify different key combinations and the resulting action that should occur.  Here&#8217;s my <a href="/wp-content/DefaultKeyBinding.dict">DefaultKeyBinding.dict</a>:</p>
<p><iframe src="/wp-content/DefaultKeyBinding.html" width="100%" frameborder="0" height="150" scrolling="auto"></iframe></p>
<p>I used <a href="http://www.lsmason.com/articles/macosxkeybindings.html">this tutorial</a>, which has lots of good examples, to create mine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2007/11/06/defaultkeybindingdict/feed/</wfw:commentRss>
		</item>
		<item>
		<title>using Perl and Apache on OS X</title>
		<link>http://www.3till7.net/2007/03/22/perl-apache-and-os-x/</link>
		<comments>http://www.3till7.net/2007/03/22/perl-apache-and-os-x/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 15:08:20 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[Perl]]></category>

		<category><![CDATA[Web development]]></category>

		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.3till7.net/2007/03/22/perl-apache-and-os-x/</guid>
		<description><![CDATA[I&#8217;m trying to do some work with a Perl app on my Powerbook but I was unable to get any Perl scripts to execute from my local server.  At first, I was getting just the source of the Perl files spit back at me.  I followed a few tutorials about getting /etc/httpd/httpd.conf set [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to do some work with a Perl app on my Powerbook but I was unable to get any Perl scripts to execute from my local server.  At first, I was getting just the source of the Perl files spit back at me.  I followed a few <a href="http://www.cgi101.com/learn/connect/mac.html">tutorials</a> about getting /etc/httpd/httpd.conf set up, but then I kept getting 403 Forbidden errors when I tried to access .pl or .cgi files in my browser.  I checked /var/log/httpd/error_log and saw:</p>
<blockquote><p>[Thu Mar 22 10:55:17 2007] [error] [client 127.0.0.1] Options ExecCGI is off in this directory: /Users/sarah/Sites/test.cgi</p></blockquote>
<p>I thought to myself, &#8220;B.S.!  ExecCGI is on for that directory!&#8221;  Sure enough, in my httpd.conf file, I had:</p>
<blockquote><p><code>&lt;Directory /Users/*/Sites&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;AllowOverride FileInfo AuthConfig Limit<br />
&nbsp;&nbsp;&nbsp;&nbsp;Options <strong>ExecCGI</strong> MultiViews Indexes SymLinksIfOwnerMatch Includes<br />
&nbsp;&nbsp;&nbsp;&nbsp;DirectoryIndex index.htm index.html index.cgi<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Limit GET POST OPTIONS PROPFIND&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Order allow,deny<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allow from all<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Limit&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;LimitExcept GET POST OPTIONS PROPFIND&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Order deny,allow<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deny from all<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/LimitExcept&gt;<br />
&lt;/Directory&gt;</code></p></blockquote>
<p>I had restarted Apache with <code>sudo apachectl graceful</code>, so what was up?  Then I noticed something else in error_log:</p>
<blockquote><p>Processing config directory: /private/etc/httpd/users/*.conf<br />
Processing config file: /private/etc/httpd/users/sarah.conf</p></blockquote>
<p>What was this /private/etc/httpd/users/sarah.conf that it was talking about?  I had never created this file.  I checked and it certainly existed.  It also had an Options line without ExecCGI&mdash;bingo!  I simply removed the file because it was just redefining what I had already specified in httpd.conf for Users/*/Site directories (shown above).  I then restarted Apache and voila, my scripts worked.  :)  I can only assume something auto-generated that file, because it certainly wasn&#8217;t me.</p>
<p>Other things to check if you&#8217;re still seeing the source of your scripts or getting a 403 error:</p>
<ul>
<li>Is your script executable?  Chmod it to 755 to be sure.</li>
<li>Ensure these lines are uncommented in your /etc/httpd/httpd.conf (or whatever your Apache config file is):
<ul>
<li><code>LoadModule cgi_module         libexec/httpd/mod_cgi.so</code></li>
<li><code>LoadModule perl_module        libexec/httpd/libperl.so</code></li>
<li><code>AddModule mod_cgi.c</code></li>
<li><code>AddModule mod_perl.c</code></li>
<li><code>AddHandler cgi-script .cgi .pl</code></li>
</ul>
</li>
<li>Be sure to restart Apache after making any config file changes.  You can do this via Terminal with the command <code>sudo apachectl graceful</code>, which will prompt you for your password, or via System Preferences &gt; Sharing, where you Stop &#8220;Personal Web Sharing&#8221; and Start it again.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.3till7.net/2007/03/22/perl-apache-and-os-x/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
