4. Who the hell am I?
• A Linux sysadmin, can you tell by the facial hair,
surly holier-than-thou attitude
• Politics, not IT educated
• Worked for Catalyst for 3 years
• Worked for a Port Company 3 years
• Travelled
• Sold soul to despicable currency traders
• Back at Catalyst to atone for sins
6. Why this workshop?
• Maybe you are curious
• I see people struggling on the Moodle forums
• People think Linux is hard, it's not, it's just
different.
• Don't install on Windows
– It costs money
• Don't install on MacOSX
– Dependency hell
7. About this workshop
• I don't expect you to learn a hell of a lot, a lot of
monkey-see, monkey-do.
• I want to demonstrate that a basic Moodle
installation is not difficult
• We will use Amazon EC2 virtual machines
9. SSH login – Ask me for hostname
• Windows: Open Putty
– Expand SSH
• Click on Auth
– Browse for that .ppk
file you unzipped
– Scroll up to session
• Click Open, username is
'ubuntu'
• Linux / MacOS X command
prompt
– ssh i installing
moodleiseasyprivate
ubuntu@<hostname>
10. Logged in – Run the following
• sudo aptget update http://tinyurl.com/moodle-get-
– Updates the VM's list of software availible from Ubuntu
it
• sudo aptget install postgresql apache2mpm
prefork libapache2modphp5 php5gd php5curl
php5xmlrpc php5pgsql php5intl php5suhosin
– Installs the requisite software for Moodle to function
• sudo /etc/init.d/apache2 restart
– Restart the webserver to pick up it's new configuration
11. Make filesystem changes for
moodle
• sudo mkdir /var/www/moodle
– There is where the code goes
• sudo chown ubuntu:ubuntu /var/www/
– Lets you unpack the code
• sudo mkdir /var/moodledata
– This is where Moodle will store files
• sudo chown wwwdata:wwwdata /var/moodledata
– Let the webserver process write to this place
12. Create the database
• sudo su – postgres
– Switch user to the postgres Unix user
• createuser P moodle
– Create a user in the database user called moodle
• -P means prompt for a password
– Make the password moodle
– Answer 'n' to all questions
• createdb Omoodle Ttemplate0 Eutf8 moodle
– Creates a database called moodle
• -O owned by the moodle database user you just created
• -T that is completely blank
• -E has the utf8 encoding
• All done? No errors? Run 'exit' (Just once)
13. Get and install the code
• cd
– Just that, puts you back in your home directory
• wget "http://tinyurl.com/moodlegetit"
– Downloads the code
• cd /var/www
• sudo chown ubuntu:ubuntu /var/www/moodle
• tar xvzf /home/ubuntu/moodle-get-it
– Unpacks the code
• sudo chown www-data:www-data /var/www/moodle/
– Temporary permissions change to allow the writing of the
configuration file
14. Run the moodle installer
• Back on your laptop, point your web browser at
your Amazon EC2 machine
– Something like
– http://ec2-79-125-48-199.eu-west-
1.compute.amazonaws.com/moodle
15. Set moodle install options
• Choose your language
• Defaults on 'confirm paths' are fine
• Database driver should have already selected
'postgresql'
• Database settings
– host: localhost
– name: moodle
– user: moodle
– password: moodle
16. Copyright notice?!
• Congratulations!
– Everything has gone just great
– sudo chown ubuntu:ubuntu
/var/www/moodle
• Fixes insecure permissions
– Read the copyright notice
• Say 'Thanks Martin!' and click continue
• You must say thanks
– Very important
– Click on the next continue button, just once!
• Be patient!
17. The cronjob
• Moodle cron needs the Unix cron to work
• Unix cron speaks an odd language
– Minute, Hour, Day of month, Month, Day
• 0,15,30,45 * * * * means?
• In /etc/cron.d/ you also specify a username
• Normally you don't redirect to /dev/null !
• 0,15,30,45 * * * * wwwdata /usr/bin/php /var/www/moodle/admin/cli/cron.php
&> /dev/null
18. APC – What?
• APC keeps a cached compiled copy of the
Moodle code in memory
– Improvement in performance
• Very easy to install on Ubuntu
• In Moodle enable the performance info