1

尝试借助可视化编辑器编辑页面时出现以下错误(以前还没有工作):

Error loading data from server: apierror-visualeditor-docserver-http-error: (curl error: 28) Timeout was reached. Would you like to retry?

我认为以上是端口问题,因为在执行命令时,由于某种奇怪的原因无法访问端口 8142:

curl -L http://40.68.204.191:8142

并收到以下回复:

curl: (7) Failed to connect to 40.68.204.191 port 8142: Connection timed out

我通过执行以下操作安装了可视化编辑器扩展:

  1. ExtensionDistributor页面下载 VisualEditor。获取代码后,我将其保存到/opt/bitnami/apps/mediawiki/htdocs/extensions/VisualEditor我的 wiki 目录中。

    我已经安装了 1.32 版(最新稳定的 MediaWiki)

  2. 我已经按照安装说明安装了 Parsoid,安装说明可以在这里找到:https ://www.mediawiki.org/wiki/Parsoid/Setup

  3. 我已将以下代码添加到我的 LocalSettings.php 文件中:

    wfLoadExtension( 'VisualEditor' );
    

    和 

    ##### VisualEditor Config #####
    
    // Enable by default for everybody
    
    $wgDefaultUserOptions['visualeditor-enable'] = 1;
    
    // Optional: Set VisualEditor as the default for anonymous users
    
    // otherwise they will have to switch to VE
    
    $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
    
    // Don't allow users to disable it
    
    $wgHiddenPrefs[] = 'visualeditor-enable';
    
    // OPTIONAL: Enable VisualEditor's experimental code features
    
    #$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
    
    $wgVirtualRestConfig['modules']['parsoid'] = array(
    
        // URL to the Parsoid instance
    
        // Use port 8142 if you use the Debian package
    
        'url' => 'http://40.68.204.191:8142',
    
        // Parsoid "domain", see below (optional)
    
        'domain' => '40.68.204.191',
    
        // Parsoid "prefix", see below (optional)
    
        'prefix' => '40.68.204.191'
    
    );
    
  4. 我已经更改了 config.yaml 文件(用于 Parsoid 配置)中的 2 行代码,这些代码可以在我的虚拟机上的“/etc/mediawiki/parsoid”文件夹中找到:

    # Configure Parsoid to point to your MediaWiki instances.
    
            mwApis:
    
            - # This is the only required parameter,
    
              # the URL of you MediaWiki API endpoint.
    
             
    
              #  uri: 'http://localhost/api.php'
    
              uri: 'http://40.68.204.191/w/api.php'
    
              # before >>  uri: 'http://localhost/w/api.php'
    
              # The "domain" is used for communication with Visual Editor
    
              # and RESTBase.  It defaults to the hostname portion of
    
              # the `uri` property below, but you can manually set it
    
              # to an arbitrary string.
    
             
    
              # domain: 'localhost'  # optional
    
              domain: '40.68.204.191'  # optional
    
              # before >> domain: 'localhost'  # optional
    
  5. 我还在文件夹SELINUX=permissive内的 semanage.conf 文件的末尾添加了/etc/selinux

我已按照以下说明安装 Parsoid 和 VisualEditor:

https://www.mediawiki.org/wiki/Parsoid/Setup

https://www.mediawiki.org/wiki/Extension:VisualEditor

VisualEditor 和 Parsoid 是我在 MediaWiki 上安装的新扩展。

下图包含我在尝试使用 VisualEditor 时在我的 wiki 上显示的错误: 在此处输入图像描述

下面显示了尝试导航到后的 Chrome 错误http://40.68.204.191:8142/

在此处输入图像描述

下面显示了我w/api.php在 Google Chrome 中导航后的结果: 在此处输入图像描述

下面显示了尝试导航到后的 Chrome 错误http://40.68.204.191:8000/在此处输入图像描述

执行命令后显示以下内容netstat -plantu在此处输入图像描述

我试过这个:sudo lsof -i -n -P | grep LISTEN结果是这样的: 在此处输入图像描述

以下内容包含在/var/log/parsoid/parsoid.log

{"name":"parsoid","hostname":"MediaWiki","pid":20623,"level":30,"levelPath":"info/service-runner","msg":"master(20623) initializing 1 workers","time":"2019-02-11T17:17:27.490Z","v":0}

{"name":"parsoid","hostname":"MediaWiki","pid":20644,"level":60,"moduleName":"../src/lib/index.js","levelPath": "fatal/service-runner/worker","msg":"意外令牌 {","time":"2019-02-11T17:17:29.061Z","v":0} {"name":"parsoid ","hostname":"MediaWiki","pid":20623,"level":40,"message":"第一个工人在启动过程中死亡,继续启动","worker_pid":20644,"exit_code":1," startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"第一个 worker 在启动过程中死亡,继续启动","time":"2019-02-11T17:17:30.091Z" “v”:0} 杀死 {"name":"parsoid","hostname":"MediaWiki","pid":22289,"level":30,"levelPath":"info/service-runner","msg":"master (22289) 初始化 1 个工作人员","time":"2019-02-11T17:43:47.240Z","v":0} {"name":"parsoid","hostname":"MediaWiki","pid ":22298,"level":60,"moduleName":"../src/lib/index.js","levelPath":"fatal/service-runner/worker","msg":"Unexpected token {" ,"时间":"2019-02-11T17:43:48.803Z","v":0} {"name":"parsoid","hostname":"MediaWiki","pid":22289,"level" :40,"消息":"第一个工人在启动期间死亡,继续启动","worker_pid":22298,"exit_code":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"第一个工人死亡在启动过程中,继续启动","time":"2019-02-11T17:43:49.815Z","v":0} Killed {"name":"parsoid","hostname":"MediaWiki","pid ":14815,"level":30,"levelPath":"info/service-runner","msg":"master(14815) 初始化 1 个 worker","time":"2019-02-14T20:49:48.472 Z","v":0} {"name":"parsoid","hostname":"MediaWiki","pid":14829,"level":60,"moduleName":"../src/lib/ index.js","levelPath":"fatal/service-runner/worker","msg":"意外令牌 {","time":"2019-02-14T20:49:50.113Z","v":0} {"name" :"parsoid","hostname":"MediaWiki","pid":14815,"level":40,"message":"第一个工人在启动期间死亡,继续启动","worker_pid":14829,"exit_code": 1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"第一个worker在启动过程中死亡,继续启动","time":"2019-02-14T20:49: 51.131Z","v":0}name":"parsoid","hostname":"MediaWiki","pid":14815,"level":40,"message":"第一个worker在启动过程中死亡,继续启动","worker_pid":14829,"exit_code ":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"first worker 在启动过程中死亡,继续启动","time":"2019-02-14T20: 49:51.131Z","v":0}name":"parsoid","hostname":"MediaWiki","pid":14815,"level":40,"message":"第一个worker在启动过程中死亡,继续启动","worker_pid":14829,"exit_code ":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"first worker 在启动过程中死亡,继续启动","time":"2019-02-14T20: 49:51.131Z","v":0}第一个工人在启动期间死亡,继续启动","time":"2019-02-14T20:49:51.131Z","v":0}第一个工人在启动期间死亡,继续启动","time":"2019-02-14T20:49:51.131Z","v":0}

4

1 回答 1

1

您的节点应该是版本 6 或更高版本才能运行Parsoid 0.9.0,以检查此运行:

node -v

如果它不是至少版本 6 尝试更新节点,您应该可以通过以下方式执行此操作:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

尝试将地址更改Config.yamlLocalSettings.phplocalhost

如果您HTTP:401按照此处的说明进行操作

于 2019-02-14T21:49:40.757 回答