个人工具

UbuntuHelp:MySQLMoodle

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 11:24的版本 (New page: {{From|https://help.ubuntu.com/community/MySQLMoodle}} {{Languages|php5}} == Introduction == This document describes how to install "Moodle", the Open Source Content Management System o...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


Introduction

This document describes how to install "Moodle", the Open Source Content Management System on Ubuntu Linux so that it uses MySQL. The default install uses PostgreSQL.

This has only been tested on Edgy Eft (Ubuntu 6.10). It should work on Dapper Drake if you do this please amend this page appropriately. The installation was tested with Moodle v1.6.3. The Moodle Install may change at a later date.

To start with, open a terminal (Applications/Accessories/Terminal). Commands will be typed in here unless otherwise specified.

Installing the LAMP Stack

To start with, you need to install LAMP - Linux, Apache, MySQL and PHP Version 5.

This is covered in this Wiki Article Apache PHP MySQL

Adding PHP5-GD

Install the package PHP5-GD which is required by Moodle.

sudo apt-get install php5-gd
</code>

Restart the Apache Web Server so this change becomes part of the system

<pre>
sudo /etc/init.d/apache2 restart
</code>

== Download and unpack Moodle ==

Start up a new Firefox Window (Ctrl+N) and navigate to http://download.moodle.org. Left click on the 'Latest Release'  '.tgz format' entry. This should download the Moodle program onto your computer. This normally will be saved to the desktop - it says where it is saved to on the Download dialogue.

Now change to the web space folder on your computer and unpack moodle into it.

<pre>
cd /var/www
sudo tar xvf /home/paulr/Desktop/moodle-1.6.3.tgz
</code>

You will have to tailor this command appropriately ; this would work if the file is saved on the desktop of the user 'paulr' and it is moodle 1.6.3.

Next, we have to change the permissions of the moodle folder so it can be written to. This is required for a later step in the installation, where a configuration file is written to the moodle directory.

<pre>
sudo chmod 777 /var/www/moodle
</code>

== Set up Moodle's Data Directory ==

We now create a directory for Moodle data, and set it's permissions so it can be written to by moodle.

<pre>
sudo mkdir /var/moodledata
sudo chmod 777 /var/moodledata
</code>

== Install Moodle ==

Now Moodle is ready to go, but we need to run through the program's own installer. Start up a firefox window and type the URL http://localhost/moodle into the address bar. This should bring up the first page of the moodle installer.

== Select Language ==

Select the language you want. The default is English, and click on "next"

== Checking PHP settings ==

A page of tests are conducted on PHP. All should say "OK" in Green.  The only one that isn't by default is "GD Version" - if this has failed reinstall php5-gd and restart apache (see above). If they all say "ok" click on next.

== Locations ==

The next page sets the locations of the moodle installation. These should be http://localhost/moodle /var/www/moodle and /var/moodledata (the last one is the directory you created above). 

Click on next. If this fails, check you set up the /var/moodledata directory as above.

== Database configuration (MySQL) ==

The first part involves setting up MySQL to work with Moodle.

If you have not already set a master password for MySQL type the following, replacing pwd with the password you want to use for MySQL.

<pre>
mysqladmin -u root password pwd
</code>

Then start up the MySQL Client application by typing
<pre>
mysql -u root -p
</code>

the program will respond ''password:'' and you can type in the master password. This should now display the MySQL prompt.

Create the database for use by Moodle

<pre>
create database moodle;
</code>

Make it readable to the moodle user

<pre>
grant all privileges on moodle.* to paulr@localhost identified by "paulrpwd";
</code>

This sets the moodle database to be useable by the MySQL user paulr with the password paulrpwd. You may change these to any values you like. The quotes around the end are '''required'''.

== Database Configuration (Moodle) ==

Enter the appropriate values on the Moodle Database Configuration page. These are (in v1.6.3)

* Type : MySQL
* Host Server : localhost
* Database : moodle
* User : paulr
* Password : paulrpwd
* Tables Prefix : mdl_

You should only need to enter the user and the password - which should be the values you set in the previous section.

Then Click on the Next button. If this fails, go back and check the database setup steps.

== Environment Check ==

The next page is some environment checks ; all four should read 'OK'.  Click on 'Next'.

== Download Language Pack ==

The program will offer you the chance to download a language pack. Click on 'next'.

== Configuration Completed ==

The program now writes a config file to your system. If this step fails, try doing the  '''sudo chmod 777 /var/www/moodle''' command again, as above. Click on 'Next'

== Terms and Conditions ==

Now is your chance to read the T & C, which we all always do, of course. To continue, click on the 'Yes' button.

== Setting up Database ==

Moodle now sets up its database. This should produces pages of SQL commands followed by 'Success' in your browser. Go to the bottom, and hit the continue button.

== Release Notes ==

You can now read the release notes, or hit the Continue button to start.

== Setting up Moodle : Variables ==

You have now successfully installed Moodle. The configuration pages that follow can be changed at any time to suit.

For the moment, go the bottom of the page and click on "Save Changes", then click on "Continue"

== Setting up Moodle : More SQL ==

There now follows half a dozen pages of SQL. Scroll to the bottom and press continue on each, and eventually you will reach the Site Settings page

== Site Settings ==

Type in a site name, a short name, and a description (you can easily change it later). Go to the bottom and click on 'Save Changes'

== Administrator Account ==

On the administrator account page, enter your new password for the administrator, then click on 'update profile' at the bottom. This will throw up some errors - correct them so you can carry on, or if you like fill this page in properly. As with everything else, you can change it any time you like.

Click on Continue

== Welcome to Moodle ==

Congratulations ! You now have an up and running Moodle server.
----

CategoryDocumentation CategoryDocumentation

[[category:UbuntuHelp]]