<?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>MirthLab &#187; osx</title>
	<atom:link href="http://blog.mirthlab.com/tag/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mirthlab.com</link>
	<description></description>
	<lastBuildDate>Thu, 15 Jul 2010 21:12:25 +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>Working With History in Bash</title>
		<link>http://blog.mirthlab.com/2008/10/28/working-with-history-in-bash/</link>
		<comments>http://blog.mirthlab.com/2008/10/28/working-with-history-in-bash/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 22:11:07 +0000</pubDate>
		<dc:creator>Mark Quezada</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.mirthlab.com/?p=113</guid>
		<description><![CDATA[Working WIth History in Bash An article written by Allan Odgaard (creator of TextMate) that I tend to reference a lot. It has a lot of good tips and tricks for streamlining your Bash workflow.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.macromates.com/2008/working-with-history-in-bash/">Working WIth History in Bash</a></p>

<p>An article written by Allan Odgaard (creator of <a href="http://macromates.com/">TextMate</a>) that I tend to reference a lot. It has a lot of good tips and tricks for streamlining your Bash workflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mirthlab.com/2008/10/28/working-with-history-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAMP Might Break Your Time Machine Backups</title>
		<link>http://blog.mirthlab.com/2008/04/05/mamp-might-break-your-time-machine-backups/</link>
		<comments>http://blog.mirthlab.com/2008/04/05/mamp-might-break-your-time-machine-backups/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 04:35:21 +0000</pubDate>
		<dc:creator>Mark Quezada</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[mamp pro]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://mirthlab.com/2008/04/05/mamp-might-break-your-time-machine-backups/</guid>
		<description><![CDATA[After many frustrating hours of trying to figure out why my Time Machine backups were failing (actually, they&#8217;d stall after being really close to finishing&#8230; they&#8217;d just sit there forever) I finally narrowed it down to one set of files: a local symfony project. At first, I thought that perhaps something weird was happening with [...]]]></description>
			<content:encoded><![CDATA[<p>After many frustrating hours of trying to figure out why my Time Machine backups were failing (actually, they&#8217;d stall after being really close to finishing&#8230; they&#8217;d just sit there forever) I finally narrowed it down to one set of files: a local symfony project.</p>

<p>At first, I thought that perhaps something weird was happening with the symlinks that I use to link a Symfony&#8217;s &#8220;/sf&#8221; directory to the Symfony library&#8217;s web directory, but upon further investigation it boiled down to the Symfony cache files. I just happened to notice that for some reason the cache files were being generated with the user/group combination &#8220;mark/nogroup&#8221;&#8230; &#8220;mark&#8221; is my login name, so this seemed fine, but &#8220;nogroup&#8221; seemed a bit odd. After changing the group associated with these files to &#8220;staff&#8221; like the other files in the project, the Time Machine backup worked fine. So, apparently Time Machine somehow chokes on the &#8220;nogroup&#8221; group.</p>

<p>Now, I had <em>just</em> switched to using MAMP Pro instead of rolling my own Apache/PHP/MySQL because I wanted my setup to be completely portable from one machine to the next (with little effort), so I was a little bit disappointed with this, but there&#8217;s an easy fix. Open up MAMP Pro and notice the &#8220;Run Apache/MySQL server as user&#8221; dropdown:</p>

<p><img src="/wp-content/uploads/2008/04/mark-mark.png" alt="mark/mark" /></p>

<p>I had left this as the default which uses my username &#8220;mark/mark&#8221; but since there was no &#8220;mark&#8221; group, it was using &#8220;nogroup&#8221; and causing Time Machine to explode. So, I changed this to use &#8220;www/mysql&#8221; like so:</p>

<p><img src="/wp-content/uploads/2008/04/www-mysql.png" alt="www/mysql" /></p>

<p>&#8230;and now the cache files are being generated with the &#8220;www/www&#8221; user/group combo and Time Machine backs up as it should.</p>

<p>Although this fix is not necessarily Symfony specific (it really has to do with any file that&#8217;s written by the MAMP apache server process), it may save someone some trouble if they&#8217;ve got a similar Symfony set up going and they can&#8217;t figure out why their Time Machine backup isn&#8217;t working as advertised.</p>

<p>P.s. You can find files with a certain group by running this command in the terminal:</p>

<pre><code> find . -group nogroup
</code></pre>

<p>This will find any files in the current directory that belong to the &#8220;nogroup&#8221; group.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mirthlab.com/2008/04/05/mamp-might-break-your-time-machine-backups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up a Symfony project on Media Temple&#8217;s Grid Service, Part 2</title>
		<link>http://blog.mirthlab.com/2008/01/05/setting-up-a-symfony-project-on-media-temples-grid-service-part-2/</link>
		<comments>http://blog.mirthlab.com/2008/01/05/setting-up-a-symfony-project-on-media-temples-grid-service-part-2/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 05:29:11 +0000</pubDate>
		<dc:creator>Mark Quezada</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[grid service]]></category>
		<category><![CDATA[media temple]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://mirthlab.com/2008/01/05/setting-up-a-symfony-project-on-media-temples-grid-service-part-2/</guid>
		<description><![CDATA[In part one of this series, we looked at setting up a basic Subversion repository to house our new Symfony project on Media Temple&#8217;s Grid-Service. This article will take that a step further by explaining how to set up your OS X box for local development using said repository. Although this article will start from [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://blog.mirthlab.com/2007/12/15/setting-up-a-symfony-project-on-media-temples-grid-service-part-1/">part one</a> of this series, we looked at setting up a basic Subversion repository to house our new Symfony project on Media Temple&#8217;s Grid-Service. This article will take that a step further by explaining how to set up your OS X box for local development using said repository. Although this article will start from where we left off last time, there&#8217;s really nothing specific to Media Temple about these steps and these same basic principles can be used with any other host.</p>

<p>I think a lot of people don&#8217;t really understand the benefits of local development. For those who are unfamiliar, &#8220;local development&#8221; means simply that your machine acts as both client <em>and</em> server. This means that instead of, say downloading a file from your server, editing it, and uploading it to see changes, you simply edit and save the file right on your machine and see changes reflected instantly. There&#8217;s really no magic here, it&#8217;s just that we do the hard work up-front to have an apache server running on our local machine so that simply saving a file <em>is</em> saving to the server.</p>

<h2>Requirements</h2>

<p>Installing and configuring Apache, MySQL and PHP5 are out of the scope of this article, but we&#8217;ll be working on the assumption that these are all installed and working. Mac OS X has long shipped with an Apache server built-in, and version 10.5, Leopard, ships with Apache2 and PHP5 pre-installed. The shipping version of those two packages may be all you need, but I&#8217;ve been using Marc Liyanage&#8217;s PHP5 package with a custom Apache2 install for various reasons (namely, Apple&#8217;s PHP5 version is missing some critical libraries like mcrypt and GD). At the time of this writing there is currently no supported version of his PHP package for use with Leopard, but there are <a href="http://www.entropy.ch/phpbb2/viewforum.php?f=2">various threads on his forum</a> about getting it working. You can also use something like <a href="http://www.mamp.info">MAMP</a> (along with these <a href="http://stringfoo.com/2007/11/07/mamp-setup-leopard/">setup instructions for Leopard</a>).</p>

<h2>Setting Up the Development Environment</h2>

<p>We left off on the <a href="http://blog.mirthlab.com/2007/12/15/setting-up-a-symfony-project-on-media-temples-grid-service-part-1/">previous article</a> with a working copy checked out of our Subversion repository into the <code>~/Sites/</code> folder. All we need to do now is map the <code>web</code> directory in our Symfony project to an Apache Virtual host so we can serve it up locally.</p>

<p>Find your <code>apache</code> config file and edit it appropriately. I like to have separate config files for each site that I&#8217;m working on, so I&#8217;ve edited my main config file located at <code>/usr/local/apache2/conf/httpd.conf</code> and added the following line at the end of that file:</p>

<pre><code># Include custom configurations for symfony
Include conf/sites/*
</code></pre>

<p>This basically tells the Apache server to look in <code>conf/sites/</code> for any extra configuration files and load them as well. I&#8217;ve then added a config file for each site that I&#8217;m working on. For example, in <code>conf/sites/project1.conf</code> we&#8217;ll add this:</p>

<pre><code>&lt;VirtualHost project1.dev:80&gt; 
    ServerName project1.dev
    &lt;Directory /&gt;
        AllowOverride All
        Allow from All
    &lt;/Directory&gt;

    DocumentRoot /Users/mark/Sites/project1/web

    ErrorLog logs/project1.dev-error_log
&lt;/VirtualHost&gt;
</code></pre>

<p>&#8230; which will allow us to access our symfony project. Be sure to substitute your own username in the <code>DocumentRoot</code> directive and restart the apache server so that the changes take effect.</p>

<p>We&#8217;ll also have to edit our <code>hosts</code> file so that &#8220;project1.dev&#8221; is considered a valid hostname for our machine. In <code>/etc/hosts/</code> add this line:</p>

<pre><code>127.0.0.1 project1.dev
</code></pre>

<p>It should be noted that I like to use the &#8220;.dev&#8221; domain for my dev environment, but this is simply my own convention. I&#8217;ve heard of other symfony users using something like &#8220;.sf&#8221; instead which would work just as well.</p>

<p>You should now be able to pull up <code>http://project1.dev/</code> from a browser and see the default symfony project page.</p>

<h2>Some Added Sugar</h2>

<p>At this point we pretty much have a working local copy of our symfony project. It&#8217;s running as a subversion working copy which allows us to track and check-in changes, which is great. We are also able to test our site using any browser on our machine be it Safari, Firefox, Camino or anything else that&#8217;s native to Mac OS X. The one thing we <em>can&#8217;t</em> do is test our site locally using a PC version of Internet Explorer, which still accounts for about <a href="http://arstechnica.com/news.ars/post/20070222-8908.html">75% of browsers</a>.</p>

<p>One great thing about Apple&#8217;s recent switch to Intel processors is the ability to run Windows through virtualization right from within OS X. If you&#8217;ve got <a href="http://www.vmware.com/products/fusion/">VMware&#8217;s Fusion</a> installed, we can update our setup a bit so that we can check our site from Windows, without needing another physical box.</p>

<p>First, boot up your Windows XP virtual machine and open a command prompt by choosing &#8220;Run&#8230;&#8221; from the Start Menu and typing in &#8220;cmd&#8221;:</p>

<p><img src="/wp-content/uploads/2008/01/windows-start-menu.png" alt="Windows Start Menu" /></p>

<p><img src="/wp-content/uploads/2008/01/windows-run-cmd.png" alt="Windows Run Command" /></p>

<p>Once you&#8217;ve got the prompt, type:</p>

<pre><code>ipconfig /all
</code></pre>

<p>This will list all of your network adapters. What we&#8217;re looking for is the &#8220;Default Gateway&#8221; entry under the Ethernet adapter heading.</p>

<p><img src="/wp-content/uploads/2008/01/windows-default-gateway.png" alt="Windows Default Gateway" /></p>

<p>Copy down that IP address. Now, open your <code>hosts</code> file which is probably located at <code>C:/WINDOWS/system32/drivers/etc/hosts</code> in your favorite editor (notepad works fine).</p>

<p><img src="/wp-content/uploads/2008/01/windows-hosts.png" alt="Windows Hosts File" /></p>

<p>This is essentially the same file we just edited on OS X, but there will be one major difference. We&#8217;re going to put the IP of our host machine as the mapping IP for our development domain like so:</p>

<pre><code>192.168.171.2   project1.dev
</code></pre>

<p>Now, you should be able to open a browser on your Windows Virtual Machine and see the same symfony project that we just set up on OS X. The only downside I&#8217;ve seen with this is if your Gateway IP changes on the Windows box. You&#8217;ll have to update the Windows <code>hosts</code> file to reflect the new IP. I&#8217;m sure there&#8217;s probably an automated way to do that, but my IP seems to be pretty consistent unless I actually shut-down the Virtual Machine instead of just suspending it.</p>

<h2>Next Steps</h2>

<p>At this point you can also install and configure your database software. MySQL makes it easy with their <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">OS X installer</a> which even comes with a startup script. As of this writing, there is still no Leopard specific version, but there are instructions elsewhere on <a href="http://stringfoo.com/2007/11/05/server_setup_on_leopard/#loadMySQL">loading MySQL</a> or <a href="http://blog.tomatocheese.com/archives/2007/11/1/migrating_mysql_to_mac_os_x_leopard/">migrating from Tiger</a>.</p>

<p>Once it&#8217;s installed, you can add a database that will be for local development and then update your symfony <code>config/databases.yml</code> file with the information:</p>

<pre><code>dev:
  propel:
    class:          sfPropelDatabase
    param:
      dsn:          mysql://user:pass@localhost/project1_db

prod:
  propel:
    class:          sfPropelDatabase
    param:
      dsn:          mysql://user:pass@internal-db.sXXXXX.gridserver.com/project1_db
</code></pre>

<p>&#8230;where sXXXXX is substituted with your Grid Server account number. You&#8217;ll notice that we&#8217;ve set up our dev and prod environments to use different databases. The dev environment uses the DSN for the local database you just installed while the prod environment uses a Media Temple specific DSN. This means that when developing locally, we&#8217;ll always be calling the dev environment from our browser so that we&#8217;re loading the correct database:</p>

<pre><code>http://project1.dev/frontend_dev.php
</code></pre>

<h2>Conclusion</h2>

<p>I hope this provides some insight as to why local web development on an OS X box works so well. You get to edit and save files without the delay of saving to a server <strong>and</strong> you get to have an all-in-one testing machine that you can use to test sites in different browsers and on different platforms.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mirthlab.com/2008/01/05/setting-up-a-symfony-project-on-media-temples-grid-service-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a Symfony project on Media Temple&#8217;s Grid Service, Part 1</title>
		<link>http://blog.mirthlab.com/2007/12/15/setting-up-a-symfony-project-on-media-temples-grid-service-part-1/</link>
		<comments>http://blog.mirthlab.com/2007/12/15/setting-up-a-symfony-project-on-media-temples-grid-service-part-1/#comments</comments>
		<pubDate>Sun, 16 Dec 2007 02:52:08 +0000</pubDate>
		<dc:creator>Mark Quezada</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[grid service]]></category>
		<category><![CDATA[media temple]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://mirthlab.com/2007/12/15/setting-up-a-symfony-project-on-media-temples-grid-service-part-1/</guid>
		<description><![CDATA[Media Temple&#8217;s Grid-Service is a great, low-cost solution for developing and deploying Symfony applications. This article will walk you through setting up a Grid-Server Subversion repository for use with a Symfony project. The main point here is being able to create and use a symfony project hosted on a Grid Server without having to have [...]]]></description>
			<content:encoded><![CDATA[<p>Media Temple&#8217;s <a href="http://www.mediatemple.net/webhosting/gs/">Grid-Service</a> is a great, low-cost solution for developing and deploying Symfony applications. This article will walk you through setting up a Grid-Server Subversion repository for use with a Symfony project. The main point here is being able to create and use a symfony project hosted on a Grid Server without having to have symfony pre-installed <em>at all</em> locally.</p>

<h2>Setting Up Subversion</h2>

<p>Symfony is designed to be used with version management software like Subversion. If you&#8217;ve never used versioning software, you should read about the benefits <a href="http://svnbook.red-bean.com/en/1.4/svn.basic.html">right from the Subversion book itself</a>, but in general, it tends to make life easier for developing and maintaining large code bases as it tracks revisions between files and authors. Subversion is already installed in the Grid-Service environment, so all we have to do is set up a new repository. Media Temple has a <a href="http://kb.mediatemple.net/article.php?id=143">knowledge base article</a> describing the basic steps, but we&#8217;ll be tailoring things a bit to Symfony.</p>

<p>Be sure that you&#8217;ve <a href="http://kb.mediatemple.net/article.php?id=110">enabled SSH access</a> on your account. Personally, I like creating the repository using the <code>serveradmin</code> user, and then I&#8217;ll make commits using a local user on whichever domain I&#8217;ll be using. Let&#8217;s get started.</p>

<p>Once you&#8217;ve logged in via SSH as <code>serveradmin</code>, move into the <code>data</code> directory. This is where we&#8217;ll be creating the repository:</p>

<pre><code>cd data
</code></pre>

<p>Then, create the base repository like so (substituting your own repository name for <code>mirthlab</code>):</p>

<pre><code>svnadmin create --fs-type fsfs mirthlab
</code></pre>

<p>I tend to use separate repositories for each domain. This allows me to use a structure of the form:</p>

<pre><code>mirthlab/
    project1/
        trunk/
        tags/
        branches/
    project2/
        trunk/
        tags/
        branches/
some_other_domain/
    project3/
        trunk/
        tags/
        branches/
</code></pre>

<p>&#8230; so I can effectively have as many projects related to each domain in version control as I need.</p>

<p>Now that we&#8217;ve created the repository, let&#8217;s create the base folder for the Symfony project. While still in the <code>data</code> directory, we&#8217;ll create a few new folders:</p>

<pre><code>mkdir project1
mkdir project1/trunk
mkdir project1/tags
mkdir project1/branches
</code></pre>

<p>&#8230; where <code>project1</code> is the name of your symfony project. This might all look familiar if you&#8217;re read through the Subversion documentation, but we&#8217;re going to add a couple of folders:</p>

<pre><code>mkdir project1/trunk/lib
mkdir project1/trunk/lib/vendor
</code></pre>

<p>It&#8217;ll become clear in a moment why we&#8217;re doing this, but the short of it is that we&#8217;re going to link the Symfony libraries directly to the project itself using the <code>lib/vendor</code> folder. Once you&#8217;re done, commit the contents of your project folder to the repo like so:</p>

<pre><code>svn import project1 file:///home/&lt;site_number&gt;/data/mirthlab/project1 --message "Creating initial repo."
</code></pre>

<p>Be sure to change <code>&lt;site_number&gt;</code>, <code>mirthlab</code> and <code>project1</code> appropriately, so that they match your setup. Please note that this assumes you&#8217;re starting with a fresh Symfony project. If there&#8217;s an existing project you have that you want to import into the repository, these steps would vary slightly since you wouldn&#8217;t have to set up a <code>lib</code> folder.</p>

<p>The folder structure was imported into the repository, so you can safely delete the project folder skeleton we made from the <code>data</code> folder:</p>

<pre><code>rm -rf project1
</code></pre>

<h2>Set Up Additional SVN Users</h2>

<p>This step is optional, but would be helpful if you&#8217;re going to allow multiple users to work on this repo. There&#8217;s also a <a href="http://kb.mediatemple.net/article.php?id=776">Media Temple KB article</a> for this if you&#8217;re curious. Log in to your Media Temple Account Center for your domain. Click on the &#8220;Email Users&#8221; button and add some local users.</p>

<p><img src="/wp-content/uploads/2007/12/email-users.png" alt="Email Users Button" /></p>

<p>I created a user &#8220;mark&#8221; for my domain. Also, be sure to check the &#8220;Enable SSH access?&#8221; checkbox:</p>

<p><img src="/wp-content/uploads/2007/12/enable-ssh.png" alt="image here" /></p>

<p>Now, in order to allow other users to use the new repo, we have to give group access to the directory. From within the <code>data</code> directory  run this command as <code>serveradmin</code>:</p>

<pre><code>chmod -R g+w mirthlab
</code></pre>

<p>Again, being sure to substitute your own repository name for <code>mirthlab</code>.</p>

<h2>Setting Up Symfony</h2>

<p>Now that you have your base folder structure, it&#8217;s time to get the Symfony project initialized. Connect to your Subversion repository and download the trunk of our project by running the following commands locally. I&#8217;m on a Mac OS X box, so I&#8217;ll use the terminal to do a checkout of my project to the <code>~/Sites</code> folder:</p>

<pre><code>cd ~/Sites
svn checkout svn+ssh://your_user%your_domain.com@your_domain.com/home/&lt;site_number&gt;/data/mirthlab/project1/trunk project1
</code></pre>

<p>Note: <code>svn checkout svn+ssh...</code> should all be on one line. This creates a <code>project1</code> folder in my Sites folder, which is just what I want. Now let&#8217;s get our Symfony project structure set up by linking the Symfony libraries to our <code>lib/vendor</code> folder with a subversion externals link.</p>

<pre><code>cd project1
svn propedit svn:externals lib/vendor/
</code></pre>

<p>This should bring up your favorite text editor. Simply paste this line into the file, save and close it:</p>

<pre><code>symfony http://svn.symfony-project.com/branches/1.0
</code></pre>

<p>This effectively links lib/vendor/symfony to the stable 1.0 branch of Symfony. Only security and bug fixes go into this branch, so there&#8217;s no need to worry about it breaking your app when running an <code>svn up</code>. Now, commit your changes back to the repository:</p>

<pre><code>svn commit --message "Linking Symfony libraries to lib/vendor"
</code></pre>

<p>And when that&#8217;s done, update the local working copy to get the libraries:</p>

<pre><code>svn up
</code></pre>

<p>Since we now have a local copy of symfony, we can use the <code>symfony</code> binary to execute <code>pake</code> tasks. Let&#8217;s flesh out our project by creating the initial structure using the <code>init-project</code> task.</p>

<pre><code>lib/vendor/symfony/data/bin/symfony init-project project1
</code></pre>

<p>&#8230; where <code>project1</code> is the name of our project. This doesn&#8217;t necessarily have to match the name of your repository project, but that&#8217;s usually what I use. This project name is used to set up defaults in files like <code>propel.ini</code> and <code>properties.ini</code>.</p>

<p>Also, be sure to change the path for the symfony libraries in <code>config/config.php</code>:</p>

<pre><code>$sf_symfony_lib_dir  = dirname(__FILE__).'/../lib/vendor/symfony/lib';
$sf_symfony_data_dir = dirname(__FILE__).'/../lib/vendor/symfony/data';
</code></pre>

<p>&#8230; this just sets them up to use a relative path, instead of an absolute one (which we&#8217;ll need when we push this code to the production server).</p>

<p>We can now add the rest of the project to source control:</p>

<pre><code>svn add *
svn commit --message "Added initial symfony project structure."
</code></pre>

<p>Subversion might complain that the lib folder is already under version control, but that&#8217;s ok.</p>

<h2>Next Steps</h2>

<p>Additional general info on Symfony and Subversion can be gleaned from Dave Dash&#8217;s excellent article: <a href="http://spindrop.us/2007/04/17/tips-for-symfony-and-subversion/">Tips for Symfony and Subversion</a>. Read and follow the directions in that article to complete your setup by ignoring files in <code>cache</code> and <code>log</code> as well as other auto-generated files like the model files Propel generates.</p>

<h2>Conclusion</h2>

<p>With this setup, we now have a Symfony project under source control on a Media Temple Grid-Service account. We also now have symfony installed locally and which we can use by calling simply <code>./symfony</code> from within our project directory. In the next article, we&#8217;ll take a look at getting our local development environment set up for editing on a Mac OS X box.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mirthlab.com/2007/12/15/setting-up-a-symfony-project-on-media-temples-grid-service-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a Custom Apache Install Start at Boot on Mac OS X</title>
		<link>http://blog.mirthlab.com/2007/12/06/making-a-custom-apache-install-start-at-boot-on-mac-os-x/</link>
		<comments>http://blog.mirthlab.com/2007/12/06/making-a-custom-apache-install-start-at-boot-on-mac-os-x/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 20:55:34 +0000</pubDate>
		<dc:creator>Mark Quezada</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[launchd]]></category>
		<category><![CDATA[lingon]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://mirthlab.com/2007/12/06/making-a-custom-apache-install-start-at-boot-on-mac-os-x/</guid>
		<description><![CDATA[A Bit Of Background I do all of my web-development on a Mac OS X machine (a MacBook Pro, to be exact) using a local install of Apache, PHP and MySQL. I&#8217;m using a custom built Apache 2 install and configuration (for various reasons) so the default Web Sharing control panel does not control the [...]]]></description>
			<content:encoded><![CDATA[<h2>A Bit Of Background</h2>

<p>I do all of my web-development on a Mac OS X machine (a MacBook Pro, to be exact) using a local install of Apache, PHP and MySQL. I&#8217;m using a custom built Apache 2 install and configuration (for various reasons) so the default Web Sharing control panel does not control the starting and stopping of my webserver. In general, my setup works really well and has led to a really integrated workflow that I can use and develop with even while offline. One thing that had always frustrated me about my custom setup though, is that after a restart, apache had to be manually started before I could get back to work. This is one of those little things that can be annoying, but not really annoying enough to do anything about. Well, I finally decided to fix it.</p>

<p>Mac OS X has a system startup program called <code>launchd</code> which allows us to start the apache webserver automatically on each system boot. You can read more about <code>launchd</code> at the <a href="http://developer.apple.com/macosx/launchd.html">official apple page</a>.</p>

<h2>Making Our Own <code>launchd</code> File</h2>

<p>To create the <code>launchd</code> plist file, I used <a href="http://lingon.sourceforge.net/">Lingon</a> which is an open source graphical front-end for creating these types of files (version 2.0.2 as of this writing). You can use this article as a reference for creating  your own, or simply <a href="http://blog.mirthlab.com/wp-content/uploads/2007/12/com.mirthlab.launchd.apache2.plist.zip">download the apache2 <code>launchd</code> plist file</a>, unzip it, and place the file into <code>/Library/LaunchDaemons/</code>. This file assumes that you have apache2 installed in <code>/usr/local/apache2/</code>.</p>

<p>Once Lingon is launched, you&#8217;ll be presented with a window that&#8217;ll show you an overview of all of your currently installed launchd files. Click the &#8220;new&#8221; button to create a new file. You&#8217;ll want a Daemon file since apache needs to run at startup and as root:</p>

<p><img src="/wp-content/uploads/2007/12/step1.png" alt="Screenshot of step 1" /></p>

<p>Once you&#8217;ve got a new file ready for editing, fill out the &#8220;Name&#8221; field. I&#8217;ll be using &#8220;<code>com.mirthlab.launchd.apache2</code>&#8220;:</p>

<p><img src="/wp-content/uploads/2007/12/step2.png" alt="Screenshot of step 2" /></p>

<p>Next, fill out the &#8220;What&#8221; field. This will be the command we want to run at startup and I&#8217;ll be using &#8220;<code>/usr/local/apache2/bin/apachectl start</code>&#8221; but this may differ if you have Apache installed in a different location:</p>

<p><img src="/wp-content/uploads/2007/12/step3.png" alt="Screenshot of step 3" /></p>

<p>And finally, fill out the &#8220;When&#8221; field. For Apache, I checked the box that says &#8220;Run it when it is loaded by the system (at startup or login)&#8221;:</p>

<p><img src="/wp-content/uploads/2007/12/step4.png" alt="Screenshot of step 4" /></p>

<h2>Wrapping It All Up</h2>

<p>Click &#8220;Save&#8221; and enter your password when prompted. This is a root level <code>launchd</code> daemon which is why Lingon needs your password.</p>

<p>Restart and you should have Apache ready to go!</p>

<p><strong>NOTE: If you simply downloaded the plist file, you&#8217;ll probably have to change this file&#8217;s ownership as files in <code>/Library/LaunchDaemons/</code> must be owned by root.</strong></p>

<p>To change the file&#8217;s owner to root, in the terminal, type:</p>

<p><code>sudo chown root:wheel /Library/LaunchDaemons/com.mirthlab.launchd.apache2.plist</code></p>

<p>&#8230; all on one line.</p>

<p>You can also see <a href="http://www.macosxhints.com/article.php?story=20041217125121976">this macosxhints.com hint</a> for a tip on using the Sharing Control Panel to start and stop your custom Apache install.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mirthlab.com/2007/12/06/making-a-custom-apache-install-start-at-boot-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</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)
Database Caching 8/33 queries in 0.364 seconds using disk
Object Caching 327/609 objects using disk

Served from: blog.mirthlab.com @ 2010-09-06 03:24:19 -->