• Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Coolest Guides on the Planet

coolest guides on the planet

Come for the software, stay for the community

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Fastest Way of Installing Drupal 7.22 on Mac OS X 10.7 , 10.6

July 20, 2011 2 Comments

Fastest Way to install the latest Drupal 7 version on Mac OS X Lion 10.7

fast-drupal-osx-lion-install

fast-drupal-osx-lion-install

Drupal is a quality CMS application and is as simple or complex as your needs vary, it runs on the same foundations that Mac OS X Lion or Snow Leopard provides.

This tutorial assumes a certain degree of comfort in the command line application (in the Utilities folder) Terminal for installing Drupal 7 on Mac OS X Lion or Snow Leopard but if the instructions below are followed correctly it will get the job done easily.

Before proceeding Drupal needs a couple of things to get going and those things are what is called an AMP stack  – Apache, MySQL and PHP. Apache and PHP already come bundled in OS X and just need to be enabled but MySQL needs to be downloaded and configured, luckily a point and click installer is provided. Optionally and preferably also install phpmyadmin to manage the database from a browser.

To get the AMP stack working correctly on OS X follow this guide on Apache/MySQL/php and for phpMyAdmin if required. Once these components are in place you are OK to proceed.

OS X has 2 web document roots ‘/Library/WebServer/Documents’ and ‘/Users/username/Sites/’ also known as ‘~/Sites’ this guide uses  ‘~/Sites’.

This tutorial assumes that the shared drupal directory will be called “drupal“. The mysql database will be called drupal and the mysql user is root. This takes into account that OS X has apache/mysql/php and phpmyadmin all ready installed and runnng. All of the installation takes place in the command line using OS X’s Terminal application.

Drupal Download and Configure

Make a sharing directory and move into it

 mkdir ~/Sites/drupal ; cd ~/Sites/drupal

get the latest drupal,  swap 7.x for incremental updates

 curl -O http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz 

expand it

tar -xvzf drupal-7.22.tar.gz 

move all files into shared directory one level up

mv drupal-7.22/* .

move hidden files one level up

mv drupal-7.22/.* .

remove compressed archive and empty directory

rm -rf drupal-*

create a settings file

cp ~/Sites/drupal/sites/default/default.settings.php ~/Sites/drupal/sites/default/settings.php

fix permissions on the default directory and settings file

chmod -R a+w ~/Sites/drupal/sites/default

or do the first lot in one hit (good for a script for multiple installs) 

mkdir ~/Sites/drupal ; cd ~/Sites/drupal ; curl -O http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz ;tar -xvzf drupal-7.22.tar.gz ; mv drupal-7.22/* . ; mv drupal-7.22/.* . ; rm -rf drupal-* ; cp ~/Sites/drupal/sites/default/default.settings.php ~/Sites/drupal/sites/default/settings.php ; chmod -R a+w ~/Sites/drupal/sites/default 

Create the Drupal Database

create a new database (no space between -p and password – as an alternative this can be done in phpmyadmin

mysql -u [username] -p[password] -e "create database [databasename];"

or in phpMyAdmin

phpmyadmin-drupal-database-create

create database in phpmyadmin

open it up in your default browser

open http://localhost/~username/drupal/

Finish the Drupal Install

Finish the install via the browser…

osx-fast-drupal-install

osx-fast-drupal-install

All done! faster than you can say “bitnami”

If this is your first time installing Drupal, go with the Standard option, then when you get to the Database configuration put in the details you used previously in this case the db was “drupal” and the db user was “root”. In the advanced options you can tweak the db prefix, port and host, the default “localhost” should be fine for this purpose.

Next steps are to create a master admin account and a few generic system settings and you are done.

finish-drupal-install

finish-drupal-install

Post Installation Tips

As a foot note, to sort out clean URLs, the .htaccess needs a tweak as the install is in a subdirectory, the “RewriteBase” needs to be explicitly set:

# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /~username/drupal

And also for smoother compatibilities for Drupal upgrades and module/theme add on installs change the local ownership to _www on your drupal web shared directory

sudo chown -R _www ~/Sites/drupal

Upgrading Drupal

To upgrade an incremental version of Drupal – say from 7.7 to 7.22, you download the new core base files and replace the current files in the web root apart from the Sites directory, and if customized the .htaccess file.

After replacing the files run a database update:

http://mydomain.com/update.php

or from within Drupal Admin > Reports > Available Updates > Update

Cats: Drupal, macOS, Open Source, Tech Tags: 10.6, 7, clean, clean urls, curl, drupal, lion, mac, OSX, terminal, urls

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Discuss

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls
Get DesktopServer

Lynda

Lynda.com Online Training Videos

TreeHouse

smlinks

Learn WordPress
osx-modify-shell-path

How to Add to the Shell Path in macOS Big Sur and Catalina using Terminal

October 19, 2019

virtual-hosts osx 10.10 yosemite

Set up Virtual Hosts on macOS Catalina 10.15 in Apache

October 19, 2019

Installing Homebrew on macOS Catalina 10.15, Package Manager for Linux Apps

October 18, 2019

Where is the bash shell in macos Catalina?

October 12, 2019

Refine your search

  • All
  • Modules
  • Themes
  • Documentation
  • Forums & Issues
  • Groups

RSS ars technica

  • Musi says evidence shows Apple conspired with music industry on App Store ban
  • Trump threatens Apple with 25% tariff to force iPhone manufacturing into US
  • I helped a lost dog’s AirTag ping its owner: An ode to replaceable batteries
  • Apple legend Jony Ive takes control of OpenAI’s design future
  • Epic goes to court to force Fortnite back on US iOS

RSS mac surfer

  • Tot is new text editor for Mac, iPhone, and iPad focused on constraints and ease of use
  • TiPbITS: Google Drive Sorting Can Hide New Documents
  • How to take a screenshot on a MacBook Pro
  • How To Create Simple Animation With Mac Keynote
  • Last Week on My Mac: Virus pandemics

Donate

Copyright © 2025· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2025 · gee on Genesis Framework · WordPress · Log in