2014年10月20日 星期一

Install Moodle 2.7+ On Ubuntu Server 12.04

採預設安裝完Ubuntu Server 12.04 64位元
使用root 登入
sudo -i
輸入管理者密碼

更改Source.list來源
先複製一份備份
cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
vi /etc/apt/source.list
把http://us.archive.ubuntu.com 換成 http://ubuntu.stu.edu.tw
若是使用vi或vim編輯檔案,可以使用以下取代指令
:1,$s/us.archive.ubuntu.com/ubuntu.stu.edu.tw/g


更新系統
apt-get update
apt-get upgrade
安裝LAMP Server
sudo apt-get install lamp-server^

建立Apache2 的FQDN名稱
Vi /etc/apache2/conf.d/fqdn

在檔案內增一筆
ServerName localhost
儲存離開,重新啟動apache2
service apache2 restart

更新php 5.3 到 5.5
http://lab.asika.tw/information/host/17-ubuntu-12-php-5-4.html
apt-get install python-software-properties
add-apt-repository ppa:ondrej/php5
apt-get update
apt-get install php5

安裝所需套件
apt-get install php5-curl
http://php.net/manual/en/xmlrpc.installation.php
apt-get install php5-xmlrpc
http://php.net/manual/en/intl.installation.php
apt-get install php5-intl
service apache2 restart

安裝 moodle 之前,也可先建一個資料庫 moodle,設定好 dbuser,passwd
如果不用 phpmyadmin 建立資料庫,請以手動建立
mysql –u root –p
mysql> create database moodle;
如有中文字元問題,改
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE USER 'mis'@ '%' IDENTIFIED BY 'ezgo1314';

mysql> grant all privileges on xxxdb.* to yyy@localhost IDENTIFIED BY '12345678' ; 

下載Moodle 2.7
cd /var/www
wget https://download.moodle.org/stable27/moodle-2.7.tgz
tar zxvf moodle-2.7.tgz
cp -rf /var/www/moodle /var/www/html/moodle
mkdir /var/www/moodledata
chmod 777 -R /var/www/moodledata
chown www-data /var/www/html/moodle(若沒做這步,安裝時要自己手動產生config.php 把網頁上的文字設定,存檔放入 moodle 目錄下)





沒有留言:

張貼留言