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-seoK-seo
Previous 2024-02-16 16:45
Next 2024-02-16 16:48

相关推荐

  • 怎么将html改成php

    将HTML改成PHP是一个常见的需求,因为PHP是一种服务器端脚本语言,可以与HTML混合使用,实现动态网页的功能,在本文中,我们将详细介绍如何将HTML改成PHP。1、了解PHP的基本语法在开始将HTML改成PHP之前,我们需要了解一些基本的PHP语法,PHP代码通常放在<?php ?>标签之间,或者使用……

    2023-12-29
    0148
  • 使用日本免费php空间有哪些缺点呢

    技术介绍随着互联网的普及,越来越多的人开始接触和使用PHP编程语言,而PHP网站的开发离不开一个稳定的服务器环境,在服务器选择上,免费的PHP空间是一个不错的选择,日本作为一个技术发达的国家,其免费PHP空间也有一定的市场,使用日本免费PHP空间也存在一些缺点,下面我们将详细介绍这些缺点。使用日本免费PHP空间的缺点1、访问速度慢由于……

    2024-01-27
    0296
  • 怎么把html转换成php源码

    将HTML网站转换为PHP网站通常意味着你想要添加动态功能,比如与数据库交互、用户认证或者表单处理等,这个过程不仅包括文件扩展名的更改,还涉及到在HTML中嵌入PHP代码或者使用PHP包含文件的方法来重构网站,以下是详细的技术介绍:1、理解PHP和HTML的区别 HTML(HyperText Markup Language)是一种标记……

    2024-02-04
    0197
  • centos安装php7.3

    在CentOS上安装PHP 7.3,首先启用EPEL和Remi存储库,然后使用yum命令安装。

    2024-02-11
    0212
  • 如何利用PHP进行报表分析?

    分析报表 PHP在Web开发中,PHP常用于生成动态内容和处理数据,对于报表分析,PHP可以与数据库结合使用,执行复杂的查询操作,并展示结果,以下是关于如何使用PHP进行报表分析的详细步骤和示例代码,1. 环境搭建确保你的开发环境中安装了以下软件:- Web服务器(如Apache或Nginx)- PHP解释器……

    2024-11-25
    06
  • php虚拟主机如何使用

    在互联网世界中,虚拟主机是一种常见的网络服务,它允许用户通过一台服务器来托管多个网站,PHP是一种广泛使用的开源服务器端脚本语言,用于创建动态网页和Web应用程序,本文将详细介绍如何使用PHP虚拟主机。1、了解PHP虚拟主机PHP虚拟主机是一种专门为PHP应用程序设计的虚拟主机,它提供了一种简单、高效的方式来托管和管理PHP网站,与传……

    2024-01-21
    0162

发表回复

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

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