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
(simplify editing)
m (corrected password references)
Line 117: Line 117:
Finally, we need to create the Moodle database and Moodle user in MySQL.
Finally, we need to create the Moodle database and Moodle user in MySQL.
<pre>
<pre>
mysql -u root -p YourDatabasePassword
mysql -u root -p RootDatabasePassword
CREATE DATABASE moodle;
CREATE DATABASE moodle;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON moodle.*
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON moodle.*
TO moodle@localhost IDENTIFIED BY 'YourMoodlePassword';
TO moodle@localhost IDENTIFIED BY 'NewMoodleDatabasePassword';
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
QUIT;
QUIT;
</pre>
</pre>
Replace the string ''YourDatabasePassword'' with a secure password of your own choosing.
Replace the string ''RootDatabasePassword'' with the database password from above and replace ''NewMoodleDatabasePassword'' with a secure password of your own choosing.


=== Configure Moodle website ===
=== Configure Moodle website ===

Revision as of 12:50, 24 January 2007


What you need to start:

  • Ubuntu 6.06 LTS server CD
  • A test x86 desktop computer, keyboard, monitor, mouse, and firewalled internet connection.
  • One hour of time. (seriously!)

Directions:

Install Ubuntu

Start computer and use F12 to boot from CD.

Select Install to hard drive.

Select your language, country, and keyboard layout (i.e. English, United States, American English)

Select autodetect network, if you have DHCP. Should be a static IP in a development or production environment.

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.

/bootext3200MBbootable (needs to be on the first part of the drive)
/ext310GB(files are relatively static)
swap4GB (4xRAM if you don't have much memory, down to 1xRAM if you have gobs of memory)
/varext326GB(variable content – uses rest of the drive)

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.

Type the following on the command line. Remove the # mark on line twenty-two to enable access to the universe package source. You will need to re-enter your account password when sudo asks for it.

sudo nano /etc/apt/sources.list  

Now to get all the security updates.

sudo apt-get update

sudo apt-get dselect-upgrade

Just press Y to install the updates. Normally you would just use sudo apt-get upgrade.

And reboot!

sudo reboot

Install MySQL

At this point we'll need to log in again to the server and type:

sudo apt-get install mysql-server mysql-client

mysqladmin –u root password NewRootDatabasePassword

mysqladmin -u root -h localhost password NewRootDatabasePassword

Replace the string NewRootDatabasePassword with a secure password of your own choosing.

Install Apache

On the command line, type:

sudo apt-get install apache2 libapache2-mod-php5 php5-gd php5-mysqli 

It's that simple!

Install other software

On the command line, type:

sudo apt-get install ntp ntp-simple unattended-upgrades

sudo apt-get install clamav unzip zip aspell-en

sudo apt-get install libapache2-mod-security php5-ldap php5-odbc

The clamav package will support virus checking on file uploads into Moodle.

Additional languages are available for aspell.

The LDAP and ODBC packages will help us authenticate via Active Directory and enrol via an Oracle database.

Install Moodle

Log in to your account and type:

cd /var/www

sudo wget http://download.moodle.org/stable17/moodle-latest-17.tgz

sudo tar –zxf moodle-latest-17.tgz

sudo mkdir /var/moodledata

sudo chown –R www-data.www-data /var/moodledata /var/www/moodle

We now need to edit the Apache DocumentRoot from /var/www to /var/www/moodle (lines four and nine). Restart Apache.

sudo nano /etc/apache2/sites-available/default  

sudo /etc/init.d/apache2 restart

Finally, we need to create the Moodle database and Moodle user in MySQL.

mysql -u root -p RootDatabasePassword
CREATE DATABASE moodle;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON moodle.*
TO moodle@localhost IDENTIFIED BY 'NewMoodleDatabasePassword';
FLUSH PRIVILEGES;
QUIT;

Replace the string RootDatabasePassword with the database password from above and replace NewMoodleDatabasePassword with a secure password of your own choosing.

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

Complete the Moodle install using a secure username and password

Reboot

Go to a bar for a few hours.

Come back and tell your boss that you FINALLY got the test server running.

Other Resources

  • Ubuntu 6.06 Server Guide - HTML PDF
  • Ubuntu/Linux security
  • MySQL security
  • Apache security