Note: You are currently viewing documentation for Moodle 3.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Complete Install Packages for Mac OS X.

Complete Install Packages for Mac OS X: Difference between revisions

From MoodleDocs
m (removing categories)
 
(42 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Installing Moodle}}
#REDIRECT [[Installation Package for OS X]]
==Summary==
The complete install packages for Mac OS X are named Moodle4Mac and allow a very easy way to install Moodle on your Mac computer (laptop, desktop, server). Moodle4Mac is available from  [http://download.moodle.org/macosx/ Moodle  packages for Mac OS X]. You will find other downloads for Linux and Window Operating Systems that may involve more customization of configuration files.


Moodle4Mac does not have sufficient security for public, production servers -- only use for private, local testing purposes. If you want to use Moodle on an OS X Server connected to the internet please read the instructions [https://docs.moodle.org/en/Step_by_Step_Installation_on_a_Mac_OS_X_Server Step by step installation on a OS X Server].
[[de:Installationspaket für OS X]]
 
[[es:Paquetes de Instalación Completos para Mac OS X]]
These packages allow Moodle to be installed, along with the prerequisites that includes a web server, database and scripting language (Apache, MySQL and PHP in this case). Several versions of the complete install package are available. You will find versions for Intel based Macs and for older PPC based Macs. Please use the correct version for your processor. The instructions on the download page provide guidance on which version is likely to be most suitable.
 
'''Note 1:''' The latest complete install package version components, may not be backwardly compatible. Always check version compatibility of each component if you intend to develop materials on a later version of Moodle than the version installed on your "main" Moodle site. In short, complete install packages are designed for first time install on a "clean" machine.
 
'''Note 2:''' If you want a secure, public server with OS X, you may be interested to use the normal web server that comes preinstalled with every Mac Computer--see the [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client]] for Moodle.  However, remember that the complete package Moodle4Mac is ready to use and no additional programs must be installed and configured together.
 
 
==System requirements==
  + Apple OS X Computer
  + iMac, Mac mini, MacBook, Mac Pro, Xserve
  + Processor: Intel x86_64 (i5, i7, Xeon, Core 2 Duo)
  + RAM: 2 GB or better
  + Hard Disk: 800 MB free
  + System Software: OS X 10.6, 10.7, 10.8
 
==Install complete package Moodle4Mac==
===Download and install Moodle4Mac===
'''Step 1:'''  [http://download.moodle.org/macosx/ Download] the zipped disk image file from the Moodle download page.  Please choose the correct file for your processor type.  The zip archive should be unzipped automatically when the download is complete.  If the download file is not unzipped please do this manually.
 
'''Step 2:'''  Doubleclick the file Moodle4Mac.dmg to mount the installation disk.
 
[[Image:Moodle4Mac_1.png|500px]]
 
 
'''Step 3:''' Move the folder '''MAMP''' into the folder '''Applications'''. Moodle4Mac is based on MAMP (Mac OS X, Apache, MySQL, PHP).  MAMP does not save parameters in a registry or in system variables. If you want to delete Moodle4Mac you only need to move the MAMP folder into the Trash. For more information about MAMP please look at the [http://mamp.info/ project page].
 
 
'''Step 4:''' Now you are ready to start your web server.  Go to the Applications folder.  Find the MAMP folder and open it. 
 
[[Image:Moodle4Mac_2.png|500px]]
 
 
'''Step 5:''' Doubleclick the icon MAMP to start the server.
 
[[Image:Moodle4Mac_4.png|500px]]
 
 
'''Step 6:''' Start your browser and type <nowiki> http://127.0.0.1:8888 or http://localhost:8888 </nowiki> in the address bar. You will start your preinstalled Moodle. You do not need to do any installation. You are ready. Done ... hey, that was easy, wasn't it??
 
[[Image:Moodle4Mac_3.jpg]]
 
 
'''Step 7:''' Please login with the username '''admin''' and the password '''12345''' and you will be the main administrator of your new local Moodle.
 
==Using Moodle4Mac as a local server in your network==
 
In some workshops we used Moodle4Mac as a quick server installation for our local network. You should change the admin passwords (Moodle and MySQL) before you do this. There are only two steps to get the server connection from every computer in your network. One step is the change of only one line in the Moodle config.php, and the second step is that you must open the firewall of the Mac OS X. This chapter shows how you can do this.
 
===Edit the file config.php===
 
Use the current ip address of your computer instead of localhost so an external computer can connect the the web server. If your network is configured to dynamic ip addresses via DHCP please make sure that your computer retains its ip address while you want to use it as a Moodle server.The best thing would be to get a static ip address for your computer. Mostly your ip address in a local network will show one of the following numbers 10.x.x.x, 172.x.x.x, or 192.168.x.x
 
If your computer for example has the ip address 192.168.0.20 then you must change the configuration from ''localhost'' to ''192.168.0.20''. In the following box you will see this address in the line $CFG-&gt;wwwroot. This ip address will be different in your own network. You must use own address for your own network!! Please do not use an ip address if you do not know what you are doing ... ask your network administrator.
 
<pre>&lt;?php  /// Moodle Configuration File
 
unset($CFG);
 
$CFG-&gt;dbtype    = 'mysql';
$CFG-&gt;dbhost    = 'localhost';
$CFG-&gt;dbname    = 'moodle24';
$CFG-&gt;dbuser    = 'moodle';
$CFG-&gt;dbpass    = 'moodle';
$CFG-&gt;dbpersist =  false;
$CFG-&gt;prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbsocket' => 1,
);
 
// Use the ip address of your computer instead of localhost
$CFG-&gt;wwwroot  = 'http://192.168.0.200:8888/moodle24';
// $CFG-&gt;wwwroot  = 'http://localhost:8888/moodle24';
$CFG-&gt;dataroot  = '/Applications/MAMP/data/moodle24';
$CFG-&gt;admin    = 'admin';
 
$CFG-&gt;passwordsaltmain = 'some_very_long_secret!#A12345678901234567890!';
$CFG-&gt;directorypermissions = 00777;  // try 02777 on a server in Safe Mode
 
require_once("$CFG->dirroot/lib/setup.php");
 
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
</pre>
 
===Open the firewall===
The web server that comes together with Moodle4Mac works on the TCP port 8888. Moodle4Mac uses this port because this gets no conflicts with the normal web server of Mac OS X that answers on TCP port 80. You can switch the port from 8888 to 80 but you must know the administration password of your Mac. In this case the normal web server will not work.
 
To open the firewall please go to '''System Preferences > Sharing > Firewall'''. Choose '''New...''', fill in TCP port 8888, and set the rule name '''Moodle4Mac'''.
 
[[Image:Moodle4Mac_Firewall1.png]]
 
When the rule exists it must be activated to get a connection to Moodle from any computer in your internal network.
 
[[Image:Moodle4Mac_Firewall2.png]]
 
===Connect Moodle from your network ...===
Your web server can be connected with the url http://x.x.x.x:8888/moodle18/ in your local network, where x.x.x.x is the address your Mac was given by the local router on your LAN.  Usually such numbers start with 10.x.x.x, 172.x.x.x, or 192.168.x.x.  All users from any computer in your network can use your Moodle via this address.
 
This also works if your computer is connected to the internet directly. If you open the firewall in your internet router and if you forward the port 8888 to your computer then any user everywhere on the world would be able to work with your Moodle ... but please remember also that there are a lot of security risks if you do this ... it would be better if you don't do this!!
 
[[Image:Moodle4Mac_Network1.png]]
 
[[Image:Moodle4Mac_Network2.png]]
 
==Some words about the security ...==
===MAMP is designed for local computers===
MAMP can be used for testing and developing websites locally on their Apple computers. MAMP should not be used in a production environment because everybody knows all the settings and all the predefined passwords. It's prepared for an easy start and not for a public web server!! But with some careful modfications, you can sufficiently secure MAMP and Moodle4Mac to use them in public development environments.
 
===How to secure MAMP?===
I found some ideas in the following document:  [http://www.network0.org/2006/09/23/how-to-secure-mamp/ How to secure MAMP?]. It's really old and some of the instructions are not correct for the current version.
 
There is also a new package MAMP Pro that will let you do a lot of settings for a more secure web server. Please look to the web page for this product. You can find a describtion for MAMP Pro on the [http://www.living-e.com/MAMP-PRO/ MAMP internet server]. It's commertial and not free!
 
===Step by step to secure Moodle4Mac===
 
 
<br />&nbsp;
==How to set up SSL/https in MAMP for a development/test environment==
The text is copied from [http://www.webopius.com/content/355/getting-mamp-working-with-ssl-on-os-x webopius web site] (excepted the last steps).
 
#stop MAMP
#backup your /Applications/MAMP/conf folder
#open a terminal
#enter: ''openssl genrsa -des3 -out server.key 1024''. Enter a password twice.
#enter: ''openssl req -new -key server.key -out server.csr''. Enter the previous password. You need to answer some questions. ''Common name'' expects your local name (for me it was jerome.moodle.local)
#enter: ''openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt''
#enter: ''cp server.key server.tmp''
#enter: ''openssl rsa -in server.tmp -out server.key''. Enter the previous password.
#enter: ''mkdir /Applications/MAMP/conf/ssl''
#enter: cp server.crt /Applications/MAMP/conf/ssl
#enter: cp server.key /Applications/MAMP/conf/ssl
# Edit Applications/MAMP/conf/apache/ssl.conf:
##comment <IfDefine SSL> tag to closing tag (but not the content)
##SSLCertificateFile /Applications/MAMP/conf/ssl/server.crt
##SSLCertificateKeyFile /Applications/MAMP/conf/ssl/server.key
# Edit /Applications/MAMP/conf/apache/httpd.conf:
##Listen 80
##comment <IfDefine SSL> tag to closing tag (but not the content)
# Edit /Application/MAMP/conf/apache/ssl.conf, change the document root (DocumentRoot) for the one you have into /Application/MAMP/conf/apache/httpd.conf
#in a terminal enter: ''cd /Applications/MAMP/bin/apache2/bin''
#enter: ''sudo ./apachectl startssl''
#start MAMP
 
From now MAMP should start/stop with the SSL support activated. Note that these steps have only be tested with Apache port set to 80 into MAMP preferences.
 
==How To Update Your Moodle4Mac==
It is very simple to update your locally installed Moodle. You start the update with a double click and everything happens automatically. All courses rest in Moodle. You do not need to renew your local Moodle completely ... you only get the new Moodle files.
 
===Update the local Moodle via Git===
Make sure that the Git program is installed on your Mac (see instructions below). You also need an Internet connection because the files are downloaded from the Moodle update server. A double click on the icon UpdateMoodle.sh starts the script and updating occurs automatically. That's really all ... could it be easier?
 
[[Image:Moodle4Mac_Update1.png]]
 
The Git program connects to the Moodle server and controls which files are new, which have changed and which have been deleted. The transmission time depends on the internet connection. With Git only really necessary files will be transmitted. If the transfer takes too long, you can abort the process with <ctrl>-c. You can easily start the update again later.
 
[[Image:Moodle4Mac_Update2.png|550px]]
 
<br />&nbsp;
 
===Script control ... looking inside ... ===
 
If you want to see what is inside the document '''UpdateMoodle.sh''' please feel free to open it with a text editor, e.g. TextWrangler.
 
It is only a text file but it uses a OS X feature to open and execute the script with the Terminal program. You don't need to learn anything ... doubleclick to update everything.
 
<pre>
#! /bin/sh
#
#  This GIT installer for Mac OS X is part
#  of the installation package Moodle4Mac
#
#  20121206 - Ralf Krause
#
 
echo
echo "+--------------------------------------------+"
echo "| GIT updater for your local Moodle server"
echo "+--------------------------------------------+"
echo
 
cd /Applications/MAMP/htdocs
 
if ! test -e moodle24/.git ; then
    ## for the first update ... git needs to download everything
    git clone --depth 1 -b MOODLE_24_STABLE git://github.com/moodle/moodle.git moodle24-git
    if test -e moodle24 ; then
        if test -e moodle24/config.php ; then
            sudo cp moodle24/config.php moodle24-git/.
        fi
        DATE=`date +%Y%m%d-%H%M`
        mv moodle24 moodle24-$DATE
    fi
    mv moodle24-git moodle24
    ## you can delete the old folder now
    ## rm -R moodle24-*
else
    ## the git update only gets the new and changed files
    cd moodle24
    git pull
    cd ..
fi
</pre>
 
The different versions of the script UpdateMoodle.sh only differ in two parameters ... first we need to know the right folder for Moodle and second we must use the correct git tag for the Moodle version. The shown script upgrades Moodle 2.4.
* Moodle 2.0 uses <span style="color:red;">MOODLE_20_STABLE</span>
* Moodle 2.1 uses <span style="color:red;">MOODLE_21_STABLE</span>
* Moodle 2.2 uses <span style="color:red;">MOODLE_22_STABLE</span>
* Moodle 2.3 uses <span style="color:red;">MOODLE_23_STABLE</span>
* Moodle 2.4 uses <span style="color:red;">MOODLE_24_STABLE</span>
* Moodle 2.5dev uses <span style="color:red;">master</span>
 
===Install Git===
 
Download the Git program from  http://git-scm.com/download/ ... it's free and open source.
 
[[Image:Moodle4Mac_Git1.png]]
<br />&nbsp;
 
Open the disk image and doubleclick the installer git-xxx-osx.pkg. If you want to know more about Git then read the Git documentation on their web site ... but if you only want to update Moodle the script '''UpdateMoodle.sh''' should also work without reading
 
[[Image:Moodle4Mac_Git2.png|500px]]
<br />&nbsp;
 
==See also==
* [http://mamp.info  MAMP = Mac + Apache + MySQL + PHP]
* [http://en.wikipedia.org/wiki/MAMP MAMP in Wikipedia]
* [[Step by Step Installation on a Mac OS X Server|Step by Step Installation on a Mac OS X Server 10.5/10.6]]
* [[Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client|Step by step Installation on a Mac OS X Client 10.4]]
* [[CVS for Administrators]]
 
* [http://en.wikipedia.org/wiki/Private_network Private network addresses in Wikipedia]
* [http://moodle.org/mod/forum/discuss.php?d=24632 Using Moodle: Dynamic DNS Home Server]
 
[[Category:Mac OS X]]
 
[[de:Vollständiges Installationspaket für Mac OS X]]

Latest revision as of 07:01, 16 October 2015