Professional Documents
Culture Documents
Installing Moodle As A Debian Package
Installing Moodle As A Debian Package
1. Make sure your PC connected to the internet. (Moodle has been included with Debian
Sarge. You don't need net connection, if you have the Debian Sarge CDs or DVDs that
are configured as download repositories for apt-get, aptitude or synaptic). Use one of
these:
apt-get install moodle
aptitude install moodle
Run the synaptic package manager and search (Ctrl + f) for "moodle" (without
quotes). You will get moodle in the results (if not, you need to configure your
download URLs). Right click and select "Mark for Installation". Click "Apply" button
on the Toolbar.
2. Answer the questions asked by the installer (such as the database to be used - MySQL
or PostgreSQL).
3. Visit your moodle site at http://localhost/mymoodle/admin
Manual download
You will probably need to follow this, if you don't have an Internet connection on the PC on
which you want to install Moodle (but in that case, why the heck are you using Moodle?)
Download moodle and all the dependencies (if you already don't have them) from
Stable(http://packages.debian.org/stable/web/moodle) or
Testing(http://packages.debian.org/testing/web/moodle). Place them all in the same
directory (no matter which).
As root, run the following command:
dpkg -i *.deb
This will unpack and begin the installation of all the downloaded packages.
Answer the questions asked by the installer (such as the database to be used – MySQL or
PostgreSQL).
Visit your moodle site at http://localhost/mymoodle/admin
Installing moodle from .tgz(.tar.gz) or .zip file
More detailed instructions coming soon
You will probably want this if you don't like the settings of Debian moodle package.
GD library
Setting up a LAMP in Debian is very easy. Once you get used to Debian administration including
installation and configuration are much simpler compared to other linux distros. The following
describes how to install apache, php and mysql on the Debian testing distribution called etch.
Etch is expected to be released in December 2006.
For installation of the necessary packages the easiest option to use apt-get.
php5-gd is optional
The mentioned packages are installed along with the dependencies depending on what was
already installed on your Debian system.
Now you may fire up a browser and type localhost to check whether the apache2 default page is
shown,
You can edit the apache configuration files using the text editor gedit by
gedit /etc/apache2/apache2.conf
Now we must make a slight change in the php5 configuration file. Open it using
gedit /etc/php5/apache2/php.ini
extension=mysql.so
extension=gd.so
Sometimes these entries are provided as example lines being commented out . You can remove
the commenting to activate the entries.
To test the php installation, you can create a text file named phpinfo.php with the contents <?
phpinfo()?> and save it at /var/www. Restart apache with the command below. Now access this
file through the browser localhost/phpinfo to check the installation of php. Mysql installation is
already there. Give it a root password using
/etc/init.d/apache2 restart
/etc/init.d/mysql restart
For these instructions, you can install Moodle with only the minimum of Debian features
installed, keeping all the resources available for the server if you wish.
If you use additional authentication methods, you may need to install other php libraries, such
as php5-imap if you use IMAP to authenticate your users.
Setup MySQL Database
Set a secure root password for the database
Note that on a secure production server, you will want to create a different user than root to
access the database.
Now log in
mysql -u root -p
cd /var/www
Get the latest version of Moodle 1.9 (check for the most recent released version or the version
you are most comfortable with. It may be earlier or later than 1.9 stable. Use the European
Union CVS server (you can replace eu with uk, es, or us in this step if you wish)
mkdir moodledata
Set permissions so that Apache can access the files
nano /etc/apache2/sites-available/default
DocumentRoot "/var/www/moodle/"
<Directory "/var/www/moodle">
Around line 17, comment out the line for the default page:
You can change other values like ServerAdmin if appropriate. For all changes, you should
restart Apache for the new settings to take effect.
/etc/init.d/apache2 restart
Setup Moodle
If you are only going to test Moodle on your internal network, just enter the local IP address as
the web address. You can find the local IP address under DHCP by typing
ifconfig eth0
If you have a web address that points to your server, use that instead.
For Password, enter the password for the database that you created earlier
Continue through the dialogs and select Unattended operation and set up the Moodle server.
Install cron
Moodle needs a periodic call to do maintenance work like sending out emails, cleaning up the
database, updating feeds, etc. To run the cron every 10 minutes, do the following
export EDITOR=nano
crontab -e
This will allocated more memory and allow files to be uploaded up to 80MB. This should be
enough for most multi-media files. Hard drive space is cheap and the default is only 2MB. It is
recommended that you change the settings to the following values:
memory_limit = 40M
post_max_size = 80M
upload_max_filesize = 80M
cd /var/www/moodle
cvs -q update