1 / 37

Managing Moodle/Apache/MySQL on Linux

Steve Rippl Technology Director Woodland School District rippls@woodlandschools.org http://www.woodlandschools.org (main District site - Drupal) http://courses.woodlandschools.org (District Moodle site) Download this presentation at http://www.woodlandschools.org/index.php?q=node/6216.

adamdaniel
Download Presentation

Managing Moodle/Apache/MySQL on Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Steve Rippl Technology Director Woodland School District rippls@woodlandschools.org http://www.woodlandschools.org (main District site - Drupal) http://courses.woodlandschools.org (District Moodle site) Download this presentation at http://www.woodlandschools.org/index.php?q=node/6216 Managing Moodle/Apache/MySQL on Linux

  2. File and Database Layout & Backups Restores/Create a Test Site Add-ons - Filters, Modules & Blocks User Management Structuring Site Layout/Permissions Customizing Your Website Upgrading Moodle Outline of Workshop • Online Documentation • Hardware Requirements • Software Requirements • Quick Linux Introduction • Installing Software • Managing Remotely • Install Dependencies • Moodle Installation • Moodle Configuration

  3. Online Documentation • Linux • The man pages (not strictly online, although they are available there too!) • http://linux-newbie.sunsite.dk/html/lnag.html - Linux Newbie Administrator Guide, dated but useful general intro. • http://www.debian-administration.org/ - great articles on various topics around managing Debian • http://www.howtoforge.com/ - articles around server on many different distros (including Ubuntu/Debian)

  4. Online Documentation • Moodle • http://moodle.org/ - Set up an account for access to forums • http://docs.moodle.org/en/Main_Page - Documentation front page • http://docs.moodle.org/en/Administrator_documentation - Documentation for site administrators

  5. Online Documentation • Apache • http://httpd.apache.org/docs/2.2/ • PHP • http://www.php.net/manual/en/ • MySQL • http://dev.mysql.com/doc/

  6. Minimum: 160 MB Disk Space 256MB (min), ~1GB per 50 concurrent users In Practice: Be as generous as you can so your end users get a responsive experience, you're not paying for the software so put it in hardware! http://docs.moodle.org/en/Installing_Moodle#Hardware http://docs.moodle.org/en/Installing_Moodle#How_many_users.3F Hardware Requirements

  7. An Operating System – Linux A Web Server – Apache2 PHP5 A Database – MySQL (others possible) and... Moodle Source http://docs.moodle.org/en/Installing_Moodle#Software Software Requirements

  8. Quick Linux Introduction • What is where? • http://linux-newbie.sunsite.dk/html/lnag.html#4.1.Basics|outline • /etc – configuration files • /var/log – log files • How do we do anything? • The bash shell (Bourne Again SHell) – ls, cd, mkdir,touch,locate,ps,top,chown,chmod,rm,vi,pico,nano,cp,scp,mv,shutdown,reboot,more,less,cat,sed,grep... etc...etc...(man command is your friend!)

  9. Quick Linux Introduction • How can we see what's running? • ps (ps -e | less, specific process “test” ps -e | grep test, more detail ps -aux) • top • How do we control processes (on Debian/Ubuntu)? • /etc/init.d/process_name (start|stop|restart|status)

  10. Installing Software • Installing pre-packaged software (all online http://www.debian.org/distrib/packages) • GUI based tools, Synaptic (Gnome tool, but can install in KDE too) • Command line, apt-cache search/policy/showpkg..., apt-get install/remove/purge... • Compiling from source (not needed often) • Configure; make; make install

  11. Managing/Accessing Server Remotely • From another Linux machine • ssh (Secure Shell) • Fish (Konqueror) (or sftp in Firefox?) • Can share the root file system through Samba or nfs (not as secure) • VNC – if the server has a GUI

  12. Managing/Accessing Server Remotely • From Windows machine • Putty -http://www.chiark.greenend.org.uk/~sgtatham/putty/ • WinSCP - http://winscp.net/eng/index.php • Again, if server filesystem is shared through Samba you can access it that way.

  13. On Debian (or Ubuntu) As root... # apt-get install apache2 php5 mysql-server php5-gd phpmyadmin # cd /var/www # wget http://download.moodle.org/stable19/moodle-weekly-19.tgz # tar -xzvf moodle-weekly-19.tgz # rm moodle-weekly-19.tgz # chown -R www-data:www-data moodle Other useful software... # apt-get install ssh ntp vim http://docs.moodle.org/en/Debian_GNU/Linux_installation Install Dependencies

  14. Moodle Installation • http://docs.moodle.org/en/Installing_Moodle • Check web server settings (/etc/apache2/sites-available/default) DirectoryIndex index.php index.html index.htmAcceptPathInfo on

  15. Moodle Installation • Check PHP settings (/etc/php5/apache2/php.ini) (* not already default in Debian) register_globals = 0safe_mode = 0 memory_limit = 128Msession.save_handler = files magic_quotes_gpc = 1 magic_quotes_runtime = 0 file_uploads = 1session.auto_start = 0 session.bug_compat_warn = 0 (*)post_max_size = 16M (* minimum)upload_max_filesize = 16M (* minimum)

  16. Moodle Installation • Restart web server after any Apache or PHP config changes (/etc/init.d/apache2 restart) • Set up database (easiest through phpMyAdmin) • Set a root password if not already done. • Create moodle database and user 'moodleuser' with rights to that db. ***Important performance configuration*** Increase the size of the query_cache_size in /etc/mysql/my.cnf

  17. Moodle Installation • Create data directory Need a large (many gigs) data directory outside of DocumentRoot # mkdir /srv/moodledata# chown nobody:www-data /srv/moodledata# chmod 770 /srv/moodledata • Run Moodle installer script • http://yourserver/moodle/install.php • Enter db and data directory details • Install any missed dependencies – apt-cache search php5 extension_name, apt-get install package, restart apache.

  18. Moodle Installation • Run Moodle installer script • Run through through table setup watching for errors • Setup admin account • Enter basic site information Hopefully now you see your Moodle site! Er

  19. Moodle Configuration Checklist of basic Moodle options to enable/disable (not conclusive or necessarily necessary!) • Reduce time to keep logs (Server → Cleanup) • Turn off messaging (Security → Site Policies) • Disable Blogs (Security → Site Policies) • Setup cron • Set password in Security → Site Policies • Add */5 * * * * wget -q -O /dev/null http://yourserver/moodle/cron.php?password=PASSWORD (all one line) to crontab (crontab -e as root)

  20. Moodle Configuration • Adjust file upload limits • Security → Site policies → Maximum uploaded file size = Server Limit • In /etc/php5/apache2/php.ini upload_max_filesize = 32M • Set up connection to an SMTP server • Server → EmailMake sure your SMTP server will relay for your Moodle server.

  21. File and Database Layout & Backups • So now we have... • /var/www/moodle – see http://docs.moodle.org/en/Installing_Moodle#Structure_of_moodle_directory for explanation • /srv/moodledata • 'moodle' database in MySQL

  22. File and Database Layout & Backups • Set up those backups! • Use a script to dump the database on a daily basis (cron) On Linux mysqldump moodle > moodle_bkup.sql --user=root --password=PASSWORD On Windows C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqldump.exe" wsd > moodle_bkup.sql --user=root –password=PASSWORD • Use whatever backup system you have to scoop up both the main directories and the database dump file (maybe your apache conf?). • Restore just involves putting directories and db back

  23. Restore/Create a Test Site • Restore is easy (as long as you have backups!) • Put directories back in place (check permissions if your backup process doesn't preserve them) • Restore db mysql --username=root --password=PASSWORD moodle < moodle_bkup.sql • There is a built in course backup function – mostly for archiving/moving courses from one site to another.

  24. Restore/Create a Test Site • Can use the same method to create copy/clone of site for test purposes • cp -Rp /var/www/moodle /var/www/moodle_test • cp -Rp /srv/moodledata /srv/moodledata_test • In phpMyAdmin make a copy of db called moodle_test • Edit /var/www/moodle_test/config.php$CFG->wwwroot = 'http://.../moodle_test'$CFG->dirroot = '/var/www/moodle_test'$CFG->dataroot = '/srv/moodledata_test'

  25. Filters, Modules & Blocks • Turn on or install additional filters, modules and blocks. • Lots of community created add-ons are available to increase functionality – none come with a guarantee so test if not sure! http://moodle.org/mod/data/view.php?id=6009

  26. Modules Hot Potatoes Quiz (installed, just turn on) Book Feedback Questionnaire Podcase Slideshow Filters, Modules & Blocks • Filters • Multimedia plugins (already installed, just turn on) • Freemind • Geogebra • Wiki Page Auto-linking (already installed, just turn on) • Tex Notation (already installed, just turn on)

  27. Filters, Modules & Blocks • Blocks - Quickmail • Installation of third-party add-ons: • Download the source, how do we get it onto our command line server?cd /tmpwget:wget http://download.moodle.org/packages19/feedback_packages.zipmount windows/samba share:apt-get install smbfsmkdir /mnt/sharemount -t cifs //remote-server/share_name /mnt/sharecp /mnt/share/file.zip .spc:scp root@remote-server:/path/to/share/file.zip .

  28. Filters, Modules & Blocks • Installation of third-party add-ons: • Unpackapt-get upzipunzip feedback_package.zipchown -R www-data:www-data blocks modmv blocks/feedback /var/www/moodle/blocks/feedbackmv mod/feedback /var/www/moodle/mod/feedback • Visit your admin page to complete the installation http://your-server/moodle/admin/index.php

  29. User Management • The easiest approach is to let your users setup their own account and use your network user directory for authentication. • Users → Authentication → Manage Authentication • Turn off Email-based self-registration • Turn on LDAP server • Configure (for Active Directory authentication?) • Make sure PHP LDAP module is present apt-get install php5-ldap/etc/init.d/apache2 restart

  30. User Management • Configure LDAP authentication Host URL: ldap://AD-server.domain.eduVersion: 3LDAP encoding: utf-8Hide passwords: yesDistinguished Name: cn=ldap_query_user,ou=users,dc=domain,dc=eduPassword: xxxxxxxxUser type: MS ActiveDirectoryContexts: ou=users,dc=domain,dc=eduSearch subcontexts: YesUser attribute: sAMAccountNamePassword format: Plain text

  31. User Management • Can import all users yourself if you wish Users → Accounts → Add a new user or Upload users Exactly how this is managed is very dependent on your Network setup, but try to minimize your involvement here, you've got other things to do!

  32. Structuring Site Layout/Permissions • Think about clarity for end users and consider the fact that permissions are inherited down from where you set them. • Can set permissions globally Users → Permissions → Assign system roles and at each level. 'Assign roles' within a course or category

  33. Customizing Your Website • Most Moodle sites are distinctively “Moodle-esq”, but you can choose amongst various themes and customize them as you please. • Appearance → Themes → Theme Selector • Can find many more to download here:http://moodle.org/mod/data/view.php?id=6552 Installation instructions:http://docs.moodle.org/en/Themes_FAQ

  34. Customizing Your Website • Digging deeper into themes – either use chameleon theme • In moodle/themes/chameleon/config.php set $THEME->chameleonenabled = true; • In the Theme Selector choose the Chameleon theme • 'Shift + click' on an element to get css properties (Firefox “firebug” also useful)

  35. Customizing Your Website • Or edit the html/css of one you like... • Can start with header.html and footer.html and go on from there... again the Firebug plugin for Firefox will greatly help to identify page node id and classes which you can then hunt out in the theme files.https://addons.mozilla.org/en-US/firefox/addon/1843

  36. Upgrading Moodle • Don't get left behind! You've got backups of everything so there's nothing to be afraid of! • Make sure all updates are current • Move (rename) your old moodle folder and unpack the new one in it's place. • Copy across config.php and any custom themes, check permissions (chown www-data …) and then visit your admin page. http://docs.moodle.org/en/Upgrading#Install_the_new_Moodle_software

  37. The End? • Train a few keen teachers who can then in turn train others (Moodle Bootcamp?) • Sit back and take the credit for bringing this powerful tool into your School/District!

More Related