Linux搭建Moodle

一.环境搭建(Apcahe+php+mysql)


1.Apache
a.安装epel源 yum install epel-release
b.安装 yum install httpd
c.启动 systemctl start httpd
d.查看状态 systemctl status httpd


APache根目录在/var/www/html

2.php安装

yum -y install php    

记得启动php服务

3.MySQL安装

yum -y install mysql   

4.进入网站下载Moodlehttps://moodle.org/

解压文件至/var/www/html内

tar -zxvf 软件名 /var/www/html

5.提前部署mysql数据库

systemctl start mysqld    //启动mysql服务

CREATE DATABASE moodle;
CREATE USER 'moodlea'@'%' IDENTIFIED BY 'moodleadmin';
GRANT ALL PRIVILEGES ON moodle.* TO 'moodleadmin'@'%';
FLUSH PRIVILEGES;

6.更改/var/www/html/moodle/config.php内容

unset($CFG);  // Ignore this line
global $CFG;  // This is necessary here for PHPUnit execution
$CFG = new stdClass();

$CFG->dbtype    = 'mysqli';      // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci'
$CFG->dblibrary = 'native';     // 'native' only at the moment
$CFG->dbhost    = 'IP地址';  // eg 'localhost' or 'db.isp.com' or IP
$CFG->dbname    = '数据库名称';     // database name, eg moodle
$CFG->dbuser    = '数据库账号';   // your database username
$CFG->dbpass    = '数据库密码';   // your database password
$CFG->prefix    = 'mdl_';       // prefix to use for all table names
$CFG->dboptions = array(
    'dbpersist' => false,       // should persistent database connections be
                                //  used? set to 'false' for the most stable
                                //  setting, 'true' can improve performance
                                //  sometimes
    'dbsocket'  => false,       // should connection via UNIX socket be used?
                                //  if you set it to 'true' or custom path
                                //  here set dbhost to 'localhost',
                                //  (please note mysql is always using socket
                                //  if dbhost is 'localhost' - if you need
                                //  local port connection use '127.0.0.1')
    'dbport'    => '',          // the TCP port number to use when connecting
                                //  to the server. keep empty string for the
                                //  default port
);

7.进入网址:http://IP/moodle进行安装,缺什么yum 去补,restart命令去重启服务

然后就是愉快的配置,最后给moodle配置一些插件!!!

完成

  • 14
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Linux系统上安装Moodle可以通过编译安装的方式进行。首先,你需要按照[1]中详细解析的步骤来编译安装Linux操作系统。然后,需要注意的是,在安装Moodle平台时,你可能会遇到RedHat-Linux操作系统的不支持问题。这是因为在安装时使用的是Linux系统自带的软件,而Linux系统自带的MySQL版本可能太低,导致安装失败。因此,你可能需要升级MySQL或使用其他支持的数据库。另外,根据中的摘要,MoodleLinux系统下安装运行更稳定、安全,因此选择在RedHat-Linux系统下构建Moodle平台可以提供良好的环境支持。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [linux编译lamp环境和安装moodle_详细说明版](https://download.csdn.net/download/majianxiong_lzu/8870011)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Linux操作系统下Moodle平台的搭建](https://blog.csdn.net/wangflash/article/details/47664959)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值