rocky linux怎么样

Rocky Linux是一个社区化的企业级操作系统,由Rocky Enterprise Software Foundation开发。它的设计是与美国顶级企业 Linux 发行版实现100% Bug级兼容。 ,,根据最新的统计数据,Rocky Linux的用户量在过去几个月中出现了大幅增长,超过了AlmaLinux、CentOS Stream和RHEL。

Rocky Linux服务器安装配置Moodle教程(rocky linux 安装)

Moodle是一个开源的在线教育平台,它可以帮助教师创建课程、发布作业、评分学生作业等,在本教程中,我们将介绍如何在Rocky Linux服务器上安装和配置Moodle。

rocky linux怎么样

系统环境准备

1、确保你的Rocky Linux服务器已经安装了Linux操作系统,并且已经配置好了网络、防火墙等相关设置。

2、更新系统软件包,执行以下命令:

sudo dnf update -y

3、安装必要的开发工具和库文件,执行以下命令:

sudo dnf groupinstall "Development Tools"
sudo dnf install wget unzip tar zip git curl php php-mysql php-gd php-ldap php-xml php-bcmath php-mbstring php-soap php-pear php-xmlrpc php-intl php-fpm php-devel php-mcrypt php-apcu php-redis php-memcached php-fileinfo php-json php-tokenizer php-pdo php-pgsql php-ssh2 sqlite3

下载并安装Moodle

1、访问Moodle官方网站(https://moodle.org/download),在“Download”页面选择适合你的版本进行下载,本教程以64位版本为例,下载地址为:https://download.moodle.org/release/64bit/MOODLE_64bit_VERSION_MAJOR_MINOR_RELEASE_DATE/en/download.html,请根据实际情况替换其中的版本号。

rocky linux怎么样

2、将下载好的Moodle压缩包上传到你的Rocky Linux服务器上,例如上传到/tmp目录下,执行以下命令:

sudo mv /tmp/MOODLE_64bit_VERSION_MAJOR_MINOR_RELEASE_DATE.tar.gz /opt/moodle/

3、解压Moodle压缩包,进入解压后的目录,执行以下命令:

cd /opt/moodle/MOODLE_64bit_VERSION_MAJOR_MINOR_RELEASE_DATE/extracted/build/apache2/htdocs/mod/moodle/data/db/versions.php

4、修改versions.php文件中的数据库配置信息,将其中的数据库名称、用户名、密码等信息替换为你自己的实际信息。

define('DB_NAME', 'moodle');     // Moodle database name (required)
define('DB_USER', 'moodleuser'); // Moodle database user (required)
define('DB_PASSWD', '********'); // Moodle database password (required)
define('DB_HOST', 'localhost');   // MySQL database host (optional)
define('DB_PORT', '3306');        // MySQL database port (optional)

5、在Moodle根目录下执行以下命令,初始化数据库:

rocky linux怎么样

sudo moodle db init --all --demodata=false --roleid="1" --lang="en" --adminpass="yourpassword" --allowadmin="nobody" --forceweblogin="yes" --enablebadges="yes" --enablecompletion="yes" --courseformat="site" --enablecalendar="yes" --enablecomments="yes" --enablebadges="yes" --enableoffline="yes" --enablefilters="yes" --enablemediaplayer="yes" --enableblog="yes" --enableportfolio="yes" --enabletags="yes" --enablecompletion="yes" --enableresource="yes" --enablebookmarks="yes" --enablescorm="no" --enableqanda="yes" --enablewebservices="yes" --version=202201010000 --cleanupoldtemptables "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true";

6、启动Apache和PHP服务,执行以下命令:

sudo systemctl start apache2 httpd php7.4-fpm
sudo systemctl enable apache2 httpd php7.4-fpm

配置Moodle站点和访问权限

1、编辑Moodle根目录下的config文件,找到$CFG->wwwroot这一行,将其值修改为你希望作为Moodle网站根目录的路径。

$CFG->wwwroot = '/opt/moodle/MOODLE_64bit_VERSION_MAJOR_MINOR_RELEASE_DATE/htdocs';

2、编辑Moodle根目录下的lib文件夹中的db文件夹下的locallib.php文件,找到$DB->set_debugging()这一行,取消注释并设置为false,这样可以关闭调试模式。

// Set debugging level to show all SQL queries and other information in the log file. The default is false which means no debug messages will be shown. Set to true to show as much info as possible. This can slow down your site significantly! Change this value only if you know what you are doing! Note that this is a security risk! Use it only for development purposes and never on a live site! You can also set this value in config.php by adding or changing the $CFG->debug parameter. Default is false. Example: define('DEBUG', true); If you want to change this setting after installation, please go to admin/settings.php and look for the Site administration settings -> Site access settings -> Debugging section. Then enter your new debug level there and save the changes. See also https://docs.moodle.org/dev/Administration_and_configurationDebugging and https://docs.moodle.org/dev/Administration_and_configurationLogging_and_debugging for more information about logging and debugging in Moodle. Make sure that you understand the implications of setting this to true before doing so! You may see lots of SQL queries in your Apache error log which could reveal sensitive information about your database! Be careful! If you are not sure whether your site is secure or not, leave this setting at its default value of false! If you want to see more detailed logs, consider using the web server's error log instead of the Apache error log! For example, you can use the following command to view PHP errors in your browser: http://yourservername/errorlog?level=PHPError &cmd=displayerrormsg&errno=* Errors from PHP errors should not be visible in plain text but they will be displayed in the browser if you use this method! Also note that this method does not provide any protection against XSS attacks! It is still recommended to use the built-in XSS protection provided by Moodle! Finally, make sure that your server is configured to send correct headers for HTML content! Otherwise, some browsers may display unexpected content or errors! For example, you can use the following command to view your server's response headers: curl http://yourservername && grep Date: | head -n 1 Response headers may vary depending on your web server configuration! For example, if you are using an Nginx web server, you can use the following command to view your server's response headers: curl http://yourservername && grep Date: | head -n 1 Response headers may vary depending on your web server configuration! For example, if you are using an Nginx web server, you can use the following command to view your server's response headers: curl http://yourservername && grep Date: | head -n 1 If you want to change these settings after installation, please go to admin/settings.php and look for the Site administration settings -> Site access settings -> Debugging section. Then enter your new debug level there and save the changes. See also https://docs.moodle.org/dev/Administration_and_configurationDebugging and https://docs.moodle.org/dev/Administration_and_configurationLogging_and_debugging for more information about logging and debugging in Moodle. Make sure that you understand the implications of setting this to true before doing so! You may see lots of SQL queries in your Apache error log which could reveal sensitive information about your database! Be careful! If you are not sure whether your site is secure or not, leave this setting at its default value of false! If you want to see more detailed logs, consider using the web server's error log instead of the Apache error log! For example, you can use the following command to view PHP errors in your browser: http://yourservername/errorlog?level=PHPError &cmd=displayerrormsg&errno=* Errors from PHP errors should not be visible in plain text but they will be displayed in the browser if you use this method! Also note that this method

原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/317778.html

Like (0)
Donate 微信扫一扫 微信扫一扫
K-seo的头像K-seoSEO优化员
Previous 2024-02-16 16:45
Next 2024-02-16 16:48

相关推荐

  • .net php 学哪个版本

    学习.NET和PHP时,建议从最新版本开始,因为新版本通常包含更多功能和性能优化。

    2024-05-27
    0117
  • php push数组

    在PHP中,数组是一种非常常用的数据结构,它可以用来存储和操作一组相关的值,PHP提供了许多内置的函数来处理数组,其中array_push()函数是一个非常实用的函数,它可以将一个或多个元素添加到数组的末尾,本文将详细介绍array_push()函数的使用方法和注意事项。array_push()函数简介array_push()函数是P……

    2023-12-26
    0131
  • php分割文本

    使用PHP的explode()函数可以分割文本。

    2024-01-18
    0157
  • php中的session有什么用

    PHP中的Session是什么?在Web开发中,Session是一种服务器端技术,用于在多个页面之间存储用户数据,当用户在浏览器中访问网站时,服务器会为每个用户创建一个唯一的Session ID,并将其存储在客户端的Cookie中,这样,当用户在接下来的请求中访问其他页面时,服务器可以通过Session ID识别出该用户,并从Cook……

    2024-01-01
    0110
  • phostorm怎么调用html模板

    Phostorm是一款强大的PHP集成开发环境,它提供了许多方便的功能,其中之一就是可以调用HTML模板,在Phostorm中,我们可以通过以下步骤来调用HTML模板:1、创建HTML模板文件我们需要创建一个HTML模板文件,这个文件通常包含一些基本的HTML结构,以及一些占位符,用于插入动态内容,我们可以创建一个名为index.ht……

    2024-02-21
    0203
  • 织梦网站新闻列表调用

    织梦网站新闻列表调用是一种在织梦CMS系统中实现网站新闻列表展示的方法,通过调用数据库中的新闻数据,可以方便地在网站上展示各类新闻信息,为用户提供丰富的资讯内容,本文将详细介绍如何使用织梦CMS系统进行新闻列表调用,并提供相关问题与解答。一、准备工作1、注册织梦CMS官网账号,登录后进入后台管理系统;2、在左侧菜单栏中找到“模块管理”……

    2023-12-11
    0111

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

免备案 高防CDN 无视CC/DDOS攻击 限时秒杀,10元即可体验  (专业解决各类攻击)>>点击进入