Steps 4 Smile Mac OS

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Step-by-step Guide for Installing Moodle on Mac OS X 10.4 Client.

These instructions were used to install PHP 5.1.2, MySQL 5.0.18 and Moodle with Mac OS 10.4.5 on a standard client Mac (not server version) to be used as a production server. Note that this procedure is more secure than the one-step Moodle4Mac package which is intended for a quick personal install. Moodle4Mac is not for public production use, unless you secured it following special instructions or the MAMP Pro package. The following procedure, however, uses the standard Apache 1.3 which comes on every Mac with OS X. This changes with Mac OS X 10.5, which introduces Apache 2.0 thoroughly integrated into the Mac server.
Note 1: These instructions were prepared by Don Hinkelman, on 20 March 2006 and changes may have occurred. 90% of instructions use a simple point-and-click interface (GUI), but occasionally you will need to open the Terminal (in Utilities folder) to type a command line. To complete all of these steps, I estimate it will take the following amount of time.
- 2 hours >> an experienced setup person
- 4 hours >> an adventuresome novice
- 6÷ hours >> a typical 'guy' who never asks for help--should have gone earlier to the moodle.org Installation forums.
Note 2: OS X does not allow MySQL to directly address the kernal, as Linux can do, so in versions 10.4 and under, speed is much slower than with a Linux server. Also a Linux server setup often includes a PHP accelerator which can increase Moodle speeds 5-10x.
Note 3: Due to speed issues I have noted above, I will likely not be upgrading my server to OS X 10.5. However if you test out a Leopard server, please report your findings here or on the 'Servers' forums of moodle.org.


Step 1: Prepare your Server

a. Choose an old or new Mac with OS X 10.4 Tiger. This procedure was done on a 933mhz single processor PowerMac.
b. Get a global IP address and a domain name assigned to your server. If you don't want to make a public production server, use the one-step Moodle4OSX download and forget these instructions. :-)
c. Turn on Apache (go to System Preferences >> Sharing >> Services, and then click 'Personal Web Sharing' to 'On'.)
d. Turn off energy saving: Go to System Preferences >> Energy Saver and set the computer sleep time to 'Never'. Uncheck the hard disk sleep box as well.
e. Download Tinkertool to turn on hidden files. Mac OS X normally hides many files in the system from ordinary users. This includes Apache and other files we will edit in later steps. In order to verify where a file or folder is, use Tinkertool to 'show hidden files'.
f. Upgrade your Mac OSX to the most recent version and include the most current Security Releases. After you you start running your Moodle server, you may not want to do any more OSX version updates, as the updates often patch Apache and break the whole installation, requiring a reinstall procedure.

Emoji are divided into several categories: Smileys & People, Animals & Nature, Food & Drink, Activity, Travel & Places, Objects, Symbols, and Flags If you don't want to scroll through all of them, you can use the search field to find emoji you'd like to use.

Step 4: Click Continue to advance to the next screen. Step 5: Click Choose to find the downloaded ISO file, whether it’s located internally or on a USB drive. Step 6: Determine the Windows. Then, restart your virtual machine. Mac OS X will now be able to boot normally and play audio. Step 7: Make the screen bigger Though this step is optional, I still recommend you do it anyways. Anyways, when you first use your Mac OS X, you'll probably notice one thing: your screen resolution is 1024x768. Step 2: Shut down the Mac and wait for 1-2 minutes. This will make sure the Mac is powered off. Step 3: Hold the Power and Option key simultaneously for 15 seconds. This will bring up the Startup Manager on Mac. Step 4: You will see all bootable devices attached to this Mac, including Macintosh HD and external USB or DVD. Click the drive name. Download and Unrar. Ok here are those files i promised you. Download and unrar them to a folder.


Step 2: Install PHP

a. Go to Marc Liyanage's site and download the PHP 5.1.2 (or later) for Apache 1.3 there. http://www.entropy.ch/software/macosx/php/

b. Click the installer and follow instructions. Do the test.php to see if your PHP and Apache are running. Unfortunately, this Entropy.ch package does not include a PHP accelerator that Moodle4OSX has.


Step 3: Install MySQL

a. Go to the main MySQL Download site and download MySQL standard version 5.0.18 (or later) for the Mac OS X (either PowerPC or x86) version that fits your machine. http://dev.mysql.com/downloads/mysql/5.0.html
b. Click the install package and follow instructions. Click the MySQLStartupItem package and follow instructions.
c. Make a new folder in /Library called 'PreferencePanes' (unless already there). Drag the MySQL.prefPane file into that folder. Restart your computer. Click on the System Preferences of OS X. You now see a preference pane active at the bottom of the System Preferences. When you open it, you should see that MySQL is 'running'. You should make sure the checkbox for automatic MySQL startup is checked.


Step 4: Make a Secure Database for Moodle

a. Go to Terminal and make a password for the MySQL root user. This is an important security point.

b. Go to Terminal and make a database for moodle, you might call, 'moodle', and a mysql user you might call, 'moodleuser'.First, type the following in Terminal to enter the MySQL monitor.

c. Inside MySQL monitor, you first make a database with the first line below, then make a new user and password for using that database, then 'flush' and 'quit'. These are important for making a secure setup.

Steps


Step 5: Install Moodle

a. Go to the Moodle Downloads page, download the version you want, and unzip it.
b. Move the moodle folder to this location: /Library/WebServer/Documents/moodle This is for the moodle program and will be accessible to the public. Then create another folder called 'moodledata' and put it in an inaccessable location such as /Library/WebServer/moodledata or another non-public area.
c. Set permissions. Here are some easy terminal commands that you can type in to setup permissions for your site. A nice side benefit is that this will allow you to use moodle's setup script to create config.php for you. All of them use 'sudo' to attain root access for the task. When you use sudo you will be prompted for a password - use the password of the user you have logged in to the Finder as. This first command sets the owner of your moodledata directory to 'www' and the group to 'admin'. The admin group is any user on your local system that has administrator privs. The www user is the user that the apache web server accesses the file system as.

You want to ensure that the apache user and local admins have access to read and write inside the moodledata folder. This next command opens access up completely to the www user and the admin group and make the folder unreadable by other non-admin users of your system.

This next command recursively sets the entire contents of your moodle install directory to have owner 'www' and group 'admin'. -R means 'recurse' - which will drill down through the contents of moodledata if there is anything there.

Since you have now given ownership of the moodle install directory away to another user you will want to ensure that you, as a local admin, can modify the contents of the moodle installation folder. This command allows anyone in the admin group to add files to the moodle folder structure and edit the contents of files. (g+w means group add write - see man chmod)

d. Run the Moodle installation script. Type the following URL into your browser (use Firefox, Safari has a few incompatibilities with Moodle).

In this script, you will probably need to adjust the Data Directory. Delete part of path that says 'Documents', to match the exact path where you put the 'moodledata' folder.If you are installing Moodle ver. 1.6, you may get this error message, 'The selected database is running under a non-recommended encoding. Use one that is unicode...'. I was able to solve this problem later, by going to the main Moodle Admin page and clicking on the Unicode Migration button near the top.


Step 6: Make a Cron Job

Several Moodle functions require periodic actions called 'cron jobs' (such as sending out email messages from forums). To make a cron job, I downloaded Cronnix, http://www.macupdate.com/info.php/id/7486, a GUI interface for editing the crontab in Mac OS X. In Cronnix, I opened a 'system' crontab (not user) and set the schedule to: */5 * * * (min= 5, hour = *, Mday = *, month = *, Wday = all). And then inserted the following line into the 'command' box as per Martin’s suggestion…

Steps 4 Smile Mac Os 11


Step 7: Turn on the Postfix Mail Server

The mail server in OS X is called Postfix. Although it is ready to use, it is not unconditionally activated. To turn it on constantly, download the freeware called 'WitiSMTP' and turn on the outgoing mail server. In WitiSMTP, you just click on 'Enable Postfix...' and then go into your Mail application >> Preferences >> Accounts to rename the SMTP mail server as 'localhost'.


Step 8: Adjust PHP and Moodle Settings

a. Get a text editor such as the free TextWrangler, and open the following files to make typical adjustments.

b. Change PHP settings. First, raise the PHP memory limit. Moodle recommends a memory limit of 16M, not the default 8M. To do this, find the php.ini file (after you used Tinkertool to reveal hidden files). Find the line that says php_value memory_limit and change the value from 8M to 16M. Second, raise the limit for file uploads. The default limit with this Apple setup seems to be 2mb or 8mb, which is very small for course uploads, large documents, and multi-media files. Raise it to 20MB or higher, and you can adjust limits inside Moodle modules later. I raised my setup to 80M, in order to upload large courses, such as the California State Introducation to Moodle course (67mb). To do this, go to the php.ini file at this path: /usr/local/php5/lib/php.ini and scan through the file to find two more lines--each in a different spot. Change the defaults to the following:

Remember, you as the administrator, can limit uploads in specific modules (such as forums) as well.

[Note: in Apache 2 and possibly other situations, you may have to edit your Apache settings as well]Go to this file: /private/etc/httpd/httpd.confOpen the file in your text editor, and add the following line.

Then restart Apache (or restart your whole server). To increase speed and reduce the OS overhead, do not run any other programs on your OS X server. In fact, log out all users for best performance.


Step 9: Clean Up

Wash coffee cups, toss chewed up pencils, and wipe your desk off. Congratulate yourself on some excellent webmastering. And bask in the glory of having a real Mac server that you know how to easily control and configure. :-)

Retrieved from 'https://docs.moodle.org/19/en/index.php?title=Step-by-step_Guide_for_Installing_Moodle_on_Mac_OS_X_10.4_Client&oldid=28136'

Written by Jonathan Richter

In an attempt to get PHP-GTK2 to work on Mac OS X 10.4, I found very little information and support on that subject. After a lot of failures and errors I got it to work.

Below I'll write every step I took. I am not very comfortable with Terminal and half of the time I have no clue what I am doing. So you can use this information but totally on your own risk. I just worked for me. I hope it will help anybody else too.

please be adviced that doing all steps below takes several hours.

Resources I found helpful:

Get the newest Xcode (also called: Developer Tools) from Apple. You really need this. Go to connect.apple.com. Sign in or sign up (for free). Go to Downloads.

On the right in the Downloads Box, click Developer Tools and download the newest Xcode. In my case version 2.4.1, 923 MB big. After downloading, use the installer and follow the instructions.

I started with using Fink, but halfway it failed by not having a package that was needed (GTK 2.6 or higher). I started all over using Macports.

Go to macosforge/InstallingMacPorts.

You already did part of the first step by downloading Xcode. I followed all instructions on that page and it worked fine.

The newest version didn't have a normal Apple installer. So I downloaded this: DarwinPorts-1.3.1-10.4.dmg

Install Macports by double-clicking the installer in the disk image.

In Terminal, type: sudo port install gtk2

I already had a standard OS X PHP 4.4.4 installation and a PHP5 installation from Entropy.ch, but it didn't work out. I deleted my PHP5 installation from Entropy.

If you want to run Apache 1 or 2 with PHP4 or 5, Entropy is absolutely the best place to get it.

In Terminal, type: cd / and sudo port install php5

Take a coffee, this takes a while... about 2 hours on my machine. (Macports installs everything in a folder called /opt. I put the 'cd /' to place that folder in the root.)

On the other tutorial, you see a --disable-libglade as a parameter for installing PHP-GTK. I don't know why they wrote that. Be very sure that you really don't want Glade. Read about it here: glade.gnome.org.

Check out the screenshots too. I installed without Glade but after a day I did it all over to get Glade working too. If you want to continue without Glade, skip the next step.

For some reason, I got errors doing this. Then I tried again the same in Terminal, but now with X11 open in the background with no errors this time. So, open X11 and hide it (apple-h).

In Terminal, type: Take another coffee...

Instead of using current CVS, you might want to use the latest official version from the PHP-GTK2 download page.

Leave X11 open to be on the safe side. phpize and php-config should be both in /opt/local/bin/. Check that before you run this. In Terminal, type:

After it is done, you will see in the output of Terminal a remark about extensions being installed with a path that probably looks like this: /opt/local/lib/php/extensions/no-debug-non-zts-20060613. Apple-c that path or write it down. You will need it later.

In Finder, choose Go > Go To Folder... (or press shift-apple-g) and type /opt/local/etc.

Steps 4 Smile Mac Os Download

Find the file php.ini-recommended and copy it. Rename the copy to php.ini and open it with - preferably - BBedit.

Find the line extension_dir = './' and replace it with this: extension_dir = '/opt/local/lib/php/extensions/no-debug-non-zts-20060613' (That path, you copied from the Terminal output in the previous step)

Steps 4 Smile Mac Os X

Find the block with all extensions and add this line after them: extension=php_gtk2.so

Save the file.

Start X11 and hide it (apple-h) if not already done.

Start Terminal and type: The demo should open in a window in X11.

To work with Glade, start it in Terminal like this (with X11 open): /opt/local/bin/glade-2

In my humble opinion: the interfaces in X11 look like crap when you are used to working in OS X. To get other themes, go to art.gnome.org to check them out. In order to use one of those, we need to do one more step.

In Terminal, type: sudo port install gtk-theme-switch

After that is ready, download a theme from the link above. Installing it can be done in two ways:

  1. Move or copy the downloaded .tar.gz (without unpacking!) into /opt/local/share/themes/

    Start Glade by typing this in Terminal (with X11 open): /opt/local/bin/switch2

    Press the + sign and click the Install New Theme button. Point to /opt/local/share/themes/<your-new-theme-name>.tar.gz

    Click OK and now your new theme shows up in the list.

  2. Unpack the <your-new-theme-name>.tar.gz and move or copy the new theme folder to /opt/local/share/themes/

    Start Glade by typing this in Terminal (with X11 open): /opt/local/bin/switch2

    The name of the new theme should be in the list.

Again, I got it to work on my machines with above steps. My configs: iMac G5 2.0 GHz/1 GB RAM/OS X 10.4.8 and Mac mini G4 1.42 GHz/512 MB RAM/OS X 10.4.8. Please, fellow Mac users, post here any remarks, tips, tricks, etc. Let's get the PHP-GTK spirit to OS X too! Good hunting!