<?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>Noemi Millman &#124; Triopter &#187; os x</title>
	<atom:link href="http://triopter.com/archive/category/os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://triopter.com</link>
	<description>Hello.  My name is Noemi Millman, and Triopter is my web development agency.  We handcraft beautiful, dynamic websites.</description>
	<lastBuildDate>Tue, 24 Apr 2012 15:27:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing Payflow Pro on Mac OS X</title>
		<link>http://triopter.com/archive/installing-payflow-pro-on-mac-os-x/</link>
		<comments>http://triopter.com/archive/installing-payflow-pro-on-mac-os-x/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 01:44:03 +0000</pubDate>
		<dc:creator>Noemi Millman</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://triopter.com/archive/installing-payflow-pro-on-mac-os-x/</guid>
		<description><![CDATA[If you&#8217;ve done more than a little web development, you&#8217;ve probably encountered Payflow Pro, PayPal&#8217;s (previously Verisign&#8217;s) credit card processing solution.
It&#8217;s not supported on OS X.
But OS X is UNIX-y!  There&#8217;s a version for Linux!  Why won&#8217;t it work on OS X?  Can&#8217;t you google for installation instructions?
Well, no.  Perhaps my [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve done more than a little web development, you&#8217;ve probably encountered Payflow Pro, PayPal&#8217;s (previously Verisign&#8217;s) credit card processing solution.</p>
<p>It&#8217;s not supported on OS X.</p>
<p>But OS X is UNIX-y!  There&#8217;s a version for Linux!  Why won&#8217;t it work on OS X?  Can&#8217;t you google for installation instructions?</p>
<p>Well, no.  Perhaps my google-fu is weak, but I could find no information whatsoever about how to get it working.</p>
<p>In fact, if these guys hadn&#8217;t <a href="http://blog.duncandavidson.com/2005/05/ruby_java_and_p.html">pointed out</a> that <a href="http://www.clarkware.com/cgi/blosxom/2005/05/17#PayflowPro">it was possible</a>, I would have given up then and there.</p>
<p>But I got it installed.  And you can, too.  Here&#8217;s how:</p>
<ol>
<li>Make sure you have the Apple Developer Tools installed.</li>
<li>Download the Payflow Pro Java SDK (you have to log into a Payflow Pro account to get the download), and unzip it to your hard drive (it doesn&#8217;t matter where, as long as it&#8217;s a place where the user your web server runs as can get to it).</li>
<li><code>cd</code> into the <code>java</code> directory.</li>
<li>Set your paths.  I had trouble getting these to stick, so I&#8217;d love any suggestions anyone might have on that aspect:
<p><code>$ CLASSPATH=${CLASSPATH:-}:Verisign.jar:.;export CLASSPATH</code></p>
<p><code>$ libpath=.:../jni:../lib</code></p>
<p><code>$ LD_LIBRARY_PATH=$libpath:${LD_LIBRARY_PATH:-};export LD_LIBRARY_PATH</code></li>
<li>Compile the java code:
<p><code>$ javac PFProJava.java</code></li>
<li>Run a test transaction:
<p><code>$ java PFProJava test-payflow.verisign.com 443 "USER=YourUserName&#038;VENDOR=YourVendorName&#038;PARTNER=YourPartnerName&#038;PWD=YourPassword&#038;TRXTYPE=S&#038;TENDER=C&#038;ACCT=5105105105105100&#038;EXPDATE=1209&#038;AMT=1.23&#038;ZIP=12345&#038;comment1=Test JNI Transactions" 30</code></p>
<p>Don&#8217;t forget to insert the correct user/vendor/partner/password.</p>
<p>Oh, and when I tried it with an account that didn&#8217;t have a username (which is possible in payflow pro), it wouldn&#8217;t accept the transaction until I set the <code>USER</code> to be the same as the <code>VENDOR</code>.</li>
<li>I ran into another problem, which was that I kept getting a  <code>NoClassDefFoundError</code> even after following the above steps.  I fixed this by adding the absolute path to <code>Verisign.jar</code> to my CLASSPATH:
<p><code>$ CLASSPATH=${CLASSPATH:-}:/path/to/directory/Verisign.jar:.;export CLASSPATH</code></li>
<li>As I mentioned, I had a lot of trouble getting the CLASPATH to stick.  I couldn&#8217;t even run the binary from another directory &#8211; even if I speicified the full path to it.  In the end, the following sequence was the most reliable means of running a successful transaction:
<p><code>$ cd /path/to/binary/</code></p>
<p><code>$ CLASSPATH=${CLASSPATH:-}:Verisign.jar:/path/to/directory/Verisign.jar:.;export CLASSPATH</code></p>
<p><code>$ java PFProJava test-payflow.verisign.com 443 "USER=YourUserName&#038;VENDOR=YourVendorName&#038;PARTNER=YourPartnerName&#038;PWD=YourPassword&#038;TRXTYPE=S&#038;TENDER=C&#038;ACCT=5105105105105100&#038;EXPDATE=1209&#038;AMT=1.23&#038;ZIP=12345&#038;comment1=Test JNI Transactions" 30</code></p>
<p>Again, I&#8217;d gladly welcome suggestions as to how to make this work more fluidly.</li>
</ol>
<p>That&#8217;s that.  You&#8217;ve got it installed.  The following code will suffice to call it from PHP:</p>
<p><code>$pfpro_path = '/path/to/directory';</code></p>
<p><code>$pfpro_server = 'test-payflow.verisign.com'; // for test transactions.  Change this for live transactions.</code></p>
<p><code>$vars = '?your=values&#038;to=submit&#038;to=verisign'; // build this string appropriately from your variables according to the payflow documentation, and don't forget to run escapeshellcmd() on each one, since we'll be passing this to exec().</code></p>
<p><code>$cmd = 'cd "' . $pfpro_path . '; "; CLASSPATH=${CLASSPATH:-}:"' . $pfpro_path . '}Verisign.jar":.; export CLASSPATH; cd "' . $pfpro_path . '"; java PFProJava ' . $pfpro_server . ' 443 "' . $vars . '"'</code></p>
<p><code>$result_code = exec($cmd, $result_string);</code></p>
<p>Phew!</p>
<p>Good luck&#8230;. and if you happen to figure out that whole path issue, drop me a line!</p>
]]></content:encoded>
			<wfw:commentRss>http://triopter.com/archive/installing-payflow-pro-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Subversion on OS X, Part 2: Your First Project</title>
		<link>http://triopter.com/archive/subversion-on-os-x-part-2-your-first-project/</link>
		<comments>http://triopter.com/archive/subversion-on-os-x-part-2-your-first-project/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 20:45:55 +0000</pubDate>
		<dc:creator>Noemi Millman</dc:creator>
				<category><![CDATA[os x]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://triopter.com/archive/subversion-on-os-x-part-2-your-first-project/</guid>
		<description><![CDATA[I ran into some permissions problems trying to actually get a project into the repository, so I thought I&#8217;d walk through how to get things working in just one try instead of twenty:

Do Not put your repository under your Apache web root, or any virtual host web root.  Just don&#8217;t.  It won&#8217;t work.
Apache [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into some permissions problems trying to actually get a project into the repository, so I thought I&#8217;d walk through how to get things working in just one try instead of twenty:</p>
<ol>
<li><strong>Do Not</strong> put your repository under your Apache web root, or any virtual host web root.  Just don&#8217;t.  It won&#8217;t work.</li>
<li>Apache needs read and write permissions on your Subversion directory.  The simplest but perhaps not the most secure way to do this is, after you create the repository, to change the owner of the repository directory and all its contents to the user that Apache runs as (in my case, <code>www</code>).
<p>If you want to still be able to write directly to it (for instance, to set up the configuration) without sudo-ing, you can change the group permissions to allow a group that you&#8217;re a member of to write to it.  (Like I said, this is probably not the most secure way to do things, but it&#8217;s the easiest, and probably fine for something that&#8217;s carefully limited to your own machine.  I hate dealing with file permissions, so I set it up the lazy way.)</p>
<p>You can do all of this with OS X&#8217;s &#8220;Get Info&#8221;, or on the command line with <code>chown -R</code> and <code>chgrp -R</code></li>
<li>In your repository, find <code>conf/svnserve.conf</code>, and uncomment the following lines:
<p><code>anon-access = read<br />
auth-access = write<br />
password-db = passwd</code></li>
<li>Now open conf/passwd and add a line to the bottom with the format:
<p><code>username = password</code></p>
<p>subtituting, of course, the username and password that you want to use to access your repository.  You can add additional lines for additional users.</li>
<li>The SVNbook recommends creating <code>trunk</code>, <code>branches</code>, and <code>tags</code> subdirectories for each project in your repository, although this is by no means required.  I don&#8217;t ancipate doing a huge amount of branching, but I figured it couldn&#8217;t hurt.
<p>The easiest way to get this set up, if you have already started your project somewhere and can&#8217;t change its location without breaking things because of absolute path configurations, is as follows:</p>
<ol type="a">
<li>Create a <code>tmp</code> directory on your desktop.</li>
<li>Inside <code>tmp</code>, create a directory with the name of your project.  You&#8217;ll be happiest if this is short and doesn&#8217;t include any spaces.</li>
<li>Inside the project directory, create <code>trunk</code>, <code>branches</code>, and <code>tags</code> directories.</li>
<li><code>svn import . --username YOURUSERNAME --password YOURPASSWORD  http://localhost:81/svn -m "repository layout for PROJECTNAME"</code>, substituting the appropriate username, password, and projectname.  If you&#8217;re using a different URL for your repository, substitute that too, of course.</li>
</ol>
</li>
<li>You may want Subversion to ignore particular types of files.  For instance, with Django, I&#8217;m working with Python, which creates a compiled bytecode file for each script, with the extension <code>.pyc</code>.  These don&#8217;t need to be versioned because each one is recreated automatically from the script every time you change it and run it.
<p>Different languages and project types will have different files to ignore.  There are also OS metadata files like OS X&#8217;s <code>.DS_Store</code> and Windows&#8217; <code>Thumbs.db</code> that you probably don&#8217;t want to carry around either.</p>
<p>This is set up on the client side, and you&#8217;ll probably want to take care of it before importing or adding anything beyond that skeletal directory structure.</p>
<p>Open <code>~/.subversion/config</code>, and locate the <code>[miscellany]</code> section.  In there is a line, possibly commented out, that looks something like this:</p>
<p><code># global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store</code></p>
<p>Uncomment the line if it&#8217;s commented out, and add <code>.DS_Store</code> (if it&#8217;s not already there) and <code>*.pyc</code> to the end, so it looks something like this:</p>
<p><code>global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.pyc</code></p>
<p>While you&#8217;ve got the file open, you might want to scroll up to the <code>[helpers]</code> section, and uncomment the <code>editor-cmd</code> line, and set it to use your editor of choice.</li>
<li>OK, we need to import our project now.
<p>First, <code>cd</code> into the parent directory of your project directory, and check out the trunk of the project (since the trunk is empty, this will do nothing except create a <code>.svn</code> directory in the project directory, so subversion can handle it properly as a &#8220;working copy.):</p>
<p><code>svn checkout http://localhost:81/svn/PROJECTNAME/trunk PROJECTDIR</code></p>
<p>Then, <code>cd</code> into the project directory and tell Subversion to add everything from your project to the repository.  For each subdirectory of the project that you want under version control (Subversion will recursively add directory contents):</p>
<p><code>svn add SUBDIRNAME</code></p>
<p>Then add the files that live in the root in the project directory that you want versioned.  I had a couple files I wanted to ignore (such as my sqlite database), so I just added the Python scripts:</p>
<p><code>svn add *.pyc</code></p>
<p>Then commit everything:</p>
<p><code>svn commit -m "Adding initial project files"</code></p>
<p>And you&#8217;re done!
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://triopter.com/archive/subversion-on-os-x-part-2-your-first-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Six Steps to a Subversion Server on OS X with Darwinports</title>
		<link>http://triopter.com/archive/six-steps-to-a-subversion-server-on-os-x-with-darwinports/</link>
		<comments>http://triopter.com/archive/six-steps-to-a-subversion-server-on-os-x-with-darwinports/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 06:32:32 +0000</pubDate>
		<dc:creator>Noemi Millman</dc:creator>
				<category><![CDATA[darwinports]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://triopter.com/archive/six-steps-to-a-subversion-server-on-os-x-with-darwinports/</guid>
		<description><![CDATA[I&#8217;ve tried on at least three separate occasions to set up a CVS repository on my computer, but each time I&#8217;ve completely given up, mostly because getting the darn thing configured properly just seems to be beyond my abilities.
But besides that, CVS is really obsolete at this point, and Subversion has really taken over its [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve tried on at least three separate occasions to set up a CVS repository on my computer, but each time I&#8217;ve completely given up, mostly because getting the darn thing configured properly just seems to be beyond my abilities.</p>
<p>But besides that, CVS is really obsolete at this point, and Subversion has really taken over its status as the de facto standard for free, open-source revision control software.</p>
<p>Installation was yet another project that turned out to be super-easy with a little help from Darwinports.</p>
<p>Here&#8217;s the full set of steps to install:</p>
<ol>
<li>
<p><a href="http://triopter.com/archive/adventures-in-darwinports-installing-apache2-php5-mysql-41-postgresql-and-django/">Grab Apache 2 off Darwinports</a> and get it running separately from the default OS X Apache 1.3 installation (PHP, MySQL, et al entirely optional).  Darwinports&#8217; Apache automatically includes <code>mod_dav</code>, which you&#8217;ll need.</p>
</li>
<li>
<p>Install Subversion and Apache&#8217;s dav_svn_module:</p>
<p><code>sudo port install subversion +mod_dav_svn</code></p>
<p>Darwinports&#8217; Subversion conveniently includes both server and client.  Spiffy.</p>
</li>
<li>
<p>Decide where your repository is going to live.  I set up a directory under my user directory, with the full path <code>/Users/myusername/svn</code></p>
</li>
<li>
<p>Configure Apache to work with Subversion.  First, add the following to the bottom of the list of <code>LoadModule</code> directives in <code>httpd.conf:</code></p>
<p><code>LoadModule dav_svn_module     modules/mod_dav_svn.so</code></p>
<p>Then add the following to the end of <code>httpd.conf:</code></p>
<p><code>&lt;Location /svn &gt;# I think you can change "/svn" to whatever you want the path to be on your server.<br />
DAV svn<br />
SVNPath /Users/myusername/svn/ # Change this to the path you chose in Step 3, of course<br />
&lt;/Location&gt;</code></p>
<p>If you want to keep your repository private &#8212; i.e. only accessible from the machine it&#8217;s hosted on, you can add a few lines, like so:</p>
<p><code>&lt;Location /svn &gt;# I think you can change "/svn" to whatever you want the path to be on your server.<br />
DAV svn<br />
SVNPath /Users/myusername/svn/ # Change this to the path you chose in Step 3, of course</p>
<p>Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1<br />
&lt;/Location&gt;</code></p>
</li>
<li>
<p>Create your repository:</p>
<p><code>svnadmin create --fs-type fsfs /Users/myusername/svn</code></p>
</li>
<li>
<p>Restart Apache</p>
</li>
</ol>
<p>Whee, that was easy.</p>
<p>Browse to <code>http://localhost:81/svn</code> (substitute the appropriate port, of course, if you configured Apache differently) &#8212; and if you get something that looks like a really simple webpage, you&#8217;re set.</p>
<p>I&#8217;m kind of in love with Darwinports right now, in case you haven&#8217;t noticed.  Next challenge: actually configuring a Subversion repository.  I&#8217;m seriously crossing my fingers that this is easier than CVS.</p>
]]></content:encoded>
			<wfw:commentRss>http://triopter.com/archive/six-steps-to-a-subversion-server-on-os-x-with-darwinports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading Django from Stable to Subversion</title>
		<link>http://triopter.com/archive/upgrading-django-from-stable-to-subversion/</link>
		<comments>http://triopter.com/archive/upgrading-django-from-stable-to-subversion/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 05:45:52 +0000</pubDate>
		<dc:creator>Noemi Millman</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://triopter.com/archive/upgrading-django-from-stable-to-subversion/</guid>
		<description><![CDATA[Django is in fairly heavy development, heading for a 1.0 release, and not only does there seem to be a lot of new functionality in the newest versions, but some of the older functionality is expected to break.
Since word on the mailing list is that development versions are not only quite stable, but actually recommended [...]]]></description>
			<content:encoded><![CDATA[<p>Django is in fairly heavy development, heading for a 1.0 release, and not only does there seem to be a lot of new functionality in the newest versions, but some of the older functionality is expected to break.</p>
<p>Since word on the mailing list is that development versions are not only quite stable, but actually recommended over the stable version, and since I don&#8217;t have any deployed apps to worry about breaking, I thought it would be better to upgrade now than later.</p>
<p>Even better, this will make future upgrades as simple as a single subversion command (and, well, some fixes for incompatibilities, but that would be the case anyway, and probably worse if I weren&#8217;t to keep up).</p>
<p>I was a bit scared about the upgrade, but it turned out to be much much simpler than I anticipated.Â  I found a thread on the mailing list about doing <a title="Mailing list thread about upgrading Django to the subversion trunk" href="http://groups.google.com/group/django-users/browse_thread/thread/a3f43ab9894591f3/a7972b1201222e2c">just such an upgrade</a>.Â  It wasn&#8217;t very explicit, but when I extrapolated from it, it worked.<br />
Here&#8217;s what I did:</p>
<ol>
<li>located my main <code>django</code> directory (had to search for it &#8211; it was inside an egg in <code>site-packages</code>), and renamed to <code>django.bak</code> (instead of deleting&#8230; in case of emergency).
<p>If you installed using DarwinPorts, like I did, the location is probably something like:</p>
<p><code>/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django</code></li>
<li>created a directory for the new installation (anywhere your user has read, write, and execute permissions will do, it seems), and <code>cd</code>-ed into that directory</li>
<li>ran
<p><code>svn co http://code.djangoproject.com/svn/django/trunk/ django_src</code></p>
<p>and</p>
<p><code>ln -s `pwd`/django_src/django /PATH/TO/SITE-PACKAGES/django</code></p>
<p>(substituting the correct path, of course &#8212; in my case, <code>/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages</code>)</li>
<li>Chose a good place on my <code>$PATH</code> to symlink to <code>django-admin.py</code>, and ran
<p><code>sudo ln -s ./django_src/django/bin/django-admin.py /DIR/ON/PATH/</code></p>
<p>(I dropped it in <code>/opt/local/sbin</code>, since DarwinPorts had added that to my path, and I preferred adding something there to putting it on a main system path.)</li>
</ol>
<p>And&#8230; everything&#8217;s up and running, at least in terms of the development server (I hadn&#8217;t set it up to run on Apache in the first place &#8212; I don&#8217;t know if that would complicate things).</p>
<p>Simple, huh?</p>
]]></content:encoded>
			<wfw:commentRss>http://triopter.com/archive/upgrading-django-from-stable-to-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install Perl Modules on Mac OS X in 4 Easy Steps</title>
		<link>http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/</link>
		<comments>http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/#comments</comments>
		<pubDate>Tue, 28 Nov 2006 01:55:23 +0000</pubDate>
		<dc:creator>Noemi Millman</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/</guid>
		<description><![CDATA[Today at work, I learned how to install Perl modules using CPAN.  It&#8217;s a lot easier than I thought.
You see, for the past couple of years, I&#8217;ve been a bit frustrated because OS X does not come with a whole lot of Perl modules pre-installed, and for all I googled, I couldn&#8217;t find an [...]]]></description>
			<content:encoded><![CDATA[<p>Today at work, I learned how to install Perl modules using <a href="http://en.wikipedia.org/wiki/CPAN">CPAN</a>.  It&#8217;s a lot easier than I thought.</p>
<p>You see, for the past couple of years, I&#8217;ve been a bit frustrated because OS X does not come with a whole lot of Perl modules pre-installed, and for all I googled, I couldn&#8217;t find an &#8220;idiot&#8217;s&#8221; guide for moderately-savvy-but-not-expert users like myself to install modules and dependencies on demand.</p>
<p>The only instructions I could find point to <a href="http://fink.sourceforge.net/">Fink</a>, which basically installs modules in a path that isn&#8217;t included in the Perl @INC variable (which I still haven&#8217;t figured out how to update), meaning you have to manually specify the full path to the modules in every script &#8212; which is not a lot of fun if you&#8217;re developing on OS X and deploying on Red Hat, for instance.</p>
<p>Moreover, Fink doesn&#8217;t seem to make every module available, and it&#8217;s not very easy to determine which Fink package you need to install if you need a particular module.</p>
<p>So, with a script that called on several apparently unavailable modules, and a deadline looming, I finally decided to suck it up and figure out how to use CPAN to install them:</p>
<h2>1) Make sure you have the Apple Developer Tools installed.</h2>
<p>These are on one of your install discs, or available as a huge but free download from the <a href="https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/308/wo/gs4ttcj3zNp32oyOpzC1DFH4f3i/0.0">Apple Developer Connection</a> [free registration required].  I thought I had them, but apparently when we upgraded that computer to Tiger, they went missing.</p>
<p>If you don&#8217;t have this stuff installed, your installation will fail with errors about unavailable commands.</p>
<h2>2) Configure CPAN.</h2>
<p><code>$ sudo perl -MCPAN -e shell</code></p>
<p><code>perl> o conf init</code></p>
<p>This will prompt you for some settings.  You can accept the defaults for almost everything (just hit &#8220;return&#8221;).  The two things you must fill in are the path to <code>make</code> (which should be <code>/usr/bin/make</code>) and your choice of CPAN mirrors (which you actually choose don&#8217;t really matter, but it won&#8217;t let you finish until you select at least one).  If you use a proxy or a very restrictive firewall, you may have to configure those settings as well.</p>
<p>If you skip Step 2, you may get errors about <code>make</code> being unavailable.</p>
<h2>3) Upgrade CPAN</h2>
<p><code>$ sudo perl -MCPAN -e 'install Bundle::CPAN'</code></p>
<p>Don&#8217;t forget the <code>sudo</code>, or it&#8217;ll fail with permissions errors, probably when doing something relatively unimportant like installing <code>man</code> files.</p>
<p>This will spend a long time downloading, testing, and compiling various files and dependencies.  Bear with it.  It will prompt you a few times about dependencies.  You probably want to enter &#8220;yes&#8221;.  I agreed to everything it asked me, and everything turned out fine.  YMMV of course.  If everything installs properly, it&#8217;ll give you an &#8220;OK&#8221; at the end.</p>
<h2>4) Install your modules.  For each module&#8230;.</h2>
<p><code>$ sudo perl -MCPAN -e 'install Bundle::Name'</code></p>
<p>or</p>
<p><code>$ sudo perl -MCPAN -e 'install Module::Name'</code></p>
<p>This will install the module <em>and</em> its dependencies.  Nice, eh?  Again, don&#8217;t forget the <code>sudo</code>.</p>
<p>The first time you run this after upgrading CPAN, it may prompt you to configure again (see Step 2).  If you accept its offer to try to configure itself automatically, it may just run through everything without a problem.</p>
<p>There are a couple of potential pitfalls with specific modules (such as the <code>LWP::UserAgent</code> / <code>HEAD</code> issue), but most have workarounds, and I haven&#8217;t run into anything that wasn&#8217;t easily recoverable.</p>
<p>And that&#8217;s it!</p>
<p>Did you find this useful?  Is there anything I missed?</p>
]]></content:encoded>
			<wfw:commentRss>http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Adventures in DarwinPorts (Installing Apache2, PHP5, MySQL 4.1, PostgreSQL, and Django)</title>
		<link>http://triopter.com/archive/adventures-in-darwinports-installing-apache2-php5-mysql-41-postgresql-and-django/</link>
		<comments>http://triopter.com/archive/adventures-in-darwinports-installing-apache2-php5-mysql-41-postgresql-and-django/#comments</comments>
		<pubDate>Tue, 24 Oct 2006 02:38:58 +0000</pubDate>
		<dc:creator>Noemi Millman</dc:creator>
				<category><![CDATA[darwinports]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://triopter.com/archive/adventures-in-darwinports-installing-apache2-php5-mysql-41-postgresql-and-django/</guid>
		<description><![CDATA[Yeah, that&#8217;s quite a mouthful.
I decided a couple weeks ago that I wanted to learn Django as well as Ruby on Rails.  Django is a little bit less trendy, but seems to have more flexibility, and gives you an entire admin section of your app &#8220;for free&#8221;, as opposed to RoR, for which there [...]]]></description>
			<content:encoded><![CDATA[<p>Yeah, that&#8217;s quite a mouthful.</p>
<p>I decided a couple weeks ago that I wanted to learn <a href="http://www.djangoproject.com/">Django</a> as well as <a href="http://www.rubyonrails.org/">Ruby on Rails</a>.  Django is a little bit less trendy, but seems to have more flexibility, and gives you an entire admin section of your app &#8220;for free&#8221;, as opposed to RoR, for which there are a zillion different ways to hack on user management, and no sense of &#8220;best practices&#8221; for a novice.</p>
<p>Django requires an up-to-date installation of <a href="http://www.python.org/">Python</a>, and a number of other dependencies, including a database API for Python.  The best <a href="http://www.rhonabwy.com/wp/2006/07/20/installing-django-on-macos-x-development-version/">installation instructions</a> I could find for OS X (one of the reasons I use a Mac is the availability of all these great UNIX tools that are so useful for a webmaster) recommended using <a href="http://darwinports.opendarwin.org/">DarwinPorts</a> (soon becoming <a href="http://www.macports.org/">MacPorts</a>) to simplify installation.</p>
<p>DarwinPorts is awesome.</p>
<h2>Getting the Latest Apache / PHP / MySQL</h2>
<p>I peeked through the list of available packages, and decided that as long as I was at it, I might as well add an Apache 2 / PHP 5 / MySQL 4.1 server to run on port 81 alongside the default Apache 1.3 / PHP 4 / MySQL 4.0 that I already had on port 80.</p>
<p>An earlier attempt to do this had run out of steam as I realized I would have to choose, locate, configure, and compile all my Apache modules by hand, which is really beyond my ability and ambition.  But DarwinPorts would allow me to install Apache with a whole bunch of common modules included, and would download and install all the dependencies for each one automatically.</p>
<p>Well, even on my top-of-the-line-a-year-ago machine, this stuff takes a while to compile, but about an hour later (after cursing at myself for misunderstanding the sudo -u mysql command as running MySQL and trying to fix an error by prepending a path to the username) I had a working secondary server.  DarwinPorts not only installs dependencies for each piece, and not only configures everything for you, and not only reminds you of changes to make to your $PATH variable in case the installer couldn&#8217;t, but sometimes it even tells you what commands to run after installing each program to properly do things like initalize databases.  Sweet.</p>
<p>Here&#8217;s how you do this:</p>
<ol>
<li>port install mysql4 +server</li>
<li>port install apache2 +server</li>
<li>port install php5 +mysql4 +apache2</li>
<li>copy httpd.conf.sample to httpd.conf</li>
<li>[optional] change path in DocumentRoot and associated directives</li>
<li>[optional] change Listen 80 to Listen 81 (If you want to run side-by-side with an Apache 1.3 installation on port 80)</li>
<li>add the following to the  directive:<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps</li>
</ol>
<p>Don&#8217;t forget to follow the extra directions DarwinPorts gives you.</p>
<h2>Python, PostgreSQL, and Psycopg Spell Problems</h2>
<p>I easily updated my Python installation, and then I ran into trouble.  You see, the instructions I had for DarwinPorts were for installing with SQLite.  I wanted to use PostgreSQL, partly because I figured it would be a useful thing to learn, and partly because skimming the <a href="http://www.djangoproject.com/documentation/tutorial1/">initial tutorial</a> and <a href="http://www.djangoproject.com/documentation/tutorial1/#c2268">its comments</a> had showed me that PostgreSQL was perhaps the optimal database choice because of its handling of foreign key constraints.</p>
<p>The main installation <a href="http://code.djangoproject.com/wiki/SetupOnTiger">instructions for OS X</a> used PostgreSQL, but compiled it by hand.</p>
<p>So I decided to wing it.  The DarwinPorts available ports list included three versions of the PostgreSQL package, so I picked the latest one (postgresql81), and installed it.  Then I installed the next dependency (py-egenix-mx-base).  No problem.  And then I ran into the final piece, psycopg.</p>
<p>Psycopg is a package that allows Python to interact with PostgreSQL databases.  The instructions were very specific about installing version 1.1, not version 1.0 or 2.0, of psycopg.  Great.  I asked DarwinPorts to install psycopg.</p>
<p>Well, first problem:  the DarwinPorts psycopg package depends on the postgresql8 package, not postgresql81.</p>
<p>Second problem:  every server from which it attempted to download postgresql8 timed out.</p>
<p>I was a little bit flummoxed at this point.</p>
<p>I backtracked, downloaded the source code for psycopg, compiled it by hand using the main OS X installation instructions (I had to tweak a lot of paths to reference DarwinPorts&#8217; installation locations), and boom!  I&#8217;m off and running.</p>
<p>Phew.</p>
<p>I feel like an idiot for not documenting the exact commands I used, for the edification of future generations.  If I ever do this again and am not running down blind alleys looking for solutions to problems caused by my own typos, I promise to do so faithfully.  In the meantime, here are the steps to do it the easy way (assuming the postgresql8 servers are working):</p>
<ol>
<li>sudo port install python24</li>
<li>sudo port install postgresql8</li>
<li>sudo port install py-egenix-mx-base</li>
<li>sudo port install py-psycopg</li>
<li>[optional] sudo port install subversion (If you&#8217;re using the development version of Django, or just want subversion)</li>
<li><a href="http://www.djangoproject.com/documentation/install/#install-the-django-code">Install Django</a></li>
</ol>
<p>Next up, I&#8217;ll tell you what it&#8217;s like to jump from MySQL to PostgreSQL, and all about my experiences with the Django tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://triopter.com/archive/adventures-in-darwinports-installing-apache2-php5-mysql-41-postgresql-and-django/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

