Note: You are currently viewing documentation for Moodle 3.8. Up-to-date documentation for the latest stable version of Moodle may be available here: Step by Step Installation on a Mac OS X 10.5 Server.

Step by Step Installation on a Mac OS X 10.5 Server

From MoodleDocs

Overview

This guide shows all steps for the installation of Moodle on a Mac OS X 10.5 Server. This server is a commercial product.

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 10.3/10.4/10.5 that can be downloaded from http://download.moodle.org/macosx/ . But if you are planning to set up an Moodle internet server on a Mac then you should think about some more security as the local package 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 Mac Server. I am most interested in the "user administration via LDAP" and I hope to get enough ideas how to get all Mac users into the Moodle user list automaticly.

System requirements

+ Apple Computer 
+ Mac mini or Xserve
+ Processor:  Intel Core 2 Duo or PPC (G4, G5)
+ RAM: 1 GB or better
+ Hard Disk: 500 MB free
+ System Software: Mac OS X 10.5 Server

Install the GD Library on the Mac OS X 10.5 Server

The Mac OS X Server 10.5 Leopard comes together with PHP 5.2.4 ... this is correct for Moodle but not the missing GD Library support. To see which PHP version is installed on your server you should edit the file /Library/WebServer/Documents/info.php. You must activate the function call phpinfo() by deleting the both slashes // at the start of the function line. After saving the file you can get all PHP informations in your browser. Please look at http://server-address/info.php ... you will not find the GD library support.

<?php
// You can use Server Admin to enable the Apache PHP module; it's disabled by default.
// You can uncomment the phpinfo() directive below to provide a default PHP info page
// but note that this displays information about your host's configuration.
phpinfo();
?>


To get this missing GD library support into your Mac Server it would be the easiest way that you download the file PHP 5.2.5 (beta6 or newer). For the package please try this URL http://www2.entropy.ch/download/php5-5.2.5-6-beta.tar.gz or search inside the forum PHP on Mac OS X for a newer one. Download and unpack the package. Move the contained folder php5 into /usr/local ... so you get /usr/local/php5 ... and change the owner to root.

sudo mv /usr/local/php5 ~/Desktop/php5.old 
curl -O http://www2.entropy.ch/download/php5-5.2.5-6-beta.tar.gz 
tar -xzf php5-*-beta.tar.gz 
sudo mv php5 /usr/local/
sudo chown -R root:admin /usr/local/php5


Now the web server must know that you want to use a new PHP library from now on. Therefore edit the file /etc/apache2/httpd.conf. You should comment the line "LoadModule php5_module libexec/apache2/libphp5.so" by adding a # as the first character of the line. After this you add the new line "LoadModule php5_module local/php5/libphp5.so". Save the file.

#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module local/php5/libphp5.so


The second thing you must configure is the file php.ini. You will find the file inside the new package. Edit /usr/local/php5/lib/php.ini. To contact the database MySQL with PHP you have to set the default socket name for local MySQL connects. Save the file.

mysql.default_socket = /var/mysql/mysql.sock


That's all ... restart the web server. Now you should look at http://server-address/info.php again. I hope that everything will be okay and you will find the version number PHP 5.2.5 and the running GD library support. Congratulations ... the first step for Moodle on the Mac server is done!

phpinfo.png

phpinfo2.png

Configure the MySQL database for your Moodle installation

In standard case the database MySQL is installed on the Mac OS X 10.5 Server but it is not running yet.

Use the graphical way

Sorry ... there are some more installations and a lot of clicks to configure MySQL in a graphical way.

First of all start the Server Admin. You will find this program by the way Applications > Server > Server Admin. Activate MySQL on the local server. You must set the password for the user root before you can start MySQL.

For the next you must download the MySQL database administration tool phpMyAdmin from http://www.phpmyadmin.net . Move the folder to the web server documents as /Library/WebServer/Documents/phpMyAdmin and add the security phrase to the file config.inc.php. Now you will be able to start http://server-address/phpMyAdmin in your browser and to log into the database as the user root. Add a database moodle. Add a database user moodle to the server localhost. Don't forget to set a secure password. The database user moodle should be allowed to administrate the database moodle only. It is a bad way to set root to administrate the database moodle.

The installation of phpMyAdmin is a nice thing to look into the database while Moodle is running for some time. It's much easier to see in the graphical interface than in the command line tools.

phpmyadmin.png

Use the Terminal

If you want a quick installation then don't fear to use the Terminal. It's easier to tell you all the commands for the right way with the Terminal than showing you all the pictures to do the same with graphical tools. There are only a few commands to do everything I told you before.

Start the Terminal. You will find this program by the way Applications > Tools > Terminal. You will see that we must do the same steps as before but you can read them in a text form.

First of all you need to set the root password. If you didn't this before then use the first command line. If you want to change an existing password then use the second one.

Server:~ $ mysqladmin -u root password 'secret'
Server:~ $ mysqladmin -u root -p password 'topsecret'

The next steps are creating a new database moodle and setting up a database user moodle to administrate the new database.

Server:~ $ mysqladmin -u root -p create moodle
Server:~ $ mysql -u root -p

mysql> GRANT ALL PRIVILEGES ON moodle.* TO moodle@localhost
   -> IDENTIFIED BY 'moodle!';
mysql> quit

Server:~ $

That's really all with the Terminal. You are just ready!

Copy the Moodle files to the web server

The documents for the web server are saved in the folder /Library/WebServer/Documents/ . You will place your Moodle folder here after you got it from http://download.moodle.org

Run the Moodle installation

Download the language packages

Moodle is running ...

mooodle on a mac server.png

User administration via LDAP

How to update with CVS

See also