Welcome to my tutorial on setting up a Moodle Server
I will add more to this page as I have time, including screen shots
Moodle is an open source course management system. Because Moodle is open source it is free of charge to use and install. You can change it to fit your business or schools individual’s needs. Most schools are familiar with Blackboard; Moodle offers many of the same features of Blackboard but without the cost.
Moodle can run on Linux, Windows, or the Mac OS. I have set up Moodle on Ubuntu, Centos, Red Hat, Fedora and it works great with all of them. Depending on which one you choose there will be slightly different installation steps. I suggest using Linux because of the ease of setting up LAMP and of course because of its cost, free. If you want to deploy Moodle for you school/business and are in need of some training, consultation or help MH consulting can help.
Installing Moodle on Linux
1. Chose the version of Linux: Ubuntu, CentOS, Red Hat, ect. You can also use Windows or Mac OS but I will go over Linux here. During the installation be sure to install it as a LAMP server (Linux, Apache MySql, PHP). Linux is very good at setting these up so they all work together without much user interaction. That is why I suggest doing it at the same time you install Linux. To install Linux just place in the CD in the computer/server and boot to it, select install to hard drive. If you have reason, you can change the default settings but remember what you change because you many need to know later. Your /var partition will probably need to be the biggest because in contains variable content including your Moodle installation. Your /boot, /, swap, and / partition sizes will need to be set accordingly.
2. During the installation select you timezone, clock, create an account and use a secure password. You password should not be a word and be at least 8 characters in length, contain both lower and upper case letters as well as numbers and some other characters. I suggest using passwords between 12 and 15 characters in length unless you can remember longer passwords.
3. Once Linux is installed boot it up, login and set the IP address of your server to a static IP address that is not used on your network, or set it up accordingly to your network needs. Also set your DNS server. In Red Hat/CentOS this is located in /etc/resolve.conf and add this line nameserver 192.168.0.1 (replace the ipaddress with one you use)
4. For Debian type systems like Ubuntu you may need enable access to certain packages. To do this you will need to edit the /etc/apt/sources.list file. You can use sudo or su for a super user so you can perform administrative tasks if not logged in as root. Example you can type: sudo nano /etc/apt/sources.list
5. Next update you system and reboot to the new kernel.
Ubuntu: sudo apt-get upgrade
Red Hat/CentOS: yum update
6. Make sure you installed Apache, MySQL, and PHP. If you didn't do this at time of installing the OS this would be the time to do that. You can use apt-get or yum to install these.
7. Test your PHP and Apache. Do this by creating a file called phpinfo.php with this
<? phpinfo(); ?>
inside the file. Place the file in the root directory (usually /var/www/html/)of Apache. Confirm it works by going to http://YourServerIPaddress/phpinfo.php
Later after you create your Moodle directory you can set the default directory for Apache to that directory, but if you are planning on hosting other pages on the same server you may not want to do that.
8. Create the directories for Moodle and set permissions.
mkdir -p /var/www/html/moodle
mkdir -p /var/moodledata
chmod -R 777 /var/moodledata
9. Change the password to MySQL. Replace yourownpassword with a password of your choice but make it secure!
mysqladmin -u root password yourownpassword
mysqladmin -u root -h localhost password yourownpassword
10. Create a Database for Moodle. At this time you can create a user and password to use for the Moodle database by using the set permissions script, type: mysql_setpermission to run the script.
or
mysql -u root -p
CREATE DATABASE moodle Default Character Set;
11. Install other packages you may need:
Ubuntu:
sudo apt-get install ntp-simple openssh-server unattended-upgrades
sudo apt-get install unzip zip aspell-en aspell-fr aspell-de aspell-es
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
sudo apt-get install clamav-base clamav-freshclam clamav
sudo apt-get install php5-gd
Red Hat/CentOS
yum -y install php-gd
yum install php-mbstring
yum install php-xmlrpc
yum install clamav*
yum install latex
yum install tetex-latex
yum install ImageMagic
12. CentOS & Red Hat have a firewall you need to set it to allow access. As root type:
setup
and set to enabled, permissive, and then choose custom and select the other ones you need like ssh,
Also at this point you should make sure httpd and mysqld have been started. It's a good idea for these to be started at boot time.
service httpd start
service mysql start
13. Download & Extract Moodle to www directory
Ubuntu:
cd /var/www
sudo wget http://download.moodle.org/stable19/moodle-latest-19.tgz
sudo tar -zxf moodle-latest-19.tgz
CentOS/Red Hat
If you can't use yum (yum install moodle ) to install Moodle or the newest version of Moodle you will need to download it and extract it to the Moodle directory.
cd /var/www/http
wget http://download.moodle.org/stable19/moodle-latest-19.tgz
tar -zxf moodle-latest-19.tgz
14. Now that Linux and Moodle are installed on your server, you will need to finalize the Moodle installation by going to a web browser and typing in the web address (if you have set that up) or the IP address of the server.
Example: if the IP address of your Moodle server is 192.168.0.1 you type in: http://192.168.0.1
This can be done from any computer on your network as long as you don't have any routers or firewalls blocking you from accessing that server. If you have trouble check with your network administrator.
15. This next part is fairly simple so don't worry if I haven't finished the instructions for it just follow the wizard to finalize Moodle. You will need to know your username and password to your MySQL database so Moodle can read and write to it. If you used a different database other then MySQL you will still need to know your username and password.
16. More instructions to come as I have time.

