Hello,
I am trying to install Parsoid in order to use the https://github.com/kiwix/mwoffliner script for dumping my MediaWiki for offline usage in http://www.kiwix.org/ first. Using the Visual Editor would be also nice later.
The mediawiki is running inside an intranet at http://172.18.200.40/himtwiki/, I have disabled short URLs for now, it is a private wiki.
$wgGroupPermissions['*' ]['read'] = false;
- The system is running on openSUSE 13.1 (Bottle) (x86_64).
- MediaWiki: 1.25
- Parsoid: 0.6.1 / 2016-11-14
- NodeJS: v4.2.4
- I followed the steps from Parsoid/Developer Setup
- Parsoid resides in
/root/parsoid/
for testing now - Created
config.yaml
as following:
# Configure Parsoid to point to your MediaWiki instances.
mwApis:
- # This is the only required parameter,
# the URL of you MediaWiki API endpoint.
uri: 'http://172.18.200.40/himtwiki/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
prefix: 'localhost'
- Service is running
node bin/server.js
- Update: Command line output added
{"name":"parsoid","hostname":"server223","pid":793,"level":30,"levelPath":"info/service-runner","msg":"master(793) initializing 4 workers","time":"2017-02-07T13:08:11.107Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":802,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:11.858Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":802,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:11.879Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":807,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:12.637Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":807,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:12.656Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":812,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:13.403Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":812,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:13.422Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":817,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:14.171Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":817,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:14.189Z","v":0}
{"name":"parsoid","hostname":"server223","pid":793,"level":40,"levelPath":"warn/service-runner","msg":"Startup finished","time":"2017-02-07T13:08:14.190Z","v":0}
- Then I am following https://www.mediawiki.org/wiki/Parsoid/Troubleshooting
- http://172.18.200.40:8000/ shows the welcome page
- http://172.18.200.40:8000/localhost/v3/page/html/Main_Page/ shows the correct Main Page output
- However, http://172.18.200.40:8000/_wikitext/ and http://172.18.200.40:8000/_wikitext/localhost show errors
Cannot GET /_wikitext
andCannot GET /_wikitext/localhost
respectively.
- Question: how can I get a log file from Parsoid?
Visual Editor
- I have also went through the Visual Editor installation, which is not working,
I get the button.Edit source
for editing only (Visual Editor is actually enabled in the user preferences)- Update:
$wgVisualEditorNamespaces = array(NS_MAIN, NS_USER);
was missing in my LocalSettings.php, now I can try to edit existing pages the Visual Editor, but it fails withError loading data from server: 404: parsoidserver-http: HTTP 404
, now I am looking at other users´ issues with the same error, but nothing has helped so far.
- Update:
- Question: I could not really figure out, whether I really need Extension:UniversalLanguageSelector? This one fails to run with error 500.
LocalSettings.php:
wfLoadExtension( 'VisualEditor' );
// 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://localhost:8000',
// Parsoid "domain", see below (optional)
'domain' => 'localhost',
// Parsoid "prefix", see below (optional)
'prefix' => 'localhost'
);
$wgSessionsInObjectCache = true;
Settings for private wiki from https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis are added:
// This feature requires a non-locking session store. The default session store will not work and
// will cause deadlocks (connection timeouts from Parsoid) when trying to use this feature.
$wgSessionsInObjectCache = true;
// Forward users' Cookie: headers to Parsoid. Required for private wikis (login required to read).
// If the wiki is not private (i.e. $wgGroupPermissions['*']['read'] is true) this configuration
// variable will be ignored.
//
// WARNING: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS
// of sending Cookie headers to Parsoid over HTTP. For security reasons, it is strongly recommended
// that $wgVirtualRestConfig['modules']['parsoid']['url'] be pointed to localhost if this setting is enabled.
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
Thanks in advance