尝试通过可视化编辑器编辑页面时出现以下错误消息(该代码以前无法使用):
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
我通过执行以下操作安装了VisualEditor扩展:
从ExtensionDistributor页下载VisualEditor。获取代码后,我将其保存到了Wiki的/opt/bitnami/apps/mediawiki/htdocs/extensions/VisualEditor
目录中。
我已经安装了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配置)中的两行代码,这些代码位于我的虚拟机上的“ / 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上显示的错误:
以下显示了尝试导航到http://40.68.204.191:8142/
后的Chrome错误:
下面显示了我在Google Chrome浏览器中导航到w/api.php
后的结果:
以下显示了尝试导航到http://40.68.204.191:8000/
后的Chrome错误:
enter image description here
执行命令netstat -plantu
后,显示以下内容:
enter image description here
我尝试了这个:sudo lsof -i -n -P | grep LISTEN
,得到的结果是:
enter image description here
以下内容包含在/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“:”致命的/服务运行者/工人“,” msg“:”意外的令牌{“,”时间“:” 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”:“第一个工作程序在启动过程中死亡,继续启动”,“时间”:“ 2019-02- 11T17:17:30.091Z“,” v“:0} 被杀 {“ name”:“ parsoid”,“ hostname”:“ MediaWiki”,“ pid”:22289,“ level”:30,“ levelPath”:“ info / service-runner”,“ msg”:“ master(22289)正在初始化1个工人“,”时间“:” 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”:“意外令牌{”,“ time”:“ 2019-02-11T17:43:48.803Z”,“ v”:0} {“ name”:“ parsoid”,“ hostname”:“ MediaWiki”,“ pid”:22289,“ level”:40,“ message”:“第一个工作人员在启动过程中死亡,继续启动”,“ worker_pid”:22298, “ exit_code”:1,“ startup_attempt”:1,“ levelPath”:“ warn / service-runner / master”,“ msg”:“第一个工作程序在启动过程中死亡,继续启动”,“时间”:“ 2019-02- 11T17:43:49.815Z“,” v“:0} 被杀 {“ name”:“ parsoid”,“ hostname”:“ MediaWiki”,“ pid”:14815,“ level”:30,“ levelPath”:“ info / service-runner”,“ msg”:“ master(14815)正在初始化1个工作人员“,”时间“:” 2019-02-14T20:49:48.472Z“,” 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”:“第一个工作程序在启动过程中死亡,继续启动”,“时间”:“ 2019-02- 14T20:49:51.131Z“,” v“:0}
答案 0 :(得分:0)
您的节点应为6或更高版本才能运行Parsoid 0.9.0
,以检查此运行:
node -v
如果它至少不是版本6,请尝试更新节点,您应该可以执行以下操作:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
尝试将Config.yaml
和LocalSettings.php
中的地址更改为localhost
如果您收到HTTP:401
,请按照说明here