Installing Drupal on CloudFoundry

## Introduction
CloudFoundry add support of PHP applications. An example of WordPress installation is provided on the docs directory. But it also possible to deploy Drupal CMS.

## Demo: Installing Drupal

The Drupal CMS can be run using CloudFoundry PHP support with very minimal changes.

Steps to get the application to run:

1. curl -O http://ftp.drupal.org/files/projects/drupal-7.8.tar.gz
2. tar -xzf drupal-7.8.tar.gz
3. rm drupal-7.8.tar.gz
4. cd drupal-7.8
5. cp sites/default/default.settings.php sites/default/settings.php
6. edit site/default/settings.php and replace "$database = array()" by :

$services = getenv("VCAP_SERVICES");
$services_json = json_decode($services,true);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => $mysql_config["name"],
'username' => $mysql_config["user"],
'password' => $mysql_config["password"],
'host' => $mysql_config["hostname"],
'prefix' => 'main_',
'collation' => 'utf8_general_ci',
);

7. vmc push drupalcf --url drupalcf.vcap.me --mem 256 -n
8. vmc create-service mysql --bind drupalcf
9. Visit http://drupalcf.vcap.me/install.php and enjoy your Drupal install!

4 thoughts on “Installing Drupal on CloudFoundry

    1. obuisson Post author

      During a ‘vmc push’, add –url options to the command line with your custom url. After app creation, you can play with ‘vmc map’ to add custom urls

      Reply
  1. Pingback: Node.js, ASP.NET, & Sinatra, Rails, Java, The List Goes On: Removing the OS Barrier with PaaS Part 3.14159265 | New Relic blog

  2. Pingback: 欢迎来到PaaS未来世界 – 云计算站

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>