尝试借助可视化编辑器编辑页面时出现以下错误(以前还没有工作):
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
我通过执行以下操作安装了可视化编辑器扩展:
从ExtensionDistributor页面下载 VisualEditor。获取代码后,我将其保存到
/opt/bitnami/apps/mediawiki/htdocs/extensions/VisualEditor
我的 wiki 目录中。我已经安装了 1.32 版(最新稳定的 MediaWiki)
我已经按照安装说明安装了 Parsoid,安装说明可以在这里找到:https ://www.mediawiki.org/wiki/Parsoid/Setup
我已将以下代码添加到我的 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' );
我已经更改了 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
我还在文件夹
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}