个人工具

“UbuntuHelp:MySQLMoodle”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(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...)
 
第23行: 第23行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install php5-gd
 
sudo apt-get install php5-gd
</nowiki></code>
+
</nowiki></pre>
  
 
Restart the Apache Web Server so this change becomes part of the system
 
Restart the Apache Web Server so this change becomes part of the system
第29行: 第29行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo /etc/init.d/apache2 restart
 
sudo /etc/init.d/apache2 restart
</nowiki></code>
+
</nowiki></pre>
  
 
== Download and unpack Moodle ==
 
== Download and unpack Moodle ==
第40行: 第40行:
 
cd /var/www
 
cd /var/www
 
sudo tar xvf /home/paulr/Desktop/moodle-1.6.3.tgz
 
sudo tar xvf /home/paulr/Desktop/moodle-1.6.3.tgz
</nowiki></code>
+
</nowiki></pre>
  
 
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.
 
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.
第48行: 第48行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo chmod 777 /var/www/moodle
 
sudo chmod 777 /var/www/moodle
</nowiki></code>
+
</nowiki></pre>
  
 
== Set up Moodle's Data Directory ==
 
== Set up Moodle's Data Directory ==
第57行: 第57行:
 
sudo mkdir /var/moodledata
 
sudo mkdir /var/moodledata
 
sudo chmod 777 /var/moodledata
 
sudo chmod 777 /var/moodledata
</nowiki></code>
+
</nowiki></pre>
  
 
== Install Moodle ==
 
== Install Moodle ==
第85行: 第85行:
 
<pre><nowiki>
 
<pre><nowiki>
 
mysqladmin -u root password pwd
 
mysqladmin -u root password pwd
</nowiki></code>
+
</nowiki></pre>
  
 
Then start up the MySQL Client application by typing
 
Then start up the MySQL Client application by typing
 
<pre><nowiki>
 
<pre><nowiki>
 
mysql -u root -p
 
mysql -u root -p
</nowiki></code>
+
</nowiki></pre>
  
 
the program will respond ''password:'' and you can type in the master password. This should now display the MySQL prompt.
 
the program will respond ''password:'' and you can type in the master password. This should now display the MySQL prompt.
第98行: 第98行:
 
<pre><nowiki>
 
<pre><nowiki>
 
create database moodle;
 
create database moodle;
</nowiki></code>
+
</nowiki></pre>
  
 
Make it readable to the moodle user
 
Make it readable to the moodle user
第104行: 第104行:
 
<pre><nowiki>
 
<pre><nowiki>
 
grant all privileges on moodle.* to paulr@localhost identified by "paulrpwd";
 
grant all privileges on moodle.* to paulr@localhost identified by "paulrpwd";
</nowiki></code>
+
</nowiki></pre>
  
 
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'''.
 
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'''.

2007年5月13日 (日) 12:34的版本


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

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

sudo /etc/init.d/apache2 restart

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.

cd /var/www
sudo tar xvf /home/paulr/Desktop/moodle-1.6.3.tgz

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.

sudo chmod 777 /var/www/moodle

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.

sudo mkdir /var/moodledata
sudo chmod 777 /var/moodledata

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.

mysqladmin -u root password pwd

Then start up the MySQL Client application by typing

mysql -u root -p

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

create database moodle;

Make it readable to the moodle user

grant all privileges on moodle.* to paulr@localhost identified by "paulrpwd";

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