MediaWiki 安装 VisualEditor,编辑器和 parsoid 无法连接求助 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
RiESA

MediaWiki 安装 VisualEditor,编辑器和 parsoid 无法连接求助

  •  
  •   RiESA 2018 年 5 月 8 日 5039 次点击
    这是一个创建于 2909 天前的主题,其中的信息可能已经有所发展或是发生改变。

    CentOS7 8000 端口已经打开

    SELINUX 也是关闭状态

    MediaWiki 版本 1.29.2

    访问 http://wiki.riesa.me:8000/

    可以显示 parsoid 正在运行,但是使用编辑器会出现 404 及 curl error 7 这两个错误

    下面附上相关配置文件的片段,不知道有没有熟悉 MW 的大佬看看是什么情况,昨晚通宵折腾到现在了

    LocalSettings.php:

    require_once "$IP/extensions/VisualEditor/VisualEditor.php";

    $wgDefaultUserOptions['visualeditor-enable'] = 1;

    $wgVisualEditorNamespaces=array_merge($wgContentNamespaces,array( NS_USER ));

    localsettings.js:

    'use strict';

    exports.setup = function(parsoidConfig) {

     parsoidConfig.setMwApi('fgo', { uri: 'http://wiki.riesa.me/api.php' }); 

    };

    config.yaml:

    mwApis: - # This is the only required parameter,

     # the URL of you MediaWiki API endpoint. uri: 'http://wiki.riesa.me/api.php' # The "domain" is used for communication with Visual Editor # and RESTBase. It defaults to the hostname portion of # the `uri` property above, but you can manually set it # to an arbitrary string. It must match the "domain" set # in $wgVirtualRestConfig. domain: 'wiki.riesa.me' # optional # To specify a proxy (or proxy headers) specific to this prefix # (which overrides defaultAPIProxyURI). Alternatively, set `proxy` # to `null` to override and force no proxying when a default proxy # has been set. #proxy: # uri: 'http://my.proxy:1234/' # headers: # optional # 'X-Forwarded-Proto': 'https' # See below, defaults to true. #strictSSL: false 
    11 条回复    2018-05-09 22:09:52 +08:00
    AaronLee
        1
    AaronLee  
       2018 年 5 月 9 日 via Android   1
    RiESA
        2
    RiESA  
    OP
       2018 年 5 月 9 日
    @AaronLee 感谢感谢,终于有人回复了,MW 相关的资料太难找了

    看了一下您发的链接,好像是比我之前看的文章多了一个 Heroku 的步骤,但是英文文档比较难理解,不过我今天会再努力试一下看看的,如果您有时间给予适当指导就就更好了

    另外可以问一下您使用的 WM 具体版本是多少吗?
    AaronLee
        3
    AaronLee  
       2018 年 5 月 9 日 via Android   1
    Mediawiki1.27 ,1.30 都用过,我是在虚拟机中安装 Ubuntu16.04 ,部署 Heroku 运行环境,用 git 将软件克隆下来,修改,部署到 Heroku
    RiESA
        4
    RiESA  
    OP
       2018 年 5 月 9 日
    @AaronLee 部署了好几次 Heroku ,打开一直是 Application error,您有遇到过类似的情况吗?
    AaronLee
        5
    AaronLee &nsp;
       2018 年 5 月 9 日 via Android   1
    我没有遇到过,你用的是什么系统?
    RiESA
        6
    RiESA  
    OP
       2018 年 5 月 9 日
    @AaronLee

    wiki 网站是运行在 CentOS 7 x64 上的

    使用自己搭建的 parsoid 和 Heroku 的,都无法连接成功,出现 404 错误

    https://pacific-sierra-54198.herokuapp.com

    parsoid 我感觉是正常的,问题在于 VisualEditor 无法连接上去,附上 LocalSettings.php 配置内容,您过目一下有没有错误的地方



    wfLoadExtension( 'VisualEditor' );


    $wgDefaultUserOptions['visualeditor-enable'] = 1;


    // $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";


    $wgHiddenPrefs[] = 'visualeditor-enable';


    #$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;

    $wgVirtualRestConfig['modules']['parsoid'] = array(

    'url' => 'https://pacific-sierra-54198.herokuapp.com',

    'domain' => 'localhost',

    'prefix' => 'fgo,

    'forwardCookies' => true
    );
    AaronLee
        7
    AaronLee  
       2018 年 5 月 9 日   1
    'url' => 'https://pacific-sierra-54198.herokuapp.com',
    改成 'url' => 'pacific-sierra-54198.herokuapp.com',
    'prefix' => 'fgo,少个引号,改成'prefix' => '你网站的域名‘, 不要带 https://
    RiESA
        8
    RiESA  
    OP
       2018 年 5 月 9 日
    @AaronLee

    // Parsoid configuration

    $wgVirtualRestConfig['modules']['parsoid'] = array(

    // URL to the Parsoid instance

    // Use port 8142 if you use the Debian package

    // url must not end in a slash, otherwise it might give a 404 error

    'url' => 'pacific-sierra-54198.herokuapp.com',

    // Parsoid "domain", see below (optional)

    'domain' => 'localhost',

    // Parsoid "prefix", see below (optional)

    'prefix' => 'wiki.riesa.me',

    //If you run a private wiki then you have to set the following variable to true:

    'forwardCookies' => true

    );


    难过,逐字检查后再试了一次,还是 GG 了

    从服务器加载数据时出错:apierror-visualeditor-docserver-http: HTTP 406。想要重试吗?

    点击重试后变成

    从服务器加载数据时出错:oldidnotfound: There is no revision with ID 0.。想要重试吗?


    会不会和 config.yaml 有关呢,parsoid 的打算先不动了,打算建个 1.30 的版本排查一下是不是版本原因
    AaronLee
        9
    AaronLee  
       2018 年 5 月 9 日 via Android   1
    在部署到 Heroku 之前,你需要用 git 克隆下来,
    1,打开你 git 的软件的文件,选择显示隐藏的文件,修改
    2,将你网站的域名添加到 config.yaml
    建议你认真阅读发的那个教程
    AaronLee
        10
    AaronLee  
       2018 年 5 月 9 日 via Android
    我只用 1.27 和 1.30 版本试过,
    RiESA
        11
    RiESA  
    OP
       2018 年 5 月 9 日
    @AaronLee 感谢一直以来的解答,多次尝试之后依然无法正常使用

    正当我准备放弃将这几个通宵的努力化为泡影的时候

    看到了这个链接

    https://www.mediawiki.org/wiki/Topic:Ua42lnptxq4056ki

    按其中的一个回复操作,将 parsoid 内 lib/config/ParsoidConfig.js

    ParsoidConfig.prototype.strictAcceptCheck 这一值设置成 false 后成功运行了

    终于也是处理好了,同样也感谢您一直以来的耐心

    PS:拉到最下面有看到一句中文,而且还是近期的,哈哈哈,看来不是我一个人遇到这么坑爹的事情
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2965 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 46ms UTC 03:07 PVG 11:07 LAX 20:07 JFK 23:07
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86