We are trying to migrate our current Moodle 2.9.1
installation from our Ubuntu
server to the new REHL 7
.
We took the following steps:
- Copied the directories
old-/var/www/moodledata new-/data/www/moodledata
old-/var/www/html/moodle
new-/data/www/html/moodle
We made an redirect
from the old http://moodlesite.com
to https://moodlesite.com
and got:
Incorrect access detected, this server may be accessed only through
http://moodlesite.com
address, sorry. Please notify server administrator.
Then followed these steps:
Change the following file: /home/xxxxxx/public_html/moodle/lib/setuplib.php
Change - setuplib.php
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 3);
for
Redirect ($CFG->wwwroot, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 0);
Now when you access the link, Moodle redirects immediately to the www.<your registered domain> without the warning message.
Another solution is to make changes in .htaccess file
***************************************************************
suphp_configpath /home/myroot/public_html/php.ini
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^www.domainname.com [nc]
rewriterule ^(.*)$ http://domainname.com/$1 [r=301,nc]
i.e. replace the myhost.com with your domain name
***************************************************************
...and got HTTP Error 500
, checked the Apache permissions:
[root@srv24 html]# pwd
/data/www/html
[root@srv24 html]# chown -R apache:apache moodle/
[root@srv24 html]# chown -R apache:apache ../moodledata/
[root@srv24 html]# chmod -R 755 moodle/
[root@srv24 html]# chmod -R 755 ../moodledata/
[root@srv24 html]# systemctl restart httpd.service
[root@srv24 html]# apachectl configtest
Syntax OK
But the error still remains.
What have we missed?