Step by Step Installation on a OS X Mountain Lion Server

From MoodleDocs


This guide shows all steps for installing Moodle on Mountain Lion running OS X Server. This server is a commercial product. OS X Server can be used as an inhouse server as well as an internet server. You will find all documentations about the web server on the Apple support pages.

This guide DOES NOT show you how to setup Moodle on MAMP or XAMPP. If you do not have a web server currently running on your computer, please see Installation Package for OS X that can be downloaded from

Internet-accessible or "live" servers should use a more robust and secure implementation than provided by MAMP or XAMPP for OS X.

Please feel free to add comments to this page about any edits you believe should be made.

Installation Requirements

From Apple's Server Requirements Webpage:

+ Mac Computer
+ 2GB of memory.
+ 10GB of available disk space; some features require additional disk space.

Additional Requirements:

+ Hard Disk: 500 MB free
+ OS X Mountain Lion (10.8+, I'm using 10.8.2 Build 12C3012)
+ OS X Server (2+, I am using 2.2.1 Build 12T162)


All instructions will be written with following assumptions:

  • The administrator is comfortable using Finder, Safari, and standard text editors in OS X.
  • The administrator has already performed the initial configuration of OS X Mountain Lion and OS X Server.
  • The administrator has not performed anything more than the initial configurations.*
  • The administrator is comfortable using the following commands in terminal: cd, ls, vim, sudo.

*Performing these steps for the first time on a production server is NOT recommended. Always test software on a development server.

Before we begin

These instructions have been written based on my experience setting up Moodle in a highly customized server. I will test all instructions in a clean environment once I have more time availability. Anyone who would like to test these instructions and report back any errors, please leave a comment with the section and error. Please do not test these instructions on a production machine.

Copying Moodle to the Proper Directory

  1. Download the latest version of Moodle from (it should unzip automatically into your downloads folder)
  2. Copy/Move the "moodle" directory to /Library/Server/Web/Data/Sites/ (make sure you put the folder, not the contents)

Creating the Moodle Data Directory

The standard location for all shared data is the "Shared Items" folder at the root of OS X, so we are going to place the Moodle Data directory in "Shared Items"

  1. In finder, go to /Shared Items (You can use the Go->Go To Folder command)
  2. Create a new folder called MoodleData

Setting the proper permissions

Open To setup the Moodle folder run the following commands:

cd /Library/Server/Web/Data/Sites/
sudo chown -R _www moodle/

To setup the MoodleData folder fun the following commands:

cd /Shared\ Items/
sudo chmod -R a=rwx MoodleData/


Configuring the Websites Service in OS X Server

  1. Open
  2. In the sidebar, click Websites.
  3. Enable the checkbox next to "Enable PHP web applications"
  4. Create a new website by clicking the plus (+) in the bottom left:
    1. Fill in the domain name.
    2. Choose an IP Address if you want it to be different than Any.
    3. If you want the connection to be secured* (using SSL) choose an SSL Certificate that matches your domain name from above.
    4. Select your sites directory:
      1. In "Store Site Files In" choose "Other"
      2. Navigate to /Library/Server/Web/Data/Sites/
      3. Click "moodle"
      4. Press the "Choose" button.
    5. Edit Advanced Settings:
      1. Scroll down, and choose "Edit Advanced Settings..."
      2. Check the box next to "Enable Server Side Includes"
      3. Press the "OK" button
    6. Press the "Done" button
  5. Enable the Websites service by changing the toggle switch from OFF to ON

*All production servers should be secured and have a trusted SSL certificate. If you are storing real student data and you do not use SSL, your users will be passing their username and password in clear text.