Can not create password new install editadvanced.php

Can not create password new install editadvanced.php

by Phillip Phan -
Number of replies: 21

I am first time installing Moodler, I tried to look for the same situation but I could not found.

When I passed some steps before to the link .../user/editadvanced.php?id=2 to create infomation of admin but the password field is not appear. I clicked to the link Click to enter text  then nothing happened and the checkbox force to change password is not available to tick.

Before this step I was stuck in the step bellow then I turn off proxy mode in DNS of Cloudflare then It moved to the step above.

https://docs.moodle.org/400/en/error/admin/installhijacked

I am using Centos, OPcache PHP 7.3.33, Nginx. Domain using Cloudflare NS. I use http on my subdomain.

My browser allow cookies and turn on popup.

Does any could help, please tell me this problem. Thanks alot!



Average of ratings: -
In reply to Phillip Phan

Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers

Sounds like an issue with the protections of CloudFlare making it difficult (if not impossible) to do install via GUI.

So, do you have command line access (either ssh client or via Terminal of a panel your server is running)?

Reason asked ... one can install a moodle via command line which will prompt for the very same things the GUI does and actually bypass the security feature of protecting the password box for the admin user.

'SoS',Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Can not create password new install editadvanced.php

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Nginx configuration is also a possible cause. See https://docs.moodle.org/en/Nginx. Or the dreaded "slasharguments" https://moodle.org/mod/forum/discuss.php?d=438185#p1763855.

Have fun!
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Can not create password new install editadvanced.php

by Phillip Phan -
Thanks Visvanath Ratnaweera !

Should I change to Apache, other or Nginx could works with Moodle?!
In reply to Phillip Phan

Re: Can not create password new install editadvanced.php

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators

No! You should configure Nginx properly, if that is the problem. The link I provided says how to do it. It worked more than once for me.

In reply to Visvanath Ratnaweera

Re: Can not create password new install editadvanced.php

by Phillip Phan -
Ok thanks you Sir!

I acctually have read the the link when you referred but not really undestand all. I must read the link again carefully.
In reply to Ken Task

Trả lời: Re: Can not create password new install editadvanced.php

by Phillip Phan -
@Ken Task

Thanks you for your reply!

I cant access ssh to type command but I dont know what command exactly to do. Do I need to delete Moodle files and Database then install from scratch through ssh command or continue to sovle the problem? Could you please tell me what command lines to type?
In reply to Phillip Phan

Re: Trả lời: Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers
First, make sure your environment can find php-cli.
ssh into server and at whatever prompt type:
whereis php
That will show a path.   Let's say that shows /usr/bin/php.

use that path to php to see if that's php-cli (commandline PHP)
/usr/bin/php -v
IF you see a (cli) in output of version, we are good to go.

Now 
cd /path/to/moodlecode/admin/cli/

I don't know what /path/to/moodlecode/ is on your system so you adjust that portion of the cd command ... but it does end with /admin/cli/

To check where you are: pwd [ENTER]
Are you in moodlecode/admin/cli/

If so then type:

php ./install.php [ENTER]

Follow the prompts ... make sure you type then correctly and jot your entries down on paper as well..   Password will probably require 1 cap, 1 number, and 1 non-alphanumeric character so make one up that meets that requirement and write it down on *paper*.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Phillip Phan -
I did these commands and the asswer is bellow, it is right to continue for this command "cd /path/to/moodlecode/admin/cli/" and where can I fint the moodlecode in my server?!

whereis php

php: /usr/bin/php /usr/lib64/php /etc/php.d /etc/php.ini /usr/share/php /usr/share/man/man1/php.1.gz

/usr/bin/php -v

PHP 7.3.33 (cli) (built: Jun 7 2022 08:55:57) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.33, Copyright (c) 1999-2018, by Zend Technologies
In reply to Phillip Phan

Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers

"where can I fint the moodlecode in my server?!"

When you log into your server are you logging in as root user? or some other user?

IF some other user, that account is probably part of sudoers group, so:

sudo -s

The password is the same password you use to log into the server.

If entered correctly, then your prompt will change to root>

Now to find your moodle code ... if centOS, it's probably in /var/www/ somewhere, so:

find /var/www/ -name moodle - would look for a directory called moodle and show the path to it.

You could also try: find /var/www/ -name index.php - that is moodle's default page ..... the first one it finds is.   There are other index.php files.

So let's say the find for index.php finds an index.php file in /var/www/html/ ... then cd /var/www/html/

See if there is a version.php file there:

ls -l version.php

if there is, then cd admin/cli/ ... now you should see an install.php file:

ls -l install.php

if you see it listed, now:

php ./install.php

'SoS', Ken


In reply to Ken Task

Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Phillip Phan -

I tried the commands but not sure that is a root user or normal user. I use ssh mode generate through the VPS provider.
Could you please take a look at my screen images.

Attachment Capture.PNG
Attachment Capture1.PNG
In reply to Phillip Phan

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers

Looks like your system shell session prompts aren't set to show user.   Soooooo ... After logging on, type: whoami

That will show if you are logged on as ...  a user or root.

Let's also find out what operating system this is:

uname -an

This one will take some time:

cd /

that takes you to the root of the file system.

then issue

find / -name index.php [ENTER]

That should find an index.php file somewhere!

Look at paths to that file ... maybe /home/public_html/ or maybe your web server has defined web server root in /opt/ ...

Really don't know with out knowing what operating system it is!!!

If web server is running it should show httpd or apache2 to the following command:

ps aux |grep httpd

or

ps aux |grep apache2

Your web server config might be  in /etc/httpd/ or /etc/apache2/

look in those to see if you can see a .conf file and cat them using |more ...

like cd /etc/httpd/conf/

then cat httpd.conf |more

|more does page and then pauses ... spacebar next page.

q to quit

Looking for 'document root' ... which will be the path to where moodle code would normally reside.

If you have the online manual installed:

man httpd

or

man apache2

might give you some clues!

Tis midnight where I am and am in need zzzzzz's.

'SoS', Ken

In reply to Ken Task

Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Phillip Phan -
You are such a kind person Sir.

Lots of detail that also help me to learn some more ssh commands.

I tried all line and the result bellow, could not find moodlecode folder or index.php as you referred.

Could you please tell me what to do next ?!

whoami --> root.
uaname --> Linux linux.8f3932.com 3.10.0 #1 SMP Tue Jan 25 12:49:12 MSK 2022 x86_64 x86_64 x86_64 GNU/Linux
find / -name index.php --> All results begin with /home/domainname.com/public_html/...
find / -name moodle --> Result moodle folder onl in /home/domainname.com/public_html/admin or lib or theme/...
ps aux | grep apache2 --> root 19317 0.0 0.0 9092 908 pts/0 S+ 19:09 0:00 grep --color=auto apache2
ps aux | grep httpd --> root 19317 0.0 0.0 9092 908 pts/0 S+ 19:09 0:00 grep --color=auto apache2
No derectory apache2 or httpd in /etc/
In reply to Phillip Phan

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers

Well, this does tell you where you script installed the code:

find / -name moodle --> Result moodle folder onl in /home/domainname.com/public_html

So

cd /home/domainname.com/public_html/moodle/

fgrep '$release' version.php

php admin/cli/install.php

I downloaded those sh scripts for installing via your method ... they were protected .sh scripts so couldn't really see what they did.

So we are looking for an 'easy button' to install a moodle on a ? Linux platform without knowing where the code is installed.  That's very trusting and, dunno for sure, but there could be an 'easter egg' in there ... ie, one starts with a hacked Moodle already!!! :|

Install is but tip of the ice burg ... once running successfully, then comes maintenance .... keeping it running and up to date.  Script for that will be PHP and inside moodle code.

Assuming you could edit those .sh script installers .. suggest doing the install with git.

https://docs.moodle.org/400/en/Git_for_Administrators

Uhhh ... no need for a TeamViewer session. smile

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Phillip Phan -
Oh, I missed this reply, so I did not know the CLI commands in this direction you replied to me.

I deleted the domain in my VPS also database connected to it and started to install from scratch.

I also realised the "path/to/moodlecode" as you referred that mean the code I download from Moodle.org and upload to the place in server not exactly the folder "moodlecode" as I thought.

I tried these directions form https://docs.moodle.org/400/en/Installing_Moodle

- Add domain to vps, it's automaticly located in default ~/home/ and it has folder ~/home/domain.com/public_html

Create new blank database.

mkdir /home/domain.com/moodledata
chmod 0777 /home/domain.com/moodledata

Then download Moodle from moodle.org to my computer and up to ~/home/domain.com/public_html through SFTP

I use CLI to unzip then move all folders and files in 'moodle' folder to ~/home/domain.com/public_html/

I delete the empty 'moodle' folder.

chown -R root /home/domain.com/public_html/
chmod -R 0755 /home/domain.com/public_html/

chown apache /home/domain.com/public_html/

cd /home/domain.com/public_html/admin/cli

sudo -u apache /usr/bin/php install.php

I type apache 2 CLI command above because my VPS set Centos with Nginx

It take 2 minutest to install, while that it ask me to put some infomation and I answer:

Database: localhost, mariadb, dabasenam, databaseUser, Password
Website address, I type a subdomain like this http://abc.domain.com (it nameservered in cloud flare that I turn off DNS proxy mode already)
Moodledata: /home/domain.com/moodledata
Email and passowrd of admin
I skiped Database port and Unix rocket because I dont know.

After the terminal tell me install successed then I did one more CLI command bellow

chown -R root /home/domain.com/public_html/

Then I go to browser to access the subdomain on the address bar, it shows me a blank page, nothing to click.

Could you please tell me what to do next or did I do something wrong installing?
In reply to Phillip Phan

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers

Just attempted to access your site.   Error 500 - which could mean a lot of things ... but basically misconfigured.

Server appears to be running nginx so check these instructions:

https://docs.moodle.org/400/en/Nginx

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
In reply to Visvanath Ratnaweera

Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Phillip Phan -
Hello Mr.Visvanath Ratnaweera

I did phpinfo.php and test.html and sent the link to you. Could you please take for a look!
In reply to Phillip Phan

Re: Can not create password new install editadvanced.php

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You can always post a screen-shot of the relevant area of yoursite/phpinfo.php. I don't welcome personal messages on moodle.org help, see my profile.

I repeat:  Please don't send me help requests nor their reminders as personal messages.
sad

Since you've moved to https://moodle.org/mod/forum/discuss.php?d=438523#p1765240. See the answer there. Please close this thread.
In reply to Phillip Phan

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers

can confirm that moodle code is in document root ... / of the nginx web server,
but in attempts to access test.html or phpinfo.php pages by IP or FQDN, renders nothing.

a curl -I http://FQDN renders a 500 internal Server error
a curl -I http://IP shows nginx welcome page.
which says:
"If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.
"

So it's nginx config.

https://docs.moodle.org/400/en/Nginx

'SoS', Ken

Average of ratings: Useful (1)
In reply to Phillip Phan

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Ken Task -
Picture of Particularly helpful Moodlers

Let's take a step back here ... you had to use some tool for browsing files on your server to get the code into position to install moodle.  Surely that tool shows location.   Go back to that tool, find location then use that location from command line in your cd command.

Still .. encourage you to learn minimal CLI with your server environment.   That knowledge will come in handy in admin of the server once you get past this issue - especially considering your site is behind cloudflare.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Trả lời: Re: Trả lời: Re: Trả lời: Re: Can not create password new install editadvanced.php

by Phillip Phan -
@Ken Task,

I set VPS through this command that load a script form hocvps.com

curl -sO https://hocvps.com/install && bash install

While setting I chose to set PHP 7.3 and Mariabd 10.3

Any suggest what I need to do?