Moodle是一个免费的开源学习管理系统(LMS),它可为教育者和学习者提供一个简单、安全的集成教学平台。那么Moodle如何安装?本文主要介绍下在Rocky Linux服务器中安装配置Moodle的方法步骤。

Rocky Linux作为替代CentOS 8的社区企业操作系统,旨在为用户提供稳定的社区发行版Linux系统。目前部分美国服务器商家有提供对Rocky Linux系统的支持,比如Vultr、RackNerd等。
我们要在Rocky Linux服务器上安装配置Moodle,需先开通一台全新机器,这里使用的是Vultr美国VPS。Vultr VPS服务器支持按小时或按月计费,每月2.5美元起,全球数据中心多达20个,配置产品多样,能满足不同用户建站需要,使用下文优惠码还有机会免费获得100美元账户余额。
Vultr优惠码:VULTRMATCH(充多少送多少 最高可送100美元,赠送金额有效期12个月)
Vultr美国VPS服务器开通后,利用SSH工具登录到服务器,开始搭建LAMP环境并创建一个具有sudo权限的标准用户,环境配置好后,可按照以下步骤来安装配置Moodle程序。
相关阅读:《Rocky Linux服务器安装部署LAMP环境教程》
《Rocky Linux服务器如何创建sudo权限用户》
1、创建Moodle数据库
登录MySQL。
$ mysql -u root
创建新数据库moodledb,并使用强密码新建用户,授予用户对数据库的完全权限。
MariaDB [(none)]> create database moodledb;
CREATE USER ‘user’@’localhost’ IDENTIFIED BY ‘replace-this-with-a-strong-password’;
GRANT ALL PRIVILEGES ON moodledb.* TO ‘user’@’localhost’;
刷新权限设置。
FLUSH PRIVILEGES
设置完毕后,运行下面命令退出MySQL。
EXIT
2、安装必要的PHP扩展
运行下面命令安装Moodle程序所需的PHP扩展。
$ sudo dnf install php-mysqlnd php-gd php-intl php-xmlrpc php-soap php-opcache php-sodium
3、安装Moodle
下载最新的Moodle稳定版,本文使用的是Moodle 3.11版本。
$ wget https://download.moodle.org/stable311/moodle-latest-311.tgz
提取下载的安装包文件。
$ tar -xvf moodle-latest-311.tgz
默认情况下,将所有提取的文件移动到Web服务器根目录/var/www/html/中。
$ sudo mv moodle/* /var/www/html/
更改Apache用户和组的相关权限。
$ sudo chown -R apache:apache /var/www/html/
然后打开浏览器,访问所使用的Vultr美国VPS服务器IP地址开始启动Moodle安装程序。
http://SERVER_IP_ADDRESS
按照页面提示,选择程序使用语言,默认是英文的,然后单击下一步,确认安装路径。新目录/moodledata将会创建到/var/www目录下,接着下拉列表选择合适的数据库服务器,这里使用的是MariaDB,在对应的文本框中输入前文(步骤1)创建的数据库信息。
数据库信息填写完毕后,点击Next按钮继续安装Moodle程序,安装过程大概需要1~2分钟。
4、配置Moodle
在安装页面上,设置Moodle管理员用户名、密码、电子邮件地址等信息,然后设置首页并保存更改以直接登录到后台管理页面。
最后,点击register your site按钮,完成Moodle平台注册即可。
最新评论
Hey! I could have sworn I've been to this blog before but after checking through some of the post I realized it's new to me. Anyways, I'm definitely delighted I found it and I'll be book-marking and checking back often!
Heya i am for the primary time here. I came across this board and I to find It really helpful & it helped me out much. I'm hoping to give something back and help others like you helped me.
Pretty element of content. I simply stumbled upon your website and in accession capital to claim that I acquire in fact enjoyed account your weblog posts. Any way I’ll be subscribing for your augment and even I success you access persistently rapidly.
Would love to perpetually get updated outstanding weblog! .
Some really nice stuff on this internet site, I like it.
Can I simply say what a reduction to find somebody who actually knows what theyre talking about on the internet. You positively know find out how to carry an issue to mild and make it important. Extra individuals have to read this and understand this facet of the story. I cant believe youre not more fashionable because you positively have the gift.
I like this post, enjoyed this one appreciate it for posting.
Definitely, what a splendid blog and enlightening posts, I surely will bookmark your site.Best Regards!