「快速安装 Moodle 指南」:修訂間差異

出自MoodleDocs
跳到:導覽、​搜尋
第63行: 第63行:
See [[Cron]] for more options.
See [[Cron]] for more options.


==Congratulations!==
== 祝贺!==


You are now ready to use your Moodle site.
你已经成功安装了你的 Moodle 站点了。


If you run into problems, check the [[Installation FAQ]] and visit the Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum].
If you run into problems, check the [[Installation FAQ]] and visit the Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum].

於 2013年8月14日 (三) 13:30 的修訂

這個頁面主要針對具有 Web 伺服器和應用程式安裝經驗的系統管理員。否則請參看安裝 Moodle

基本要求

  • 你需要自行配置 Web 伺服器(比如 Apache),數據庫(比如 MySQLPostgreSQL)和 PHP。
  • Moodle 的運行需要一系列的 PHP 擴展。Moodle 在安裝的時候會進行校驗,如果你有任何需要的擴展沒有安裝上來,請先行安裝擴展,然後重啟安裝進程。
  • 如果你希望你的 Moodle 具有外發電子郵件功能,你可能需要配置(Unix/Linux)伺服器下的 Sendmail 或者直接使用 SMTP 郵件伺服器。

獲得 Moodle 程序文件

你基本上有 2 個選擇:

  • http://moodle.org/downloads 網站上下載你需要的版本
  • 從Git 代碼倉庫中直接下載原始碼(推薦開發人員使用這個方式,這個方式讓你更新程序更加簡單):
git clone -b MOODLE_25_STABLE git://git.moodle.org/moodle.git 

這個過程將會切換到 Moodle 的 2.5 穩定分支(最新的每周構建),並且拷貝完整的 Moodle 代碼倉庫。

Note: 僅從 Moodle 官方網站上提供的下載地址下載程序。其他版本,例如,虛擬主機提供的安裝服務或者隨 Linux 分發的版本庫不能保證所有程序能夠正常的進行工作,同時 Moodle 官方網站也不提供支持。

創建數據庫

  • 使用你選擇的數據庫伺服器,創建一個新的數據庫。默認的編碼格式必須使用 UTF-8 編碼。例如,MySQL 數據庫:
CREATE DATABASE moodle DEFAULT CHARACTER SET UTF8 COLLATE utf8_unicode_ci;
  • 為你的數據庫創建一個具有正確權限的用戶名和密碼,例如,MySQL 數據庫:
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'yourpassword';

Create data directory

  • Create an empty directory to hold Moodle files. It must not be in the area served by the web server and must have permissions so that the web server user can write to it. Typically, either make it owned by the web server user or give it write permissions for 'everyone'.

Install Moodle code

  • Unzip / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/moodle)
  • Check the permissions and make sure that the web server does not have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).
  • If you need to, configure your web server to serve the Moodle site with your chosen URL.

Configure Moodle

  • In the Moodle code directory, find the file config-dist.php and copy it to a new file called config.php (but read next step, 'Install Moodle', first).
  • Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards

Install Moodle

  • Go to the URL for your moodle site in a browser (installation will complete automatically) or run the command line version at (requires cli version of PHP):
/usr/bin/php /path/to/moodle/admin/cli/install.php

The CLI creates the config.php for you and will not run if you created one in the previous step.

  • After completing the install make sure your file permissions are ok for the Moodle program files (not writeable by web server) and the Moodle data files (writeable by web server).

Set up cron

  • You will need a cron job to run periodically. A typical Unix cron entry will be as follows:
*/15 * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php >/dev/null

See Cron for more options.

祝賀!

你已經成功安裝了你的 Moodle 站點了。

If you run into problems, check the Installation FAQ and visit the Using Moodle Installation problems forum.