Install & Uninstall of Moodle on Ubuntu

在 CentOS_x86 的机子上安装失败,一来可能跟 64 位的机子有关系;二来是个 nginx 环境,跟 apache2 的官方建议不是很吻合(但我想 lnmp 的环境肯定是可以的,应该是要做一些改动的);再者,即使使用 remi 这样的第三方源,mysql 和 php 的版本都是比较旧的,索性就用 ubuntu 吧。

ubuntu 10.04.2 i368 + moodle 2.0.2

PS:安装完 ubuntu,准备安装 openssh-server 一直出错,apt-get update 一下即可。

update
          update is used to resynchronize the package index files from their
          sources. The indexes of available packages are fetched from the
          location(s) specified in /etc/apt/sources.list. For example, when
          using a Debian archive, this command retrieves and scans the
          Packages.gz files, so that information about new and updated
          packages is available. An update should always be performed before
          an upgrade or dist-upgrade. Please be aware that the overall
          progress meter will be incorrect as the size of the package files
          cannot be known in advance.

安装apache2,php5 以及相关联的模块:

#apt-get install apache2 php5 libapache2-mod-php5 php5-gd php5-curl php5-xmlrpc

测试:

#vi /var/www/index.php

<?php
phpinfo();
?>

http://localhost/index.php

安装mysql

# apt-get install mysql-server mysql-client php5-mysql  libapache2-mod-auth-mysql

测试:mysql

# netstat -tulp | grep mysql

重启

# service apache2 restart
# service mysql restart

Moodle安装

# pwd
/var/www

# wget http://download.moodle.org/download.php/stable20/moodle-2.0.2.zip
# unzip moodle-2.0.2.zip

建立数据放置的目录,不然到后面会出错

# mkdir moodledata
# chmod 777 moodledata

http://localhost/moodle

按导航进行安装。

卸载比较简单,删除 /var/www 下面的 moodle/ 再删除对应的 moodle 数据库即可。

# cd /var/www
# mv moodle/ moodle-old/

删除数据库

# mysql -u root -h localhost -p
>drop database moodle;