Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Step by Step Installation on a OS X Lion Server.

Step by Step Installation on a OS X Lion Server

From MoodleDocs

Overview

This guide shows all steps for the installation of Moodle on a OS X Lion Server - the new name for Mac OS X 10.7 Server. This server is a commercial product. The OS X Lion 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 installation guide can't be useful for an installation on MAMP or XAMPP. If you are looking for an easy way to install Moodle on your local machine please use Complete Install Packages for Mac OS X that can be downloaded from http://download.moodle.org/macosx/ ... but if you are planning to set up a Moodle internet server on a Mac then you should think about some more security as the ever local packages MAMP or XAMPP could give.

Please feel free to add your ideas and wishes to the discussion page for this article. You may also write a complete chapter if you tried the facts yourself on your own OS X Lion Server. I am most interested to make the things better.

System requirements

+ Apple Computer 
+ Mac mini, Mac Pro or Xserve
+ Processor:  Intel Core i3/i5/i7 or Intel Core 2 Duo
+ RAM: 2 GB or better
+ Hard Disk: 500 MB free
+ System Software: OS X Lion Server 10.7

The OS X Lion Server is a pure 64-bit software and does not work on old Macs with G3, G4, G5, Intel Core Solo or Intel Core Duo.

Activate the web server

Configure PHP for Moodle

You should control and set the following php parameters. To activate the new settings you must restart your web server.

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

; Maximum size of POST data that PHP will accept. (8M)
; http://php.net/post-max-size
post_max_size = 512M

; Maximum allowed size for uploaded files. (2M)
; http://php.net/upload-max-filesize
upload_max_filesize = 500M


Install a more complete PHP from LiiP

The php installation in the OS X Lion Server software is not totally complete for Moodle. For example the php intl extension is missing and it's not easy to extend the original php from Apple. So it's very nice to see that there comes a "one line installer for PHP" from LiiP which writes a complete php without deleting the original one. Please read the blog entry "PHP 5.3 for OS X 10.6 one-line installer" and "PHP 5.3/5.4 for OS X 10.6/10.7 as binary package" on the LiiP server. You can choose to install PHP 5.3 or PHP 5.4 (while this part is written you can get PHP 5.3.10 or PHP 5.4.4) http://blog.liip.ch/archive/2011/04/13/php-5-3-for-os-x-10-6-one-line-installer.html http://php-osx.liip.ch/

Use PostgreSQL on your server

Configure PostgreSQL for Moodle

Install MySQL on your server alternatively

Configure MySQL for Moodle

Copy the Moodle files to your server

Run the Moodle installation

Download the language packs

Setup the cron job with launchd

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>moodle4mac.cron</string>
	<key>KeepAlive</key>
	<false/>
	<key>RunAtLoad</key>
	<true/>
	<key>Username</key>
	<string>root</string>
	<key>ProgramArguments</key>
	<array>
		<string>php</string>
		<string>/Library/Server/Web/Data/Sites/Default/moodle/admin/cli/cron.php</string>
	</array>
	<key>StandardErrorPath</key>
	<string>/dev/null</string>
	<key>StandardOutPath</key>
	<string>/dev/null</string>
	<key>StartInterval</key>
	<integer>300</integer>
</dict>
</plist>

How to install and update Moodle with cvs

How to install and update Moodle with git