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
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 --mem 256 -n
8. vmc create-service mysql --bind drupalcf
9. Visit and enjoy your Drupal install!

4 thoughts on “Installing Drupal on CloudFoundry”

    1. 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

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.