首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MediaWiki 1.35 parsoid超时尝试使用VisualEditor

MediaWiki 1.35 parsoid超时尝试使用VisualEditor
EN

Stack Overflow用户
提问于 2020-10-19 20:37:19
回答 2查看 2.2K关注 0票数 0

我已经在亚马逊的ec2服务器上安装了mediawiki。

服务器只有apache、php、mariadb和mediawiki。

我使用mediawiki 1.35,与捆绑的VisualEditor和ParsoidPHP一起使用

我可以使用VisualEditor编辑一个新页面,但是它不会保存,当我编辑一个现有的页面时,我会得到蓝色进度栏,后面跟着错误:

错误与Parsoid/RESTBase服务器联系:(curl错误: 28)超时已到达

我尝试使用我在网上找到的指令配置parsoid:

代码语言:javascript
复制
$wgVirtualRestConfig['modules']['parsoid'] = [
        // URL to the Parsoid instance - use port 8142 if you use the Debian package - the parameter 'URL' was first used but is now deprecated (string)
        'url' => 'http://myIpAddress:8000',
        // Parsoid "domain" (string, optional) - MediaWiki >= 1.26
        'domain' => 'myIpAddress',
        // Parsoid "prefix" (string, optional) - deprecated since MediaWiki 1.26, use 'domain'
        'prefix' => 'myIpAddress',
        // Forward cookies in the case of private wikis (string or false, optional)
        'forwardCookies' => true,
        // request timeout in seconds (integer or null, optional)
        'timeout' => null,
        // Parsoid HTTP proxy (string or null, optional)
        'HTTPProxy' => null,
        // whether to parse URL as if they were meant for RESTBase (boolean or null, optional)
        'restbaseCompat' => null,
];

我得到的最佳效果是404,或400。此配置不起作用。

我没有对设置做任何其他更改。

如果我直接打电话给parsoid:

页面

我看到了这样的超时:

代码语言:javascript
复制
{
    "error": {
        "code": "apierror-visualeditor-docserver-http-error",
        "info": "Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached",
        "*": "See http://MyIpAddress/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    }
}
EN

回答 2

Stack Overflow用户

发布于 2020-10-20 20:56:49

根据我的测试,parsoid似乎正在使用$wgServer变量与rest.php进行本地连接。

使用curl,我可以连接到页面

但是,对于页面页面来说,这两种超时都不是。apache服务器无法连接到自身

所以,理论上,我应该可以

代码语言:javascript
复制
$wgVirtualRestConfig['modules']['parsoid']['domain']='localhost';

但结果是404,而不是超时。

最后,我将我的域名添加到/etc/host中,并将其指向127.0.0.1,这很好。这感觉像一个黑客,我必须使用一个域名,而不仅仅是一个iP。

票数 1
EN

Stack Overflow用户

发布于 2021-07-09 12:38:19

这个问题我们碰到过好几次了。

在一种情况下,这是一个访问控制问题。

Parsoid向MediaWiki站点发出HTTP请求。我们使用禁闭延伸限制对某些操作的访问,我们必须对Parsoid进行豁免,这可以通过几种方式实现,例如:

代码语言:javascript
复制
if (($_SERVER['REMOTE_ADDR'] !== '127.0.0.1') && ($_SERVER['REMOTE_ADDR'] !== $_
SERVER['SERVER_ADDR'])) {
# don't lock down any pages for Parsoid, or the VisualEditor will break on them
    wfLoadExtension('Lockdown');
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64434855

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档