Setting up a CiviCRM Development Environment

Installing MAMP

To get CiviCRM running on my Apple iMac I need four items of software installed.

  • Apache Web Server
  • A Database. I am using mySQL
  • PHP programming language
  • A Content Management System (CMS). Either Drupal or Joomba

Some of these come pre-installed on my iMac but to get the versions up to date instead of compiling software or installing binaries, I downloaded MAMP a bundle of Apache, mySQL and PHP. It just drops right into the Applications folder and you just click on it to launch the web server and mySQL. Very nice. If you look around the internet about web servers, you will see the acronym LAMP servers, which refers to Linux, Apache, mySQL and PHP. Replace Linux with Mac and you get MAMP. Don’t despair if you are a Windows user as there are packages of Apache, MySQL and PHP for you also.

Update: Jerimee posted a link to XAMPP a Apache, MySQL, PHP and Perl bundle that has a Window version. Thanks guy!

Installing Drupal

Since BlueNC and the NCDP uses Drupal as their CMS, I am in good company. Installing Drupal was dirt simple, I downloaded the zip file of the latest version and unzipped it in the htdocs directory of my MAMP server. Pointing my web browser to the location specified in the installation document the installation web page started up and I quickly set up my new Drupal site. MAMP comes with mySQLadmin which made it easy to set up the database required by Drupal.

Installing CiviCRM

Installing CiviCRM was almost as easy. I downloaded CiviCRM and unzipped it into drupal/sites/all/modules directory and launched the setup web page. This page checks the perquisites and after I added two directories that it told me I was needed, the installation process installed the CiviCRM database. The next step was to go to the Drupal administration web page and enable CiviCRM. Woops an error. The current version on CiviCRM is not compatible with the latest version of Drupal (6.2). I wonder why the CiviCRM installation process didn’t squawk on this when it checked the prerequisites. Of course if I had read the requirements on the CiviCRM web site I would have caught it too. No big deal. I deleted the Drupal directory, downloaded the older version (5.7) and went through the same steps. In under fifteen minutes, my test CiviCRM site is up and running. Man, installation of web services has certainly improved. Just a few years ago this would have involved hours of reading cryptic instructions, creating and editing configuration files and using SQL commands to create all of the databases and tables.

So give it a try. Using MAMP makes it quick and easy to install Drupal and CiviCRM to play with with little impact to your Mac laptop or desktop.

Comments

Dirt simple.

Man oh man. None of this stuff is dirt simple from where I'm sitting. Thanks for the briefing, though.

:)

This is great info.

Cutter --

This is great information. I'm doing something similar, but I'm using Ruby on Rails instead of Drupal for a precinct-level organization application. In both cases, I'm a fan of the open source software. There's no reason why these tools aren't in the hands of everyone.

Dan B

(And as soon as I sort through the growing stack of to-dos on my desk, I'll start and maintain a blog here on organizing tools with helpful hints like yours.)

RoR

Dan,

When I first started looking at this after the 04 election, I thought about doing it in Ruby on Rails as a exercise for me to learn RoR. But I am not a developer and didn't want to have the local party depend on me to fix my probably buggy code. I was excited to find out about CiviCRM, where the heavy lifting of development is done. The big challenge is configuring it.

One of the things I want to do here is put the word out on what tools are out there. I am big Internet user and just found out about CiviCRM a few months ago I think there is a need. If you don't know what to Google for you will never find it.

Understood

I completely understand that. I'm a weekend warrior when it comes to RoR (or home improvement, for that matter) and Google is my best friend. Both RoR and Drupal are similar enough that you can migrate or port the higher-level elements back and forth, so we should compare notes from time to time.

RoR

Dan or cutter, can yall explain a little what Ruby on Rails is? Is it a language? I know it's not a CMS, it's a development platform?

How hard would be for me to create "Hello World" in Ruby on Rails? I'm okay with JavaScript and PHP, but I can't do object oriented stuff like Java proper.

- - - - -
McCain - The Third Bush Term

RoR

Yep, you've stumbled into the Geek Corner.

RoR is a "web application framework," which is a fancy way of saying we've taken a language (Ruby) and made it relatively easy to use that language to build a web application. Drupal is also a web application framework, but it is built on PHP. There are similar frameworks built on Perl, Python, and nearly every other language out there but I'm not as familiar with them.

The machine still runs on Linux (or a suitable alternate), the server still runs on Apache (or a suitable alternate), and the database still runs MySQL (or a suitable alternate). Ideally, the web application framework is abstract enough that the operating system (and architecture), the web server, and the database don't matter enough; you build the application once and the framework handles the details of SQL in MySQL versus MS-SQL or Postgresl or whatever.

It wouldn't be hard for you to create "Hello World" on RoR... a better example is creating "Hello (your name here)" and in all cases, the framework would do the heavy lifting.

*** edited to correct Drupal/PHP mistake. (Django is a framework based on Python.)

RoR Hello World Tutorial

A bit more involved that writing "echo Hello World". The framework model in Ruby on Rails is MCV (Model, Controller, View). After creating the database and generating the framework, you would create a view that is a htlm file that would contain "Hello World" and create a controller that has the action of opening the hello.rhtml file in the web browser.

Hello World Tutorial