<?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>Andrew Vayanis &#187; OS X</title>
	<atom:link href="http://www.vayanis.com/category/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vayanis.com</link>
	<description>Developer, Gamer, Thinker</description>
	<lastBuildDate>Wed, 19 May 2010 15:58:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>OS X 10.6 (Snow Leopard) &#8211; using MAMP/PECL to install PHP extensions</title>
		<link>http://www.vayanis.com/2010/05/19/os-x-10-6-snow-leopard-using-mamppecl-to-install-php-extensions/</link>
		<comments>http://www.vayanis.com/2010/05/19/os-x-10-6-snow-leopard-using-mamppecl-to-install-php-extensions/#comments</comments>
		<pubDate>Wed, 19 May 2010 15:48:25 +0000</pubDate>
		<dc:creator>Andrew Vayanis</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.vayanis.com/?p=88</guid>
		<description><![CDATA[Need help installing PHP extensions for OS X 10.6 (Snow Leopard) using MAMP and the included pecl binary? Well, you have come to the right place. If you have tried this on its own, you will notice that none of the extensions pecl builds will work with MAMP. This is because MAMP is compiled as [...]]]></description>
			<content:encoded><![CDATA[<p>Need help installing PHP extensions for OS X 10.6 (Snow Leopard) using MAMP and the included pecl binary?  Well, you have come to the right place.  If you have tried this on its own, you will notice that none of the extensions pecl builds will work with MAMP.  This is because MAMP is compiled as a 32-bit binary whereas pecl tries to build 64-bit PHP extensions.</p>
<p>To get pecl working properly, make sure you have <a href="http://developer.apple.com/technologies/tools/xcode.html">Xcode</a> installed on you machine.  Next, you will need to get a copy of MAMP&#8217;s source and prepare it using 32-bit compile flags. You can download the MAMP source from the <a href="http://www.mamp.info/en/downloads/index.html">MAMP download page</a>. Running the .dmg should extract the source. After extracting the source run the following:<br />
<span id="more-88"></span><br />
<code><br />
mkdir /Applications/MAMP/Library/Include/<br />
mv /path/to/extracted/mamp/source/ /Applications/MAMP/Library/Include/<br />
</code> </p>
<p>Next you will want to extract the PHP package and do the following to prepare the package:</p>
<p><code><br />
mv /Applications/MAMP/Library/Include/extracted_php_source/ /Applications/MAMP/bin/php5/include/php/<br />
cd /Applications/MAMP/bin/php5/include/php/<br />
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Applications/MAMP/bin/php5/bin/php-config<br />
</code></p>
<p>Finally, you now can install pecl extensions with the following command:<br />
<code><br />
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' /Applications/MAMP/bin/php5/bin/pecl install <extension name><br />
</code></p>
<p>And that&#8217;s it! Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vayanis.com/2010/05/19/os-x-10-6-snow-leopard-using-mamppecl-to-install-php-extensions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting up LAML (Linux, Apache, MySQL, Lua) with MAMP</title>
		<link>http://www.vayanis.com/2010/02/04/setting-up-laml-linux-apache-mysql-lua-with-mamp/</link>
		<comments>http://www.vayanis.com/2010/02/04/setting-up-laml-linux-apache-mysql-lua-with-mamp/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 05:00:04 +0000</pubDate>
		<dc:creator>Andrew Vayanis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.vayanis.com/?p=48</guid>
		<description><![CDATA[As a weekend project I decided to set up a LAML, (Linux, Apache, MySQL, Lua) stack on my computer. I never worked with Lua before, but I figured it wouldn&#8217;t be too hard to get it working with my MAMP setup. Getting started, I spent some time reading any articles I could find on the [...]]]></description>
			<content:encoded><![CDATA[<p>As a weekend project I decided to set up a LAML, (Linux, Apache, MySQL, Lua) stack on my computer.  I never worked with Lua before, but I figured it wouldn&#8217;t be too hard to get it working with my MAMP setup.  Getting started, I spent some time reading any articles I could find on the web that talked about setting up or using using Lua for web development.  I quickly ran into the <a href="http://www.keplerproject.org/">Kepler Project</a> which as their website points out:</p>
<blockquote><p>
is an open source platform that brings the power of Lua to web development
</p></blockquote>
<p>While this was my goal, I wanted to start from scratch since I haven&#8217;t had any experience with the language and didn&#8217;t want to learn it on a specific platform just yet.  So, I went on to figure out how to install and configure Lua with MAMP.  To accomplish this yourself, you will need: Xcode, MAMP, Lua, LuaRocks, MAMP source, and mod_fcgid.<br />
<span id="more-48"></span></p>
<h3>Step 1: Install Xcode</h3>
<p>This one is pretty straight forward.  You can easily install Xcode if you have an OS X install DVD.  Otherwise you can download it from the <a href="http://developer.apple.com/technology/xcode.html">Apple Developer Center</a>.</p>
<h3>Step 2: Install Lua</h3>
<p>Installing Lua is also straight forward.  Download the source from <a href="http://www.lua.org/ftp/">Lua&#8217;s FTP site</a>.  I chose the current version (5.1.4).  After extracting the source run the following commands:<br />
<code><br />
cd /path/to/source/<br />
make macosx<br />
sudo make install<br />
</code><br />
This should install the Lua interpreter into your /usr/local/bin/</p>
<h3>Step 3: Install LuaRocks</h3>
<p>To install LuaRocks, you first need to download the <a href="http://luarocks.org/releases/">source</a>.  The current release is 2.0.1.  After downloading the source run the following commands:<br />
<code><br />
cd /path/to/source/<br />
make<br />
sudo make install<br />
</code><br />
This should install luarocks in /usr/local/bin/ .  You can test your installation with:<br />
<code>luarocks help</code><br />
You should be presented with a list of commands to use luarocks.</p>
<h3>Step 4: Install Lua MySQL support</h3>
<p>This part is a little tricky as you need to make sure you have the source for your MAMP installation.  You can download the <a href="http://sourceforge.net/projects/mamp/files/mamp/1.8.2/MAMP_components_1.8.2.dmg.zip/download">MAMP source</a> from the <a href="http://www.mamp.info/en/index.html">MAMP website</a>.  Running the .dmg should extract the source.  After extracting the source run the following:<br />
<code><br />
mkdir /Applications/MAMP/Library/Include/<br />
mv /path/to/extracted/mamp/source/ /Applications/MAMP/Library/Include/<br />
</code><br />
Once you have moved your source over, extract the MySQL package then run the following commands:<br />
<code><br />
cd /Applications/MAMP/Library/include/mysql-5.1.37/<br />
./configure<br />
make<br />
</code><br />
Once you have finished building MySQL, you will want to move the mysqlclient into the current MySQL location:<br />
<code><br />
cp /Applications/MAMP/Library/include/mysql-5.1.37/libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql/<br />
</code><br />
You will now be able to install the luasql-mysql package from luarocks with the following command:<br />
<code><br />
sudo luarocks install luasql-mysql 2.2.0-1 MYSQL_INCDIR=/Applications/MAMP/Library/include/mysql-5.1.37/include MYSQL_LIBDIR=/Applications/MAMP/Library/lib/mysql<br />
</code></p>
<h3>Step 5: Install Lua fcgid wrapper</h3>
<p>This is an easy one:<br />
<code><br />
luarocks install lua wsapi-fcgi 1.1<br />
</code></p>
<h3>Step 6: Install Apache mod_fcgid</h3>
<p>This part was a bit tricky for me since I don&#8217;t have much experience compiling Apache modules.  First, you will need to extract the httpd source, for me this was httpd-2.0.63.tar.gz.  Next, you will want to build Apache into a separate directory.  Use the following to build Apache:<br />
<code><br />
./configure --prefix=/path/to/target/Apache<br />
make<br />
make install<br />
</code><br />
While running the make command, you may get the following error:</p>
<p><code><br />
sendrecv.c:965:2: error: #error APR has detected sendfile on your system, but nobody has written a<br />
sendrecv.c:966:2: error: #error version of it for APR yet. To get past this, either write apr_sendfile<br />
sendrecv.c:967:2: error: #error or change APR_HAS_SENDFILE in apr.h to 0.<br />
</code></p>
<p>Fixing this is simple, all you need to do is edit /Applications/MAMP/Library/include/httpd-2.0.63/srclib/apr/include/apr.h and make the following modifications:<br />
<code><br />
-#define APR_HAS_SENDFILE  1<br />
+#define APR_HAS_SENDFILE  0<br />
</code></p>
<p>I know its taken quite some time now, but you are almost done!  All that&#8217;s left is to build mod_fcgid and configure Apache.  To build mod_fcgid run the following commands:<br />
<code><br />
APXS=/path/to/target/Apache/bin/apxs ./configure.apxs<br />
make<br />
make install<br />
cp /path/to/target/Apache/modules/mod_fcgid.so /Applications/MAMP/Library/modules<br />
</code></p>
<h3>Step 7: Configure Apache for mod_fcgid and Lua</h3>
<p>Now that you have everything built and in place, you just need to configure Apache and then you will be ready to start building Lua web apps!</p>
<p>Open /Applications/MAMP/conf/apache2/httpd.conf with your favorite text editor and add the following to the load modules section:<br />
<code><br />
LoadModule fcgid_module modules/mod_fcgid.so<br />
</code><br />
While you are at it, you can comment out the following lines if you like (I am not sure if it is possonlble to run mod_cgid with mod_fcgid, so I just took them out).<br />
<code><br />
#LoadModule cgi_module modules/mod_cgi.so<br />
#LoadModule cgid_module modules/mod_cgid.so<br />
</code><br />
Next, find the IfModule mod_fcgid directive, and add the following under it:<br />
<code><br />
<IfModule mod_fcgid.c><br />
	AddHandler fcgid-script .lua<br />
	FcgidWrapper /Users/avayanis/.luarocks/bin/wsapi.fcgi .lua<br />
	Options +ExecCGI<br />
</IfModule><br />
</code><br />
Finally, restart Apache through the MAMP application and test it out!  Here is a sample lua script to test out your Lua environment:</p>

<div class="wp_syntax"><div class="code"><pre class="lua" style="font-family:monospace;">module<span style="color: #66cc66;">&#40;</span>..., package.seeall<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #b1b100;">function</span> run<span style="color: #66cc66;">&#40;</span>wsapi_env<span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">local</span> headers <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Content-type&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;text/html&quot;</span> <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">local</span> <span style="color: #b1b100;">function</span> hello_text<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">coroutine.yield</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Hello World!&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #b1b100;">end</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">200</span>, headers, <span style="color: #b1b100;">coroutine.wrap</span><span style="color: #66cc66;">&#40;</span>hello_text<span style="color: #66cc66;">&#41;</span>
<span style="color: #b1b100;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.vayanis.com/2010/02/04/setting-up-laml-linux-apache-mysql-lua-with-mamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Subversion with Network Drives in OS X</title>
		<link>http://www.vayanis.com/2008/05/04/using-subversion-with-network-drives-in-os-x/</link>
		<comments>http://www.vayanis.com/2008/05/04/using-subversion-with-network-drives-in-os-x/#comments</comments>
		<pubDate>Mon, 05 May 2008 01:55:05 +0000</pubDate>
		<dc:creator>Andrew Vayanis</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.vayanis.com/?p=33</guid>
		<description><![CDATA[Ever try to get subversion working between multiple Macs over a home network without WEB Dav or public key authentication over ssh? Well, that was what I was trying to accomplish over this weekend and it apparently isn&#8217;t as straightforward as I thought. There seems to be an issue with subversion (SVN) and apple&#8217;s AFP [...]]]></description>
			<content:encoded><![CDATA[<p>Ever try to get subversion working between multiple Macs over a home network without WEB Dav or public key authentication over ssh?  Well, that was what I was trying to accomplish over this weekend and it apparently isn&#8217;t as straightforward as I thought.  There seems to be an issue with <a href="http://subversion.tigris.org/">subversion (SVN)</a> and apple&#8217;s AFP protocol, something to do with not being able to obtain exclusive locks?  Well, that is all I could find on the problem.  So, if anyone knows how to fix this, I would like to know.  However, I did find another solution on my own, that was just as useful to me as using an AFP mounted drive, but much more versatile.  Intoducing&#8230; <a href="http://code.google.com/p/macfuse/">MacFUSE</a>!<br />
<span id="more-33"></span></p>
<blockquote><p>MacFUSE implements a mechanism that makes it possible to implement a fully functional file system in a user-space program on Mac OS X (10.4 and above).</p></blockquote>
<p>In a nutshell, MacFUSE lets you turn any number of connection interfaces into a fully functional file system.  With the files provided in the link above, you can mount an FTP or SSH login as a network drive, thus solving my issue of using subversion over a network drive.  The best part is, I can now easily access my Mac Pro remotely as well.  Although, now that I think about it, I have never tried to mount a remote drive over AFP so that could have always been possible.</p>
<p>I have to admit this is my new favorite development tool since it makes working remotely much more pleasant.  Instead of opening files one at a time through <a href="http://cyberduck.ch/">Cyberduck</a>, my FTP client, and <a href="http://macromates.com/">Textmate</a>, I can now mount my FTP account as a network drive and create projects with Textmate to edit all my files.  This also happens to be a great solution for all the people wishing for FTP support within Textmate.</p>
<p>Anyhow, I hope this can be of help to someone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vayanis.com/2008/05/04/using-subversion-with-network-drives-in-os-x/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)

Served from: www.vayanis.com @ 2010-09-09 10:06:33 -->