ubuntu 部署moodle

通过地址https://download.moodle.org/releases/latest/选择下载,下载两种压缩包都特别慢(有可能无法下载)。
可以使用下面git下载项目

注意图中php、mysql等版本要求,本次采用Ubuntu22.04下 nginx+php8.2+mysql8.4部署

bash 复制代码
mkdir /var/www/moodle
sudo git clone -b MOODLE_500_STABLE git://git.moodle.org/moodle.git /var/www/moodle/
chown -R www-data:www-data /var/www/moodle/
bash 复制代码
server {
    listen 80;
    server_name moodle.xiaohutiger.cn;
    root /var/www/moodle;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php(/|$) {
      # Split the path info based on URI.
      fastcgi_split_path_info ^(.+\.php)(/.*)$;

      # Note: Store the original path_info. It will be wiped out in a moment by try_files.
      set $path_info $fastcgi_path_info;

      # Look for the php file. If not round then jump to @routed.
      try_files $fastcgi_script_name $fastcgi_script_name/;

      # File was found - pass to fastcgi.
      fastcgi_pass   unix:/run/php/php8.2-fpm.sock;
      include        fastcgi_params;

      # Re-apply the path_info after including fastcgi_params.
      fastcgi_param PATH_INFO $path_info;
      fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
      fastcgi_param DOCUMENT_ROOT $realpath_root;
    }
    }

修改php.ini

bash 复制代码
 max_input_vars = 5000

访问http://moodle.xiaohutiger.cn/,进程页面设置


连接数据库报错:配置时 默认是localhost,改成ip地址8.140.30.131

数据库是用docker运行,映射本地端口,阿里云安全组打开端口权限

相关推荐
C_心欲无痕8 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
HIT_Weston10 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
HIT_Weston10 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式10 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
老前端的功夫14 小时前
TypeScript 类型魔术:模板字面量类型的深层解密与工程实践
前端·javascript·ubuntu·架构·typescript·前端框架
HABuo15 小时前
【Linux进程(四)】进程切换&环境变量深入剖析
linux·运维·服务器·c语言·c++·ubuntu·centos
罗马苏丹默罕默德1 天前
Ubuntu下部署.NetCore WebApi的方法
数据库·ubuntu·.netcore
一尘之中1 天前
在Ubuntu 22.04中高效使用pip:从入门到精通
ubuntu·pip·ai写作
一尘之中1 天前
Ubuntu 22.04 SSH服务完全配置指南:从基础到安全加固
ubuntu·ssh·ai写作
老兵发新帖1 天前
ubuntu服务器配置私钥登录
linux·服务器·ubuntu