RiESA
V2EX  ›  问与答

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

  •  
  •   RiESA · May 8, 2018 · 5461 views
  •   You need to sign in to view this topic
    This topic created in 3130 days ago, the information mentioned may be changed or developed.

    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 replies  •  2018-05-09 22:09:52 +08:00
    RiESA
    RiESA
    OP
    May 9, 2018
    2
    @AaronLee 感谢感谢,终于有人回复了,MW 相关的资料太难找了

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

    另外可以问一下您使用的 WM 具体版本是多少吗?
    AaronLee
    AaronLee
    May 9, 2018 via Android❤️1
    3
    Mediawiki1.27 ,1.30 都用过,我是在虚拟机中安装 Ubuntu16.04 ,部署 Heroku 运行环境,用 git 将软件克隆下来,修改,部署到 Heroku
    RiESA
    RiESA
    OP
    May 9, 2018
    4
    @AaronLee 部署了好几次 Heroku ,打开一直是 Application error,您有遇到过类似的情况吗?
    AaronLee
    AaronLee
    May 9, 2018 via Android❤️1
    5
    我没有遇到过,你用的是什么系统?
    RiESA
    RiESA
    OP
    May 9, 2018
    6
    @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
    AaronLee
    May 9, 2018❤️1
    7
    'url' => 'https://pacific-sierra-54198.herokuapp.com',
    改成 'url' => 'pacific-sierra-54198.herokuapp.com',
    'prefix' => 'fgo,少个引号,改成'prefix' => '你网站的域名‘, 不要带 https://
    RiESA
    RiESA
    OP
    May 9, 2018
    8
    @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
    AaronLee
    May 9, 2018 via Android❤️1
    9
    在部署到 Heroku 之前,你需要用 git 克隆下来,
    1,打开你 git 的软件的文件,选择显示隐藏的文件,修改
    2,将你网站的域名添加到 config.yaml
    建议你认真阅读发的那个教程
    AaronLee
    AaronLee
    May 9, 2018 via Android
    10
    我只用 1.27 和 1.30 版本试过,
    RiESA
    RiESA
    OP
    May 9, 2018
    11
    @AaronLee 感谢一直以来的解答,多次尝试之后依然无法正常使用

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

    看到了这个链接

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

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

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

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

    PS:拉到最下面有看到一句中文,而且还是近期的,哈哈哈,看来不是我一个人遇到这么坑爹的事情
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2431 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 11:48 · PVG 19:48 · LAX 03:48 · JFK 06:48
    ♥ Do have faith in what you're doing.