Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Debian GNU/Linux installation.

Debian GNU/Linux installation: Difference between revisions

From MoodleDocs
Line 35: Line 35:
These packages are optional:
These packages are optional:
* GD library
* GD library
'''LAMP in Debian Etch'''
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.
Use the following command to install apache2, php5 and mysql
apt-get install apache2 php5 mysql-server php5-mysql libapache2-mod-php5 php5-gd
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 configuartion files using the text editor gedit by
gedit /etc/apache2/apache2.conf
Now we msut make a slight change in the php5 configuration file. Open it using
gedit /etc/php5/apache2/php.ini
add  the entries extension=mysql.so and extension=gd.so
Someimes these entries are provided as example lines being commented out . You can remove the commenting to activate the entries.
To test the php installtion, you can craee a text fule named phpinfo.php with the contents <?phpinfo()?>
and save it at /var/www. 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
mysqladmin -u root password "yourpassword"
You can restart apache 2 by /etc/init.d/apache2 restart
You can restart mysql by /etc/init.d/mysql restart


===Step 2: Download moodle===
===Step 2: Download moodle===

Revision as of 07:13, 15 September 2006

Installing Moodle as a Debian package

Using apt-get, aptitude or Synaptic

  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 internet connection on the PC on which you want to install moodle.

 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.

Step 1: Install required packages

Install these packages (if you've not already done so). See Installing Apache, MySQL and PHP or refer to the respective user manuals. Using apt-get, aptitude or synaptic you can install these very easily.

  • Web Server (Apache highly recommended)
  • Database Server (MySQL or PostgreSQL recommended)
  • PHP, PHP-MySQL mod (or mod for your database)

These packages are optional:

  • GD library

LAMP in Debian Etch

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.

Use the following command to install apache2, php5 and mysql

apt-get install apache2 php5 mysql-server php5-mysql libapache2-mod-php5 php5-gd

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 configuartion files using the text editor gedit by

gedit /etc/apache2/apache2.conf


Now we msut make a slight change in the php5 configuration file. Open it using


gedit /etc/php5/apache2/php.ini

add the entries extension=mysql.so and extension=gd.so

Someimes these entries are provided as example lines being commented out . You can remove the commenting to activate the entries.


To test the php installtion, you can craee a text fule named phpinfo.php with the contents <?phpinfo()?> and save it at /var/www. 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

mysqladmin -u root password "yourpassword" You can restart apache 2 by /etc/init.d/apache2 restart You can restart mysql by /etc/init.d/mysql restart

Step 2: Download moodle

Download moodle from http://download.moodle.org/?lang=en.

Step 3: Unpack file

  • For zip file, use unzip <your_file>. For tgz(tar.gz), use tar -zxvf <your-file>. You can also use any of the GUI front-ends such as file-roller or ark. You will get a folder moodle (or moodle-1.5.2 or something similar).
  • Now, suppose you want to install moodle at /var/www/moodle (This means moodle will be accessible at http://localhost/moodle). mv moodle /var/www/ (Most probably you will to be root to do this)

Step 4: Start web and database servers

  • Login as root (if you have not already done so): su.
  • Start your web server. For Apache2, /etc/init.d/apache2 start.
  • Start your database server. For MySQL, /etc/init.d/mysqld start

Step 5: Finally install