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运行,映射本地端口,阿里云安全组打开端口权限

相关推荐
静止了 所有的花开6 小时前
Ubuntu 26.04 静态 IP 配置不生效解决方法
linux·ubuntu·静态ip
桑榆41615 小时前
双系统(Windows + Ubuntu)安装流程
linux·windows·ubuntu
sunly_1 天前
TypeScript:3、类型声明与类型推断
javascript·ubuntu·typescript
wengqidaifeng1 天前
1.从“会敲命令”到理解 Linux:15 个基础指令、文件树与命令执行的本质
linux·运维·服务器·ubuntu
问天_观心1 天前
虚拟环境WSL之Ubuntu的安装
人工智能·ubuntu
lyx49491 天前
# Ubuntu/Linux 安装 Claude Code 并接入火山方舟 Coding Plan 完整教程(避坑版)
linux·运维·ubuntu
码农阿豪1 天前
Ubuntu部署GodoOS:Docker搭建Web办公桌面并实现远程访问
前端·ubuntu·docker
Groundwork Explorer1 天前
WSL2 Ubuntu 22.04 LTS ESP-IDF 5.5 Micropython 1.28 固件编译指南
运维·python·单片机·ubuntu
zhangrelay2 天前
ROS 2 Lyrical 第4章 URDF机器人建模与Gazebo Garden仿真
linux·笔记·学习·ubuntu·机器人·ros2
mgaofeid2 天前
Ubuntu 24.04 中文输入法安装
linux·运维·ubuntu