moodle 3.10 installation problem

moodle 3.10 installation problem

- Panupong Prueksa の投稿
返信数: 32

Dear everyone i'm first timer here

I used to installing older moodle with nginx (maybe version 3.6 or something)

today i need to install new moodle 3.10 instance with nginx and i get error 404 with something likes

"http://ipaddress/admin/<a></a>" in address bar

First part of installation was fine with php extension check up all green, upgrading plugin all succeed until 404 jumping at me.


What did i done wrong or something bugging out? 

評点平均:Useful (1)
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
If you guys want some environment specification here it is
OS: Ubuntu 20.04 LTS
Web server: NGINX 1.18
PHP: PHP-FPM 7.4
Database: MariaDB 10.5.8
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
Did you configure nginx as specified in the link below?

https://docs.moodle.org/310/en/Nginx
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Emma Richardson の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers
How exactly did you install? Have you checked folder permissions on the new code? Deleted cache and localcache folders from your moodleDATA folder (NOT the code folder).?
Emma Richardson への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
1. This is new installation without old code base.
2. I might try looking at code folder permission. What's correct permission for code folder?
3. i already cleared cache from data folder.
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Emma Richardson の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers
I normally set mine at 755 but you also need to make sure www-data or apache is the owner...depending on your os
Emma Richardson への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
I must say it still not working 悲しい after doing chmod, chown.
I just wonder how can "<a></a>"  get in url redirect likes "http://ip/admin/<a></a>"?
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
What is $CFG->wwwroot set to in config.php?
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
for $CFG->wwwroot = http://x.x.x.x
for NGINX root => /var/www/moodle/
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
Can you load the site with developer tools open (Chrome or Firefox, F12), and screenshot the network tab when you load the site.

Further, immediately after you encounter the issue, take a look at the nginx error logs using the below commands and copy/paste anything that looks unusual here.

sudo tail /var/log/nginx/error.log
sudo tail /var/log/nginx/access.log
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
This is error log from nginx
(Does this mean it can't entering admin directory?)

2021/01/29 01:23:54 [error] 34346#34346: *853 directory index of "/var/www/moodle/" is forbidden, client: 172.19.0.36, server: , request: "GET / HTTP/1.1", host: "172.19.0.39"
2021/01/29 01:23:55 [error] 34346#34346: *853 open() "/var/www/moodle/favicon.ico" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /favicon.ico HTTP/1.1", host: "172.19.0.39", referrer: "http://172.19.0.39/"
2021/01/29 01:24:01 [error] 34346#34346: *853 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 01:25:22 [error] 34346#34346: *858 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 01:26:15 [error] 34346#34346: *858 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 01:26:26 [error] 34346#34346: *858 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 01:27:00 [error] 34346#34346: *858 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 01:29:23 [error] 737#737: *1 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 08:50:40 [error] 737#737: *6 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 08:50:48 [error] 737#737: *6 open() "/var/www/moodle/admin/" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"

This is access log from nginx

172.19.0.36 - - [29/Jan/2021:01:27:00 +0000] "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1" 404 197 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:01:29:22 +0000] "GET /install.php HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:01:29:23 +0000] "GET /admin/index.php?lang=en HTTP/1.1" 303 1483 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:01:29:23 +0000] "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1" 404 197 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:01:29:23 +0000] "GET /admin/index.php?lang=en HTTP/1.1" 303 1483 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:08:50:39 +0000] "GET /install.php HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:08:50:40 +0000] "GET /admin/index.php?lang=en HTTP/1.1" 303 1483 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:08:50:40 +0000] "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1" 404 197 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:08:50:40 +0000] "GET /admin/index.php?lang=en HTTP/1.1" 303 1483 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"
172.19.0.36 - - [29/Jan/2021:08:50:48 +0000] "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1" 404 197 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.53"


This is console result

Moodle console result

Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
Ensure you have index.php listed within the 'index' directive in your nginx configuration, reload nginx (sudo service nginx reload), and then issue sudo chmod -R 755 /var/www/moodle
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
2021/01/29 15:49:14 [error] 24820#24820: *1 open() "/var/www/moodle/admin/<a></a>" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 15:49:15 [error] 24820#24820: *1 open() "/var/www/moodle/admin/<a></a>" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 15:49:16 [error] 24820#24820: *1 open() "/var/www/moodle/favicon.ico" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /favicon.ico HTTP/1.1", host: "172.19.0.39", referrer: "http://172.19.0.39/admin/%3Ca%3E%3C/a%3E"
2021/01/29 15:49:56 [error] 24820#24820: *1 open() "/var/www/moodle/admin/<a></a>" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"
2021/01/29 15:50:49 [error] 24820#24820: *1 open() "/var/www/moodle/admin/<a></a>" failed (2: No such file or directory), client: 172.19.0.36, server: , request: "GET /admin/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39"

still got same error i even reinstall from scratch. Stuck at the same process after upgraded plugin.
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
Are you trying to install Moodle alongside other non-core plugins at the same time? I am a bit confused as to why you need to upgrade plugins.

Download the latest release (Moodle 3.10.1+) and do not add any other plugins. There should be no need to install other plugins when you first install Moodle - you can add them later - ideally individually. The best way to accomplish this is through git.

sudo apt install git
sudo chown -R $USER:$USER /var/www
sudo chmod -R 755 /var/www
cd /var/www
git clone git://git.moodle.org/moodle.git
cd moodle
git branch --track MOODLE_310_STABLE origin/MOODLE_310_STABLE
git checkout MOODLE_310_STABLE

Alternatively, get from here: https://download.moodle.org/releases/latest/

You can also run the installer on the command line. I must confess I am a bit unfamiliar with the web installer because I don't use it. 

sudo chown -R $USER:$USER /var/www
sudo chmod -R 755 /var/www
sudo mkdir -p /var/moodledata
sudo chown -R $USER:$USER /var/moodledata
sudo chmod -R 777 /var/moodledata
rm -rf /var/moodledata/*
php /var/www/moodle/admin/cli/install.php
Matt T への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
If you do elect to use the web installer again, you will instead want:

sudo chown -R www-data:www-data /var/www
sudo chmod -R 755 /var/www
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
I tried cmd installation i can access first page of moodle now but after i try to login i found 404 error again

Error log from nginx

2021/02/01 03:48:47 [error] 38167#38167: *2 open() "/var/www/moodle/login/" failed (2: No such file or directory), client: 192.168.220.32, server: , request: "GET /login/%3Ca%3E%3C/a%3E HTTP/1.1", host: "172.19.0.39", referrer: "http://172.19.0.39/login/index.php"
2021/02/01 03:48:47 [error] 38167#38167: *2 open() "/var/www/moodle/favicon.ico" failed (2: No such file or directory), client: 192.168.220.32, server: , request: "GET /favicon.ico HTTP/1.1", host: "172.19.0.39", referrer: "http://172.19.0.39/login/%3Ca%3E%3C/a%3E"

URL Pattern: "http://172.19.0.39/login/<a></a>;"

i found index.php file in login directory of moodle. 
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
I must say I am quite confused.

Can you please try clearing your browser cache and visiting admin/index.php directly. Also try incognito mode with no browser extensions. Disable any antivirus web filtering too.
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
Thanks for helping me Matt.
Incognito mode is also not working i will try asking nginx guy about this url redirection problem because every time there're error they will end up in that strange url with "<a></a>" .
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
Are PHP version happening to be the problem? i using PHP-FPM7.4
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
That PHP version is fine.

By nginx guy - do you mean to say someone else manages nginx for you? Or are you paying nginx for support?

There's a chance other nginx configuration is interfering with Moodle.

I'm at a dead end diagnosing this. The only thing I can offer you is that you can zip your full nginx configuration and code directory (including config.php) and send it to me using the email address on my profile here. I will try installing it on a fresh Ubuntu 20.04 VM.

Do not include any confidential information if you do this.
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
Thanks, i can send zip file to you because its not in production environment yet.

I means i will ask on NGINX forum if anyone of them ever try moodle and got some working configuration for me.
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Matt T の投稿

I have received your nginx configuration and wwwroot by email.

I'm still looking at it, but one obvious issue that jumps out at me is that you haven't defined an index page in your nginx server block. Add a line as follows and reload nginx.


Matt T への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
I installed Moodle with your nginx configuration, and wwwdata, following your configuration almost exactly.

I noticed that you did add an index directive within the http block in nginx.conf, so that is not the issue. The install ran fine. I did not encounter is a redirect to <a></a>. I have absolutely no idea what is causing that.

I suggest using a different PC to install Moodle and starting with a fresh Ubuntu 20.04 server install.
Matt T への返信

Re: moodle 3.10 installation problem

- Panupong Prueksa の投稿
I didn't installing any plugin its like installing script upgrading something likes Database or core plugin after it checking if all php extension is there.
And i using git to get fresh 3.10 moodle from respository

I might try your suggestion with cmd installation.
Panupong Prueksa への返信

Re: moodle 3.10 installation problem

- Hallan Franco の投稿

Hello ภาณุพงศ์ ปรึกษา


How are you? you get the solution?

 i'm getting the same problem. i installed moodle on linux AMI server on AWS Server, using  MariaDB but after the instalation the redirect of admin page go to 

https://mydomain.com/admin/<a></a>;

I was trying to edit the .htaccess to check, a got some progress, but still isn't working

添付 url.png
Hallan Franco への返信

Re: moodle 3.10 installation problem

- Ken Task の投稿
画像 Particularly helpful Moodlers

This thread appears to be mostly about config of nginx.   If you do a curl -I https://yoursite/ the response shows you are running:

Server: Apache/2.4.46 () OpenSSL/1.0.2k-fips
X-Powered-By: PHP/7.4.15

OpenSSL/1.0.2k-fips usually indicates a RedHat Family OS ... CentOS?

The last step in install is to set up admin user.   Did you get that far?

Also ... .htaccess???!!!  what for?   trying a redirect to get to the admin user setup?

'SoS', Ken

Hallan Franco への返信

Re: moodle 3.10 installation problem

- Matt T の投稿
This issue can be caused by an invalid character being present in the site URL. Can you check your site URL in config.php and make sure it is properly encoded, and does not contain, for example, a space or an invisible character.

Try deleting the entire $CFG->wwwroot line in config.php, and add a new line, and type it into the text editor rather than copying and pasting it.