Code, Camera, Action

Stories, software and strategies to help nonprofits do web 2.0+ 
Filed under

lamp

 

Scaling Drupal on the Amazon Cloud - Drupalcon presentation

@febbraro and I presented our work hosting Drupal on Amazon AWS at Drupalcon last night. Thanks to everybody who could make it. Slides below for download.

We talked about scaling challenges we face doing nonprofit campaigns for the Case Foundation. These are typically limited-time campaigns, with press releases or other promotion.

Our challenge has been supporting relatively high loads for a short time — without going broke. Amazon’s EC2 servers-on-demand have been great for this. Here’s how we use AWS, and architectural issues anyone will face hosting Drupal on the Amazon cloud.

Update: Alan Doucette was kind enough to post video of the talk. Thanks, Alan!

Loading mentions Retweet
Filed under  //   cloud   code   drupal   drupalcon   lamp   nptech   scale  

Comments [0]

How I Sold Our Web Servers and Moved to the Cloud

At NTEN, the nonprofit tech conference, last year I met a developer who was really exited. One of the vendors on the floor was giving away Pentium 3 processors, and he had a box that could use an extra boost.

Me, I never touch hardware anymore. In fact, I don’t really know how many servers we’ve got — or where they are. Amazon knows. About six months ago we switched all our production servers to Amazon’s EC2 cloud infrastructure.

As for how we moved to Amazon — and why we did it — check out this set of slides:

  • Drupal in the Cloud: Scaling with Drupal and Amazon Web Services.

http://www.slideshare.net/elstudio/drupal-in-the-cloud-scaling-with-aws-presentation?src=embed

Frank of Phase2 Technology and I put these together for today’s Northern Virginia Drupal Meetup. Thanks to everybody who came out for a listen.

Loading mentions Retweet
Filed under  //   cloud   code   drupal   lamp   nptech  

Comments [0]

PHP Configuration for Leopard

Both Apache 2.2 and PHP 5 come with every installation of Mac OS X 10.5 Leopard. MySQL does not. There are a couple of tricks for installing and/or turning them on —and thereby attaining Development Happiness.

Here’s how we configure our development machines at the studio, where our PHP work is primarily Drupaland we use several virtual hosts.

Install MySQL

Not hard, but a little long for this post. Take a look at our instructions for installing MySQL on Leopard.

Configure Apache for PHP and Virtual Hosts

Though Leopard ships with PHP, it’s not turned on by default. Let’s change that, and also turn on the virtual hosts that we’ll use for our various Drupal installs.

  • Edit Apache’s configuration file to make the following two changes:

    sudo vi /etc/apache2/httpd.conf
  • Uncomment line 114 so it looks like this:

    LoadModule php5_module libexec/apache2/libphp5.so
  • Uncomment line 461 so it looks like this:

    Include /private/etc/apache2/extra/httpd-vhosts.conf

Add your Virtual Hosts

Edit /etc/apache2/extra/httpd-vhosts.conf to add your configuration. See our sample configuration for ideas.


NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin eric@localhost
    DocumentRoot "/Users/eric/Sites/agc"
    ServerName agc.local
    RewriteLog /private/var/log/apache2/rewrite_log
    RewriteLogLevel 0
</VirtualHost>

A couple items of note:

  • For development, we put our virtual hosts under users’ ~/Sites folder. That way there are no permissions issues to prevent Apache from serving the code — or from deploying fresh.
  • You’ll also have to put agc.local into DNS.

Add the new virtual hostnames to /etc/hosts

Edit /etc/hosts to add a couple of nicknames for localhost:

127.0.0.1 localhost agc.local giving.local givingedit.local miyo.local

Start Apache

  • Start System Preferences from the Apple menu.
  • Go to the Sharing tab
  • Click the checkbox by “Web Sharing”

Done. Let’s test everything by starting Safari and visiting http://agc.local

Loading mentions Retweet
Filed under  //   code   how to   lamp   leopard   os x  

Comments [0]

Installing MySQL on Leopard

MySQL now provides compiled binaries for Mac OSX 10.5 Leopard. But the startup applet doesn’t work properly yet on Leopard.

So here’s how to install MySQL on Leopard and start it using launchd — the standard Leopard way. These instructions should work for both Tiger (10.4) and Leopard (10.5).

  • Download MySQL for your OS and architecture (PowerPC or Intel; 10.4 Tiger or 10.5 Leopard)
  • Install MySQL from the package in the dmg — something like mysql-5.0.51a-osx10.5-x86_64.pkg
  • DO NOT install the startup item package — it doesn’t work on Leopard (as of version 5.0.51a).
  • DO NOT install the preference pane — it doesn’t work on Leopard (as of version 5.0.51a, though a fix is in the works).

Starting MySQL

Since neither the preference pane nor startup item work on Leopard, let’s use launchd to start MySQL instead.

  • Copy com.mysql.mysqld.plist to /Library/LaunchDaemons
  • To start MySQL, use the launchctl command:

    sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
  • Stop mysqld with an unload

    sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist

The -w in either of these commands leaves mysqld running (and restarts it as needed) until you turn it off with the other launchctl command.

For convenience, you may want to create an alias for these commands in .bashrc

alias start_mysql='sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist'
alias stop_mysql='sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist'

One other convenience — put mysql and mysqldump into your path:

cd /usr/local
sudo ln -s mysql-5.0.51a-osx10.5-x86_64 mysql
cd bin
sudo ln -s ../mysql/bin/mysql .
sudo ln -s ../mysql/bin/mysqldump .

Done. So we’re ready to fire it up and connect:

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
mysql -u root -p

Loading mentions Retweet
Filed under  //   code   how to   lamp   leopard   os x  

Comments [0]