Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Step-by-step Install Guide for Ubuntu.

Step-by-step Install Guide for Ubuntu: Difference between revisions

From MoodleDocs
(redirect)
 
Line 1: Line 1:
= Installation Guide for Ubuntu =
#redirect [[Step-by-step Installation Guide for Ubuntu]]
 
== Karmic Koala 9.10 ==
*Simplified instructions are available at
:* [http://kubuntuguide.org/Moodle_tips Kubuntuguide -- Moodle tips]
:* [http://ubuntuguide.org/Moodle_tips Ubuntuguide -- Moodle tips]
 
The complex instructions (detailed below for Hardy Heron) are no longer necessary.
 
== Hardy Heron 8.04 ==
 
*[http://www.ubuntu.com/products/GetUbuntu/download#lts Ubuntu 8.04 LTS server CD]
 
=== Install Ubuntu ===
Start computer and boot from CD.
 
Select '''Install to hard drive'''.
 
Select your '''language''', '''country''', and '''keyboard layout''' (i.e. English, United States, American English)
 
Select '''[http://help.ubuntu.com/8.04/ubuntu/serverguide/C/network-configuration.html manually configure]''' and set an IP address (or autoconfig if you don't know).
 
Enter your servername (i.e. moodletest)
 
Select to '''manually edit the partition table'''.  I’m doing my testing on a standard 40GB harddrive and will modify these sizes for production.
 
:<table>
:<tr><td width=%10>/boot</td><td width=%10>ext3</td><td align=right width=%10>200MB</td><td align=center width=%10>bootable</td>
<td>([http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/s1-grub-whatis.html may need to be under cylinder 1024 on your harddrive to be bootable])</td></tr>
:<tr><td>/</td><td>ext3</td><td align=right>10GB</td><td></td><td>(files are relatively static)</td></tr>
:<tr><td>swap</td><td></td><td align=right>4GB</td><td></td>
<td>(4xRAM if you don't have much memory, down to 1xRAM if you have gobs of memory)</td></tr>
:<tr><td>/var</td><td>ext3</td><td align=right>26GB</td><td></td><td>(variable content – uses rest of the drive)</td></tr>
:</table>
 
Select your '''timezone'''. (i.e. Central)
 
Set clock to '''Universal Time'''.
 
Enter Administrators '''full name'''. (i.e. Joe Smith)
 
Enter '''account name'''. (i.e. joesmith)
 
Enter a secure password.  (‘abcde’ is not a good one!)
 
Let the computer restart.
 
Log in your account.
 
Edit the ''/etc/apt/sources.list'' file. Remove the ''#'' mark on lines 22 and 38 to enable access to the universe package source and universe security updates. You will need to re-enter your account password when ''sudo'' asks for it.
<pre>
sudo nano /etc/apt/sources.list 
</pre>
Now to get all the security updates.
<pre>
sudo apt-get update
 
sudo apt-get dselect-upgrade
</pre>
Normally you would just use ''[http://help.ubuntu.com/6.06/ubuntu/serverguide/C/apt-get.html sudo apt-get upgrade]''.
 
And reboot to run on the new kernel!
<pre>
sudo reboot
</pre>
 
=== Install MySQL (skip Postgresql) ===
At this point we'll need to log in again to the server and type:
 
<pre>
sudo apt-get install mysql-server php5-mysql
</pre>
Press ''Y'' to continue the install.
 
 
Replace the following string ''NewRootDatabasePassword'' with a secure password of your own choosing.
 
There is no space between the ''-p'' and the password on the second command.
<pre>
mysqladmin -u root password NewRootDatabasePassword
 
mysqladmin -u root -h localhost password NewRootDatabasePassword -pNewRootDatabasePassword
</pre>
 
We now need to create the Moodle database and Moodle user in MySQL.
 
The mysql command will prompt for your ''NewRootDatabasePassword'' (from above).
Replace ''NewMoodleDatabasePassword'' with a secure password of your own choosing.
<pre>
mysql -u root -p
> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
> GRANT ALL PRIVILEGES ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'NewMoodleDatabasePassword';
> GRANT SELECT,LOCK TABLES on moodle.* TO moodlebackup@localhost IDENTIFIED BY 'MoodleBackupPassword';
> FLUSH PRIVILEGES;
> QUIT
</pre>
The above also creates a backup user moodlebackup so that you can use ''mysqldump'' to make database backups without accident.
 
=== Install Postgresql (skip MySQL) ===
 
At this point we'll need to log in again to the server and type:
<pre>
sudo apt-get install postgresql-8.1 php5-pgsql
</pre>
Press Y to continue the install.
 
We now need to create the database user 'moodleuser'.
<pre>
sudo -u postgres createuser -D -A -P moodleuser
</pre>
Enter in a ''NewMoodleDatabasePassword here'', then answer 'N' to the question.
 
We now need to create the database 'moodle' for the user 'moodleuser'. You'll need to enter the password that you just created.
<pre>
sudo -u postgres createdb -E utf8 -O moodleuser moodle
</pre>
Let's now secure the postgresql database with an admin password.
<pre>
sudo -u postgres psql template1
# ALTER USER postgres WITH PASSWORD 'NewAdminDatabasePassword';
# \q
</pre>
Edit the file '/etc/postgresql/8.1/main/pg_hba.conf' and on line 79 change the words ''ident sameuser'' to ''md5''.
<pre>
sudo nano /etc/postgresql/8.1/main/pg_hba.conf
</pre>
Restart the database so everything is fine.
<pre>
sudo /etc/init.d/postgresql-8.1 restart
</pre>
 
=== Install Apache ===
 
The following mod-security, ldap, and odbc libraries are optional.
<pre>
sudo apt-get install apache2 libapache2-mod-php5 php5-gd
 
sudo apt-get install libapache2-mod-security php5-ldap php5-odbc
</pre>
 
Restart Apache
<pre>
sudo /etc/init.d/apache2 restart
</pre>
 
'''Note:''' To install Moodle 2.0 for the current ubuntu, you need to [http://moodle.org/mod/forum/discuss.php?d=116604 install PHP from an external repository] --[[User:Olli Savolainen|Olli Savolainen]] 19:28, 10 April 2009 (UTC)
 
=== Install other software ===
On the command line, type:
<pre>
sudo apt-get install openssh-server unattended-upgrades
 
sudo apt-get install unzip zip aspell-en aspell-fr aspell-de aspell-es
 
sudo apt-get install curl php5-curl php5-xmlrpc
 
sudo apt-get install clamav-base clamav-freshclam clamav
</pre>
Press ''Y'' to continue the install after each of these apt-get commands.
 
The clamav package will support virus checking on file uploads into Moodle. May have to run it again to configure properly.
 
Additional languages are available for aspell.
 
=== Install Moodle ===
On the command line, type:
<pre>
cd /var/www
 
sudo wget http://download.moodle.org/stable19/moodle-latest-19.tgz
 
sudo tar -zxf moodle-latest-19.tgz
 
----
in ubuntu 8.04 it should be:
sudo tar zxf moodle-latest-19.tgz
----
 
sudo mkdir /var/moodledata
 
sudo chown -R www-data:www-data /var/moodledata
where www-data is whatever user/group was created automatically when apache was installed.
</pre>
 
We now need to edit the location of the default web site.  On lines five and ten, replace ''/var/www/'' with ''/var/www/moodle/''. Restart Apache. (See page comments for more details on this instruction.)
<pre>
sudo nano /etc/apache2/sites-available/default 
 
sudo /etc/init.d/apache2 restart
</pre>
 
=== Configure Moodle website ===
ifconfig (look for your server’s ip address on the 2nd line).
 
On another computer open a web browser and put in your server address. Make sure your web browser is set to accept cookies.
 
Complete the Moodle install using a secure username and password.
 
Go to a bar for a few hours.
 
Come back and tell your boss that you FINALLY got the test server running.
 
== Other Resources ==
 
*[http://kubuntuguide.org/Moodle_tips Kubuntuguide -- Moodle tips].
* Setting up the [http://www.howtoforge.com/perfect_setup_ubuntu_6.06 Perfect Ubuntu 6.06 server]
* Ubuntu 6.06 Server Guide - [http://help.ubuntu.com/6.06/ubuntu/serverguide/C/index.html HTML] [http://help.ubuntu.com/6.06/pdf/ubuntu/C/serverguide.pdf PDF]
* Ubuntu - [http://help.ubuntu.com/community/Security 1] [http://www.computerworld.com/action/article.do?command=printArticleBasic&articleId=9002691  2] security
* Debian - [http://www.debian.org/security/ 1] [http://www.us.debian.org/doc/user-manuals#securing 2] security
* Setting up a secure LAMP Webserver on Debian Etch (May 22nd, 2008) [http://news.metaparadigma.de/?p=248]
* Linux - [http://www.linux-sec.net/ 1] [http://www.puschitz.com/SecuringLinux.shtml 2] [http://www.linuxsecurity.com/docs/LDP/Security-HOWTO/ 3] security
* MySQL - [http://dev.mysql.com/doc/refman/5.0/en/security.html 1] [http://www.securityfocus.com/infocus/1667 2] security
* Apache - [http://httpd.apache.org/docs/2.0/misc/security_tips.html 1] [http://www.cisecurity.org/bench_apache.html 2] security
* [http://www.modsecurity.org/documentation/index.html Modsecurity apache2 module]
* Another [http://help.ubuntu.com/community/MySQLMoodle Ubuntu and Moodle install] document
* Moodle [[Security]]
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=125912 HowTo: Installing aspell in Ubuntu (with dictionary)] forum discussion
 
[[Category:Administrator]]
[[Category:Installation|Ubuntu]]

Latest revision as of 08:51, 27 February 2010