安装 Web 应用程序后更改文档根目录

Change document root after installing web applications

我用 Plesk 订购了一个虚拟服务器,通过 Plesk 安装了 Moodle,并为此工作了几个月。

Moodle 的域是 www.urltomyserver.com/moodle。我想将其更改为 www.urltomyserver.com。因此,我想将我的托管设置中的文档根目录更改为该域的 httpdocs/moodle。但是这不起作用:

Unable to change document root: It is impossible to change document root because there are web applications installed on this website

我知道当我更改文档根目录时,我需要对 Moodle config.php 文件进行更改。所以我理解警告,但我仍然想更改文档根目录。这可能吗?也许直接通过 shell?

否则,我看到并且我想阻止的唯一选择是从 Moodle 进行备份,通过 Plesk 卸载应用程序,手动安装 Moodle,然后更改文档根目录。

有解决办法吗?

根据an answer on Plesk Support

In order to change the document root, the problematic application should be uninstalled.

也提到了here

应该可以通过 shell 直接更改您的 vhost.conf 或文档根目录。我认为这将是最简单的解决方案。很遗憾,我无法访问任何 Plesk 来提供说明,但您可以 try this.

我还发现了另一个 possible solution,它涉及重命名当前域并添加回域。请记住在尝试此操作之前备份您的文件和数据库。

最后的手段是您建议的解决方案。祝你好运!