Access Denied issue after moodle migration from Plesk to CPnael

Access Denied issue after moodle migration from Plesk to CPnael

by Mohammad Imran -
Number of replies: 6

I am using Moodle '3.5.3 (Build: 20181112)' on a Windows Server - Plesk Installation. 
Recently i wanted to move my site from plesk to cpanel. As per moodle guide, i copid my main moodle folder which was
in public directory and database script as well. My moodledata folder resided inside moodle main folder (do not know why,
i installed moodle using plesk auto module installer). In plesk it was working very well. I restored by SQL databse script in cpanel database and
after moving my moodle folder and configuring config.php with databse, databse username, moodle directories, i am still unable to access it.

Everytime i open my site, (https://www.site1111.com/moodle), i come across only one text 'Access Denied'. I have tried to delete moodle, copy again,
reconstruct database. Check config file again. All configurations are fine. But i am still unable to do that. It is just stuck with 'Access denied'.

I hope somebody could help me here on the issue.

Thanks.

Follwing is my config file contents:

<?php // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'test_moodle6';
$CFG->dbuser = 'test_moodle6';
$CFG->dbpass = '***********';
$CFG->prefix = '';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => 3306,
'dbsocket' => '',
'dbcollation' => 'utf8_general_ci',
);

$CFG->wwwroot = 'https://www.mysite1111.com/moodle';
$CFG->dataroot = '/home/mycpaneluserfolder/public_html/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 0777;

require_once(__DIR__ . '/lib/setup.php');



Average of ratings: -
In reply to Mohammad Imran

Re: Access Denied issue after moodle migration from Plesk to CPnael

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If that's your real URL - then it's not "access denied" it's a DNS error.

Failing that, "access denied" would imply a configuration error in your web server or a permissions problem (the web server can't read the Moodle files). Neither is a Moodle error as such. It might be quicker to ask your host's support.
In reply to Howard Miller

Re: Access Denied issue after moodle migration from Plesk to CPnael

by Mohammad Imran -
No. It is not a real URL, it is an example URL. Consider it as example.com.
There is no DNS issue. I have Joomla on the same server, working fine. New installation of moodle is also working fine. Even though the current moodle that is not working on the web, I tried it on WAMP, it is working fine on WAMP Server. I am unable to sort out the issue it has when it is on the web.

So it is a strange issue where the problem doesn't seem to be on the host side. I suspect some permission issue. But I am unable to figure it out. If it had been a permission issue, then it would have not worked on the local server.
In reply to Mohammad Imran

Re: Access Denied issue after moodle migration from Plesk to CPnael

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Only if the configuration is *exactly* the same... implying that it isn't.
In reply to Mohammad Imran

Re: Access Denied issue after moodle migration from Plesk to CPnael

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Copy a 'test.html' file in to the moodle/ directory. It must be reachable from any browser under https://example.com/moodle/test.html.

Once that is successful do the same with an 'info.php' file. For example, see https://docs.moodle.org/en/PHP#Displaying_phpinfo_outside_of_Moodle.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Access Denied issue after moodle migration from Plesk to CPnael

by Mohammad Imran -
I did the same.
HTML is easily accessible but info.php file show 'Access denied'.

What can be the issue?