通過地址https://download.moodle.org/releases/latest/選擇下載,下載兩種壓縮包都特別慢(有可能無法下載)。
可以使用下面git下載項目
注意圖中php、mysql等版本要求,本次采用Ubuntu22.04下 nginx+php8.2+mysql8.4部署
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/
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
max_input_vars = 5000
訪問http://moodle.xiaohutiger.cn/,進程頁面設置
連接數據庫報錯:配置時 默認是localhost,改成ip地址8.140.30.131
數據庫是用docker運行,映射本地端口,阿里云安全組打開端口權限