MediaWiki 1.3x with Parsoid server, Visual Editor over SSL and Nginx and ISPConfig 3 (Debian 9)

Ignis.Dev image
MediaWiki 1.3x with Parsoid server, Visual Editor over SSL and Nginx and ISPConfig 3 (Debian 9) 5 min read Alina
Tech

Are you thinking about using MediaWiki to create a knowledge base, but you don't know how to install a wiki? Do you need information on how to configure the Parsoid server and Visual Editor with an encrypted SSL connection and Nginx directives in the ISPConfig 3 panel for a site running MediaWiki 1.3x (Debian 9)? We described step by step how to do it. Use our instructions!

4753
23/11/2019 18:00

In this article we will focus on configuring the Parsoid server and Visual Editor with an encrypted SSL connection and PHP and Nginx directives in the ISPConfig 3 panel for a site running on MediaWiki 1.3x (Debian 9).

Why Parsoid and Visual Editor in the wiki?

MediaWiki with Parsoid and Visual Editor will take care of the visual quality of the presented materials, and this in turn will affect the willingness to work with the wiki by people who edit the topics and people who are to use the gathered knowledge.

MediaWiki + Parsoid i+ Visual Editor = recipe for successful installation

The undeniable advantage of using Parsoid and Visual Editor in conjunction with MediaWiki is access to the visual editor, thanks to which the wiki user does not necessarily need to be able to use HTML - of course skill in using HTML tags is welcome, but not necessary for entering content. n addition, you do not need to know the tag table, e.g. a category tag, because all elements are mapped in an accessible way for the person working on the articles in MediaWiki.

In this Article:

  1. Parsoid installation
  2. Setting Parsoid over SSL
  3. Nginx, PHP, ISPConfig 3 directives

Assuming that you already have a correctly added and configured domain in the ISPConfig 3 panel with the Let's Encrypt certificate generated, first install the Parsoid server.

1.

Parsoid installation


apt install dirmngr
apt-key advanced --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys AF380A3036A03444
echo "deb https://releases.wikimedia.org/debian jessie-mediawiki main" | sudo tee /etc/apt/sources.list.d/parsoid.list
apt install apt-transport-https
apt update && apt install parsoid
2.

Setting Parsoid over SSL:

apt install stunnel
nano /etc/stunnel/parsoid.conf

paste (remember to use your own certificate paths and SSL private key of your domain in the example below):

[parsoid]
accept = 8143
connect = 8142
cert = /var/www/clients/client1/web30/ssl/yourdomain.com-le.crt
key = /var/www/clients/client1/web30/ssl/yourdomain.com-le.key

if you have more MediaWiki pages that are to use the same Parsoid server, add to the above entry as well:

[parsoid_seconddomain]
accept = 8144
connect = 8142
cert = /var/www/clients/client1/web33/ssl/yourseconddomain.com-le.crt
key = /var/www/clients/client1/web33/ssl/yourseconddomain.com-le.key

 next, run:

nano /etc/default/stunnel4

and set

ENABLED=1


then restart the stunnel service:

/etc/init.d/stunnel4 restart


edit the Parsoid configuration file:

nano /etc/mediawiki/parsoid/config.yaml

uncomment in the conf section:

localsettings: ./localsettings.js


comment everything in the mwApis section, depending on the Unix distribution, if the path does not work, check the logs /var/log/parsoid/parsoid.log why


 Create localsettings.js:

nano /usr/lib/parsoid/localsettings.js

paste into newly created file:

'use strict';
exports.setup = function(parsoidConfig) {
parsoidConfig.setMwApi({uri: 'https://yourdomain.com/api.php', domain: 'yourdomain.com', prefix: 'yourdomain'});
//for another domain uncomment and edit below
//parsoidConfig.setMwApi({uri: 'https://yourseconddomain.com/api.php', domain: 'yourseconddomain.com', prefix: 'yourseconddomain'});
}
service parsoid restart


in mediawiki LocalSettings.php e.g. yourdomain.com (similarly for subsequent MediaWiki pages with another Stunnel port, e.g. 8144 etc.):

wfLoadExtension( 'VisualEditor' );
# End of automatically generated settings.
# Add more configuration options below.
$wgDefaultUserOptions['visualeditor-enable'] = 1;
# $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
$wgHiddenPrefs[] = 'visualeditor-enable';
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
$wgVirtualRestConfig['modules']['parsoid'] = array(
    // URL to the Parsoid instance
    'url' => 'https://yourdomain.com:8143',
    // Parsoid "domain", see below (optional)
    'domain' => 'yourdomain.com',
    // Parsoid "prefix", see below (optional)
    'prefix' => 'yourdomain',
'forwardCookies' => true
);
3.

Nginx, PHP, ISPConfig 3 directives

In the ISPConfig 3 panel in the domain in the tab Options

Custom php.ini settings:

display_errors = off


nginx Directives:

client_max_body_size 5M;
client_body_timeout 60;
location / {
	try_files $uri $uri/ @rewrite;
}
location @rewrite {
	rewrite ^/(.*)$ /index.php?title=$1&$args;
}
location ^~ /maintenance/ {
	return 403;
}
location ~ \.php$ {
	{FASTCGIPASS}
	include /etc/nginx/fastcgi_params;
	fastcgi_index index.php;
	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	try_files $uri @rewrite;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    try_files $uri /index.php;
    expires max;
    log_not_found off;
}
location = /_.gif {
    expires max;
    empty_gif;
}
location ^~ ^/(cache|includes|maintenance|languages|serialized|tests|images/deleted)/ {
    deny all;
}
location ^~ ^/(bin|docs|extensions|includes|maintenance|mw-config|resources|serialized|tests)/ {
    internal;
}
# Security for 'image' directory
location ~* ^/images/.*.(html|htm|shtml|php)$ {
    types { }
    default_type text/plain;
}
# Security for 'image' directory
location ^~ /images/ {
    try_files $uri /index.php;
}
Do you want to install Parsoid with SSL and Visual Editor on your own server with MediaWiki?
Contact us!
Cart
0
We use cookies to improve your experience and for marketing purposes. By continuing to use our website, you accept our use of cookies. You can manage your cookie settings in your browser.
Ignisdev Ltd 2025 TOS | Privacy policy