Last updated October 4, 2013. Created on April 22, 2010.
Edited by craig.norris, Screenack, Haza, cloudmaker. Log in to edit this page.

For information about setting up a local MAMP (Mac, Apache, MySQL, and PHP) server, see HowTo: Create a local environment using MAMP.

For an external server, follow these steps:

Note: If you're using Snow Leopard, you must first enable the GD library. Unlike previous versions of OS X, Snow Leopard comes with a version of PHP that supports the GD library without having to recompile PHP. To enable the GD library in PHP, edit the /etc/php.ini file, and then remove the initial semicolon (which comments the line) from the following line:


After you remove the semi-colon, restart the Apache server. The GD libraries will then be available in PHP.

Rebuild PHP5 to include the GD tools according to the instructions here.

  1. Install Drupal 7.0 as /Users/xxx/Sites/drupal, where user xxx is in the _www group, and ensuring that the entire installation is group-writable. Create a soft link from
    /Library/WebServer/Documents/xxx to /Users/xxx/Sites.
  2. Re-writing seems to be enabled by default in Apache2 on Leopard. Enable PHP5 and virtual hosts in Apache2 by uncommenting the following lines in /etc/apache2/httpd.conf:
    #Dynamic Shared Object (DSO) Support
    #LoadModule libexec/apache2/
    #Virtual hosts (This is just a marker for what follows so you should leave the #.)
    #Include /private/etc/apache2/extra/httpd-vhosts.conf
  3. Add a virtual host stanza to the /private/etc/apache2/extra/httpd-vhosts.conf file that has at least this in it:
    <VirtualHost *:80>
    DocumentRoot /Library/WebServer/Documents
    ServerName localhost
    <Directory /Library/WebServer/Documents>
    Options FollowSymLinks Indexes MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
  4. Add a variant of the RewriteBase /drupal line in the stock /Users/xxx/Sites/drupal/.htaccess file:
    IfModule mod_rewrite.
    RewriteEngine on
    # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
    # VirtualDocumentRoot and the rewrite rules are not working properly.
    # For example if your site is at <a href="" title="" rel="nofollow"></a> uncomment and
    # modify the following line: 
    # RewriteBase /drupal
     RewriteBase /xxx/drupal
    # Rewrite URLs of the form & to the form index.php?q=x&.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !=/favicon.ico<br /> RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  5. Make a copy of the /Users/xxx/Sites/drupal/sites/default directory tree as /Users/xxx/Sites/drupal/sites/localhost., and make sure this directory is writable by the _www group.
  6. Manually create the database in MySQL. Make a copy of
    /Users/xxx/Sites/drupal/sites/localhost/default.settings.php file as
    /Users/xxx/Sites/drupal/sites/settings.php, and then make this file writable by the _www group.

    Configure the database in /Users/xxx/Sites/drupal/sites/settings.php:

      $databases['default']['default'] = array(
        'driver' => 'mysql',
        'database' => 'databasename',
        'username' => 'username',
        'password' => 'password',
        'host' => 'localhost',
        'prefix' => 'main_',
        'collation' => 'utf8_general_ci',

You're now ready to install Drupal on your external server. Continue to Step 4: Run the installation script.

Looking for support? Visit the forums, or join #drupal-support in IRC.