将Moodle站点从Ubuntu迁移到REHL 7

时间:2016-09-14 11:23:18

标签: php apache ubuntu redhat moodle

我们正在尝试将当前的Moodle 2.9.1安装从我们的Ubuntu服务器迁移到新的REHL 7

我们采取了以下步骤:

  1. 复制目录
  2.   

    OLD- /无功/网络/ moodledata                    新 - /数据/网络/ moodledata

         

    old- / var / www / html / moodle

         

    新建 - /数据/ WWW / HTML /的moodle

    1. 制作了MySQL-Dump数据库。
    2. 使用与Ubuntu相同的Apache配置
    3. 我们从旧redirecthttp://moodlesite.com制作了https://moodlesite.com并获得了:

        

      检测到错误的访问权限,只能通过访问此服务器   http://moodlesite.com地址,抱歉。请通知   服务器管理员。

      然后按照以下步骤操作:

      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
      ***************************************************************
      

      得到HTTP Error 500,检查了Apache权限:

      [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
      

      但错误仍然存​​在。

      我们错过了什么?

1 个答案:

答案 0 :(得分:0)

您是否更改了wwwroot中的config.php值?

$CFG->wwwroot   = 'https://moodlesite.com';

您是否也将数据文件夹从旧服务器复制到新服务器?

$CFG->dataroot  = '/moodle/data/folder';

迁移说明 - https://docs.moodle.org/29/en/Moodle_migration

相关问题