Installing Pressflow on MAMP using Git

 

I often find it helpful to spin up a new Pressflow instance for local development and testing, without any fancy APC or Varnish configuration, and without any source control. Here's a quick way to do that.

First, set up your MAMP so it it works with Virtual Hosts. This gives us the ability to run multiple webroots of Drupal on the same IP address (in this case, on your local machine.)

Next, create a new Virtual Host for your new pressflow instance. I put the webroot for my new virtualhost at ~/mamp/test_site. Here's what my /Applications/MAMP/conf/apache/httpd.conf looks like:



DocumentRoot /Users/drnugent/mamp/test_site
ServerName test_site
ErrorLog logs/test_site-error_log
TransferLog logs/test_site-access_log

AllowOverride All

Then, if you haven't already, install git. You can install Pressflow without git, but you should probably have git installed on your machine anyway, so why not start now? You can download an OS X installer for git from Google Code. After you install this, you may need to quit and restart your shell for the path to take effect.

Note: If you are firmly against installing git, download pressflow manually here.

Finally, run git to fetch the latest Pressflow install. Use the following command:

git clone git://gitorious.org/pressflow/6.git ~/mamp/test_site

Voila! You have downloaded Pressflow. Now you just need to:

  • Create a database: you can do this through the MAMP control panel's PHPMyAdmin
  • Update your /etc/hosts: Add an entry for 127.0.0.1 for test_site, so that you can access your Pressflow install by visiting http://test_site:8888
  • Restart MAMP or at least Apache, so the new VirtualHost configuration takes effect.
  • Run the install script: By going to http://test_site:8888/install.php. You'll also need to copy the default.settings.php to settings.php, like with any Drupal installation.

Did you enjoy this post? Please spread the word.