new snapshot, url update
[mediawiki-setup] / Mediawiki_Setup_Guide
1 == Introduction ==
2
3 '''tldr''': For GNU/Linux (with a bit of Debian bias), a more concise, holistic and automated install than the official Mediawiki docs. Do some initial configuration then download this page and run it, or execute it as you read.
4
5 ''' Goals / Why use this guide? '''
6
7 * Good recommendations. Official docs mostly avoid recommendations among a myriad of possibilities
8 * Closely references & supplements official documentation
9 * Explicit automation support wherever practical
10 * Used to setup this site (style optional)
11 * Contributions welcome and will be updated/tested on this very site!
12 * Support for multiple gnu/linux distros
13 * Holistic scope (backups, server setup), but sections stand on their own
14 * Explicit support for production & local testing instance. Additions for production like https and web analytics.
15 * Edits to this page are closely monitored by the original author.
16
17 '''Assumptions'''
18
19 * Self hosting, single GNU/Linux system with Bash shell
20 * Root shell is assumed throughout
21 * Code blocks are [https://en.wikipedia.org/wiki/Idempotent idempotent]
22
23 '''Version Support'''
24
25 Very minor adjustments needed for other distros. Help expand this list.
26 * Mediawiki 1.27
27 * Debian 8 (tested)
28 * Debian testing (tested Aug 7, 2016)
29
30 Pre 5/2016 revisions ran Mediawiki 1.23, tested on Fedora 20 and Ubuntu 14.04.
31
32 == Prerequisites ==
33
34 '''Getting a Server & a Domain'''
35
36 The most common route and the one taken by this site is buying a domain name from a site like namecheap, and a cheap vps from companies like linode or digital ocean. They have good getting started guides which mostly apply beyond their own sites.
37
38 '''Email Setup'''
39
40 Setting up email can be an involved process, and this guide assumes that a some program (usually postfix or exim) is implementing a functional sendmail interface. Mediawiki uses email with to send password reminders or notifications, and this guide includes cronjobs for updating mediawiki and doing backups which will send mail in the case of an error. Email is also the recommended way to get notifications of package updates which require manual steps such as restarting of services.
41
42 If you are not setting up your server to send mail with a program that uses the default sendmail interface, see these pages when you are configuring mediawiki: [[mediawikiwiki:Manual:$wgEnableEmail|Manual:$wgEnableEmail]], [https://www.mediawiki.org/wiki/Configuration_settings#Email_settings Manual:Email_settings], [[mediawikiwiki:Manual:$wgSMTP|Manual:$wgSMTP]]
43
44 == Setup Guide Configuration ==
45
46 # Set variables below
47 # Save the code in this section to a file (~/mw_vars is suggested)
48 # Source it at the beginning of scripts containing later commands
49 # Source it from your .bashrc file while you are setting up Mediawiki
50
51 '''Requires customization:'''
52 <source lang="bash" type="example">
53 # Replace REPLACE_ME as appropriate
54
55 export mwdescription="REPLACE_ME" # eg. Opinionated Free Software Wiki
56
57 # username/pass of the first wiki admin user
58 export wikiuser="REPLACE_ME"
59 export wikipass=REPLACE_ME
60
61 # root password for the mysql database
62 export dbpass=REPLACE_ME
63
64 export mwdomain=REPLACE_ME # domain name. for this site, it's ofswiki.org
65
66 # customize these questions. Try not to have the answer be a word in the question.
67 captchaArray() {
68 if ! grep -Fx '$localSettingsQuestyQuestions = array (' $mwc; then
69 tee -a $mwc <<'EOF'
70 $localSettingsQuestyQuestions = array (
71 "What is the name of the wiki software this site (and wikipedia) uses?" => "Mediawiki",
72 "REPLACE_ME with a question" => "REPLACE_ME with an answer"
73 );
74 EOF
75 fi
76 }
77
78 # The rest of this section will work fine with no changes.
79
80 # git branch for mediawiki + extensions.
81 # This guide has only been tested with 1_27.
82 # branch names: https://git.wikimedia.org/branches/mediawiki%2Fcore.git
83 export mw_branch=REL1_27
84
85 # As set by gui installer when choosing cc by sa.
86 export mw_RightsUrl='https://creativecommons.org/licenses/by-sa/4.0/'
87 export mw_RightsText='Creative Commons Attribution-ShareAlike'
88 export mw_RightsIcon='$wgScriptPath/resources/assets/licenses/cc-by-sa.png'
89
90 # Alphanumeric site name for pywikibot.
91 # Here we use the domain minus the dots, which should work fine without changing.
92 export mwfamily=${mwdomain//./}
93 # install path for mediawiki. This should work fine.
94 export mw=/var/www/$mwdomain/html/w
95
96
97 # wiki sender address / wiki & wiki server contact email.
98 # see email section for more info on email
99 export mw_email="admin@$mwdomain"
100
101 # Leave as is:
102 mwc="$mw/LocalSettings.php"
103 </source>
104
105 == Download this page and run it ==
106
107 This is an option to do automated setup. Optional code blocks are skipped (they have a bold warning just before them and a tag on the source block). The only important things left after running this are running the automated backup setup code on another machine.
108
109 ''' Requires manual step: inspect output file: /tmp/mw-setup, then run it'''
110 <source lang="bash" type="example">
111 start=' *<source lang="bash"> *'
112 end=' *<\/source> *'
113 ruby <<'EOF' | sed -rn "/^$start$/,/^$end$/{s/^$start|$end$/# \0/;p} > /tmp/mw-setup"
114 require 'json'
115 puts JSON.parse(`curl 'https://ofswiki.org/w/api.php?\
116 action=query&titles=Mediawiki_Setup_Guide&prop=revisions&rvprop=content&\
117 format=json'`.chomp)['query']['pages'].values[0]['revisions'][0]['*']
118 EOF
119 chmod +x /tmp/mw-setup
120 </source>
121
122 == Required Bash Functions ==
123
124 Here we define some small useful bash functions. This should be part of the same ~/mw_vars file if you are running the code step by step.
125
126 <source lang="bash">
127 # identify if this is a debian based distro
128 isdeb() { command -v apt &>/dev/null; }
129 # tee unique. append each stdin line if it does not exist in the file
130 teeu () {
131 local MAPFILE
132 mapfile -t
133 for line in "${MAPFILE[@]}"; do
134 grep -xFq "$line" "$1" &>/dev/null || tee -a "$1" <<<"$line"
135 done
136 }
137
138 # get and reset an extension/skin repository, and enable it
139 mw-clone() {
140 local url=$1
141 local original_pwd="$PWD"
142 local name
143 local re='[^/]*/[^/]*$'
144 [[ $url =~ $re ]] ||:
145 target=$mw/${BASH_REMATCH[0]}
146 if [[ ! -e $target/.git ]]; then
147 git clone $url $target
148 fi
149 if ! cd $target; then
150 echo "mw-ext error: failed cd $target";
151 exit 1
152 fi
153 git fetch
154 git checkout -qf origin/$mw_branch || git checkout -qf origin/master
155 git clean -xffd
156 cd "$original_pwd"
157
158 }
159 mw-ext () {
160 local ext
161 for ext in "$@"; do
162 mw-clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/$ext
163 if [[ -e $mw/ext/$ext/extension.json ]]; then
164 # new style extension. remove old style declaration
165 sed -i --follow-symlinks '#^require_once( "\\\$IP/extensions/\$ext/\$ext\.php" );#d' $mwc
166 teeu $mwc <<EOF
167 wfLoadExtension( '$ext' );
168 EOF
169 else
170 teeu $mwc <<EOF
171 require_once( "\$IP/extensions/$ext/$ext.php" );
172 EOF
173 fi
174 done
175 # --quick is quicker than default flags,
176 # but still add a sleep to make sure everything works right
177 sudo -u $apache_user php $mw/maintenance/update.php -q --quick; sleep 1
178 }
179 mw-skin() {
180 local skin=$1
181 mw-clone https://gerrit.wikimedia.org/r/p/mediawiki/skins/$skin
182 sed -i --follow-symlinks '/^wfLoadSkin/d' $mwc
183 sed -i --follow-symlinks '/^\$wgDefaultSkin/d' $mwc
184 teeu $mwc <<EOF
185 \$wgDefaultSkin = "${skin,,*}";
186 wfLoadSkin( '$skin' );
187 EOF
188 sudo -u $apache_user php $mw/maintenance/update.php -q --quick; sleep 1
189 }
190
191 if command -v apt &>/dev/null; then
192 apache_user=www-data
193 else
194 apache_user=apache
195 fi
196
197 </source>
198
199 == Install Mediawiki Dependencies ==
200
201 The best way to get core dependencies is to install the mediawiki package itself. Nothing about it will get in the way of using a version from upstream.
202
203 [[mediawikiwiki:Main Page|Mediawiki Main Page]]: the beginning of the official docs.
204
205 [[mediawikiwiki:Manual:Installation_requirements|Manual:Installation_requirements]]: Overview of installation requirements.
206
207 Note, this guide needs a little adjustment before it will work with php7.0: make sure settings are still valid, update ini path.
208
209
210
211 <source lang="bash">
212 # From here on out, exit if a command fails.
213 # This will prevent us from not noticing an important failure.
214 # We recommend setting this for the entire installation session.
215 # If you are running commands interactively, it might be best to
216 # put it in your ~/.bashrc temporarily.
217 set -eE -o pipefail
218 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
219 source ~/mw_vars
220
221 if isdeb; then
222 # main reference:
223 # https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu
224 apt-get update
225 apt-get install -y imagemagick
226 if apt-get install -s mediawiki &>/dev/null; then
227 # in debian wheezy time-frame distros, mediawiki was packaged.
228 apt-get -y install php-apc mediawiki php-mbstring
229 else
230 # https://www.mediawiki.org/wiki/Manual:Installation_requirements
231 if apt-get install -s php7.0 &>/dev/null; then
232 # note, 7.0 is untested by the editor here, since it's not
233 # available in debian 8. it's listed as supported
234 # in the mediawiki page.
235 # noninteractive to avoid mysql password prompt.
236 DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 mysql-server \
237 php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-xml \
238 php7.0-apcu php7.0-mbstring
239 else
240 # note: mbstring is recommended, but it's not available for php5 in
241 # debian jessie.
242 DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 mysql-server \
243 php5 php5-mysql libapache2-mod-php5 php5-apcu
244 fi
245 fi
246 service apache2 restart
247 else
248 # note
249 # fedora deps are missing a database, so some is translated from debian packages
250 yum -y install mediawiki ImageMagick php-mysqlnd php-pecl-apcu mariadb-server
251
252 systemctl restart mariadb.service
253 systemctl enable mariadb.service
254 systemctl enable httpd.service
255 systemctl restart httpd.service
256 fi
257
258
259 # slightly different depending on if we already set the root pass
260 if echo exit|mysql -u root -p"$dbpass"; then
261 # answer interactive prompts:
262 # mysql root pass, change pass? no, remove anon users? (default, yes)
263 # disallow remote root (default, yes), reload? (default, yes)
264 echo -e "$dbpass\nn\n\n\n\n" | mysql_secure_installation
265 else
266 # I had 1 less newline at the start when doing ubuntu 14.04,
267 # compared to debian 8, so can't say this is especially portable.
268 # It won't hurt if it fails.
269 echo -e "\n\n$dbpass\n$dbpass\n\n\n\n\n" | mysql_secure_installation
270 fi
271 </source>
272
273
274 '''Skippable notes'''
275
276
277 php[5]-mysqlnd is a faster mysql driver package, but the default in debian php-mysql, appparently because some non-mediawiki packages are not compatible with it. If you run into this issue, simply use the php-mysql package.
278
279
280 Additional packages rational
281 * ImageMagick is [https://www.mediawiki.org/wiki/Manual:Image_administration#Image_thumbnailing recommended].
282 * Gui install and [[mediawikiwiki:Manual:Cache]] recomend the apc package.
283 * Clamav for virus scanning of uploads is mentioned in the mediawiki manual. However, wikipedia doesn't seem to do it, so it doesn't seem like it's worth bothering. It also makes uploading a set of images take twice as long on broadband.
284
285 == Install Mediawiki ==
286
287
288 Here, we [[mediawikiwiki:Download_from_Git]], or reset our installation if it is already there, and create the wiki database. [[mediawikiwiki:Manual:Installing_MediaWiki]]
289
290 <source lang="bash">
291 mkdir -p $mw
292 cd $mw
293 # this will just fail if it already exists which is fine
294 if [[ ! -e .git ]]; then
295 git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git .
296 fi
297 # to see available branches: https://www.mediawiki.org/wiki/Version_lifecycle
298 # and
299 # git branch -r
300 git checkout -f origin/$mw_branch
301 git clean -ffxd
302 # Get the php libraries wmf uses. Based on:
303 # https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries
304 if [[ ! -e vendor/.git ]]; then
305 git clone https://gerrit.wikimedia.org/r/p/mediawiki/vendor.git
306 fi
307 cd vendor
308 git checkout -f origin/$mw_branch
309 cd ..
310
311 # Drop any previous database which may have been installed while testing.
312 # If upgrading, we should have a db backup which will get restored.
313 # https://www.mediawiki.org/wiki/Manual:Upgrading
314 mysql -u root -p$dbpass <<'EOF' ||:
315 drop database my_wiki;
316 exit
317 EOF
318 php $mw/maintenance/install.php --pass $wikipass --scriptpath /w \
319 --dbuser root --dbpass $dbpass "$mwdescription" "$wikiuser"
320 teeu $mwc <<'EOF'
321 # lock down the wiki to only the initial owner until anti-spam measures are put in place
322 # limit edits to registered users
323 $wgGroupPermissions['*']['edit'] = false;
324 # don't allow any account creation
325 $wgGroupPermissions['*']['createaccount'] = false;
326 EOF
327 </source>
328
329
330 Note: When testing, you may need to clear the apc cache to see changes take effect in the browser. Simplest solution is
331 just restart apache. http://stackoverflow.com/questions/911158/how-to-clear-apc-cache-entries
332
333 ''' Skippable Notes'''
334
335 If we wanted to reset our installation, but leave the extension repositories alone, alter the command above to be <code>git clean -fxd</code>
336
337 '''Rational for choosing git sources'''
338
339 Upstream vs distro packages. Upstream is responsive, and it's distributed within a single directory, so packaging does not integrate with the distro's filesystem. The only potential value would be less bugs by using stable versions, but we choose not to make that tradeoff.
340
341 Why use git over zip file releases? Mediawiki supports git usage through release branches which get post-release fixes. This means we can auto-update, get more granular fixes, easier to manage updates, and rollbacks.
342
343 == Configure Apache ==
344
345 Note, non-debian based installs: modify instructions below to use /etc/httpd/conf.d/$mwdomain.conf, and don't run a2ensite.
346
347 I use scripts I maintains separately to setup Let's Encrypt certificates and apache config: (url pending).
348
349 If you are doing a test setup on your local machine, you can make your domain resolve to your local test installation, then remove it later when you are done. Note, you will need non-local site to get Let's Encrypt certificates, and then transfer them locally, or disable ssl from the apache config (neither is covered here) and replace all instances of https in these instructions with http. Another option is to get a cheap 2 dollar domain for your test site.
350
351 '''Not for production:'''
352 <source lang="bash" type="example">
353 teeu /etc/hosts<<<"127.0.0.1 $mwdomain"
354 </source>
355
356 To not use my scripts, and still use Let's Encrypt: follow this doc page: https://letsencrypt.org/getting-started/. It's a little long winded, so I would boil it down to this:
357
358 '''Optional & requires additional steps:'''
359 <source lang="bash" type="example">
360 git clone https://github.com/certbot/certbot
361 cd certbot
362 ./certbot-auto apache
363 cd /etc/apache/sites-available
364 mv 000-default-le-ssl.conf $mwdomain.conf
365 rm ../sites-enabled/000-default-le-ssl.conf
366 # edit $mwdomain.conf, so documentroot is /var/www/$mwdomain/html
367 # and ServerName is $mwdomain
368 a2ensite $mwdomain.conf
369 </source>
370 Then, copy the input to apache-site below and insert it into the apache config.
371
372 Here, we use some scripts automate setting up the Let 's Encrypt cert and
373 the apache config.
374
375 <source lang="bash">
376 temp=$(mktemp -d)
377 cd $temp
378 git_site=https://iankelling.org/git
379 git clone $git_site/acme-tiny-wrapper
380 l=$mw/../../logs
381 mkdir -p $l
382
383 acme-tiny-wrapper/acme-tiny-wrapper -t $mwdomain
384
385 git clone $git_site/basic-https-conf
386 { cat <<EOF
387 ServerAdmin $mw_email
388 RewriteEngine On
389 # make the site's root url go to our main page
390 RewriteRule ^/?wiki(/.*)?\$ %{DOCUMENT_ROOT}/w/index.php [L]
391 # use short urls https://www.mediawiki.org/wiki/Manual:Short_URL
392 RewriteRule ^/*\$ %{DOCUMENT_ROOT}/w/index.php [L]
393 EOF
394 find -L $(readlink -f $mw) -name .htaccess \
395 | while read line; do
396 echo -e "<Directory ${line%/.htaccess}>\n $(< $line)\n</Directory>";
397 done
398 } | basic-https-conf/apache-site -r ${mw%/*} - $mwdomain
399 cd
400 rm -rf $temp
401 </source>
402
403 Now mediawiki should load in your browser at $mwdomain .
404
405 Allow proper search bots and internet archiver bots, via [[Mediawiki:Robots.txt]],
406 and install the default skin.
407
408 <source lang="bash">
409 dd of=$mw/../robots.txt <<'EOF'
410 User-agent: *
411 Disallow: /w/
412 User-agent: ia_archiver
413 Allow: /*&action=raw
414 EOF
415 mw-skin Vector
416 </source>
417
418 '''Skippable Notes'''
419
420 This section assumes we are redirecting www to a url without www.
421
422 [http://httpd.apache.org/docs/current/howto/htaccess.html Apache recommends] moving .htaccess rules into it's config for performance. So we look for .htaccess files from mediawiki and copy their contents into this config. In modern apache versions, we would have to explicitly set options like AllowOverride to allow .htaccess files to take effect.
423
424 == Mediawiki Settings ==
425
426 Overall reference: [[mediawikiwiki:Manual:Configuration_settings]].
427
428 Settings which the gui setup prompts for but aren't set by the automated install script.
429 <source lang="bash">
430 teeu $mwc<<EOF
431 \$wgServer = "https://$mwdomain";
432 \$wgDBserver = "localhost";
433 \$wgRightsUrl = "$mw_RightsUrl";
434 \$wgRightsText = "$mw_RightsText";
435 \$wgRightsIcon = "$mw_RightsIcon";
436 EOF
437 </source>
438 Settings I recommend which are different than the defaults.
439 <source lang="bash">
440 teeu $mwc<<EOF
441 \$wgPasswordSender = "$mw_email";
442 \$wgEmergencyContact = "$mw_email";
443 \$wgEnotifUserTalk = true; # UPO
444 \$wgEnotifWatchlist = true; # UPO
445 \$wgMainCacheType = CACHE_ACCEL;
446 \$wgEnableUploads = true;
447 \$wgUseInstantCommons = true;
448 EOF
449 </source>
450
451 Other misc settings
452 <source lang="bash">
453 teeu $mwc <<'EOF'
454 # from https://www.mediawiki.org/wiki/Manual:Short_URL
455 $wgArticlePath = "/wiki/$1";
456
457 # https://www.mediawiki.org/wiki/Manual:Combating_spam
458 # check that url if our precautions don't work
459 # not using nofollow is good practice, as long as we avoid spam.
460 $wgNoFollowLinks = false;
461 # Allow user customization.
462 $wgAllowUserJs = true;
463 $wgAllowUserCss = true;
464
465 # use imagemagick over GD
466 $wgUseImageMagick = true;
467 EOF
468
469
470 # https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads
471 # Increase from default of 2M to 100M.
472 # This will at least allow high res pics etc.
473 php_ini=$(php -r 'echo(php_ini_loaded_file());')
474 sed -i --follow-symlinks 's/^\(upload_max_filesize\|post_max_size\)\b.*/\1 = 100M/' $php_ini
475 if isdeb; then
476 service apache2 restart
477 else
478 systemctl restart httpd.service
479 fi
480
481 # if you were to install as a normal user, you would need this for images
482 # sudo usermod -aG $apache_user $USER
483
484 # this doesn't propogate right away
485 chgrp -R $apache_user $mw/images
486 chmod -R g+w $mw/images
487 </source>
488
489 Style settings. Omit to use a different style.
490 <source lang="bash">
491 teeu $mwc <<'EOF'
492 $wgLogo = null;
493 #$wgFooterIcons = null;
494 EOF
495 # Make the toolbox go into the drop down.
496 cd $mw/skins/Vector
497 if ! git remote show ian-kelling &>/dev/null; then
498 git remote add ian-kelling https://iankelling.org/git/forks/Vector
499 fi
500 git fetch ian-kelling
501 git checkout ian-kelling/REL1_27-toolbox-in-dropdown
502 </source>
503
504 == Install and Configure Mediawiki Extensions ==
505
506 When installing extensions on a wiki with important content, backup first as a precaution.
507
508 ''' Extensions with no configuration needed '''
509
510 {| class="wikitable"
511 ! Name
512 ! Description
513 |-
514 | [[mediawikiwiki:Extension:Cite|Extension:Cite]]
515 | Have references in footnotes.
516 |-
517 | [[mediawikiwiki:Extension:CiteThisPage|Extension:CiteThisPage]]
518 | Ability to generate citations to pages in a variety of styles.
519 |-
520 | [[mediawikiwiki:Extension:CSS|Extension:CSS]]
521 | Allows CSS stylesheets to be included in specific articles
522 |-
523 | [[mediawikiwiki:Extension:Echo|Extension:Echo]]
524 | Notification subsystem for usage by other extensions
525 |-
526 | [[mediawikiwiki:Extension:Gadgets|Extension:Gadgets]]
527 | UI extension system for users
528 |-
529 | [[mediawikiwiki:Extension:ImageMap|Extension:ImageMap]]
530 | Links for a region of an image
531 |-
532 | [[mediawikiwiki:Extension:Interwiki|Extension:Interwiki]]
533 | Tool for nice links to other wikis
534 |-
535 | [[mediawikiwiki:Extension:News|Extension:News]]
536 | Embed or rss recent changes
537 |-
538 | [[mediawikiwiki:Extension:Nuke|Extension:Nuke]]
539 | Mass delete of pages, in the case of spam
540 |-
541 | [[mediawikiwiki:Extension:ParserFunctions|Extension:ParserFunctions]]
542 | Useful for templates
543 |-
544 | [[mediawikiwiki:Extension:Poem|Extension:Poem]]
545 | Useful for formatting things various ways
546 |-
547 | [[mediawikiwiki:Extension:SyntaxHighlight_GeSHi|Extension:SyntaxHighlight_GeSHi]]
548 | Source code highlighting
549 |-
550 | [[mediawikiwiki:Extension:Variables|Extension:Variables]]
551 | Define per-page variables
552 |}
553
554 <source lang="bash">
555 mw-ext Cite CiteThisPage CSS Echo Gadgets ImageMap Interwiki News \
556 Nuke ParserFunctions Poem SyntaxHighlight_GeSHi Variables
557 </source>
558
559
560 ''' [[mediawikiwiki:Extension:AntiSpoof|Extension:AntiSpoof]]: Disallow usernames with unicode trickery to look like existing names'''
561
562 <source lang="bash">
563 mw-ext AntiSpoof
564 # recommended setup script to account for existing users
565 sudo -u $apache_user php $mw/extensions/AntiSpoof/maintenance/batchAntiSpoof.php
566 </source>
567
568
569 ''' [[mediawikiwiki:CheckUser|Extension:CheckUser]]: Get ip addresses from inside mediawiki so you can ban users'''
570
571 Requires special install steps or we can get into a bad state. Add a sleep like the default of update.php to avoid errors.
572 <source lang="bash">
573 mw-ext CheckUser
574 sudo -u $apache_user php $mw/extensions/CheckUser/install.php; sleep 1
575 </source>
576
577
578 '''[[mediawikiwiki:Extension:Wikidiff2|Extension:Wikidiff2]]: Faster and international character supported page diffs'''
579
580 I used packaged version since this is a c++ and probably not very tied to the Mediawiki version. This isn't packaged in fedora, haven't gotten around to testing and adding the code to compile it for fedora.
581 <source lang="bash">
582 if isdeb; then
583 apt-get -y install php-wikidiff2
584 teeu $mwc <<'EOF'
585 $wgExternalDiffEngine = 'wikidiff2';
586 EOF
587 dir=$(dirname $(php -r 'echo(php_ini_loaded_file());'))/../apache2/conf.d
588 ln -sf ../../mods-available/wikidiff2.ini $dir
589 service apache2 restart
590 fi
591 </source>
592
593
594 ''' [[mediawikiwiki:Extension:Math|Extension:Math]] Display equations'''
595
596 <source lang="bash">
597 mw-ext Math
598 # php5-curl according to Math readme
599 if isdeb; then
600 curl_pkg=php7.0-curl
601 if ! apt-get -s install $curl_pkg &>/dev/null; then
602 curl_pkg=php5-curl
603 fi
604 apt-get -y install latex-cjk-all texlive-latex-extra texlive-latex-base \
605 ghostscript imagemagick ocaml $curl_pkg make
606 else
607 # todo, php5-curl equivalent on fedora
608 yum -y install texlive-cjk ghostscript ImageMagick texlive ocaml
609 fi
610 service apache2 restart
611
612 cd $mw/extensions/Math/math; make # makes texvc
613 cd $mw/extensions/Math/texvccheck; make
614
615 teeu $mwc <<'EOF'
616 # Enable MathJax as rendering option
617 $wgUseMathJax = true;
618 # Enable LaTeXML as rendering option
619 $wgMathValidModes[] = 'latexml';
620 # Set LaTeXML as default rendering option, because it is nicest
621 $wgDefaultUserOptions['math'] = 'latexml';
622 EOF
623 </source>
624
625 '''Skippable notes'''
626
627 There is no current list of package depencies so I took dependencies from mediawiki-math package in Debian 7. Fedora didn't have a mediawik math package, so I just translated from debian. Ocaml is for math png rendering, as backup option to the nicer looking LatexML and MathJax. Debian has texvc package, but it didn't work right for me, plus it required additional configuration in mediawiki settings.
628
629
630 ''' [[mediawikiwiki:Extension:SpamBlacklist|Extension:SpamBlacklist]]: Import/create IP blacklists, mainly for spam'''
631
632 <source lang="bash">
633 mw-ext SpamBlacklist
634 if ! grep -F '$wgSpamBlacklistFiles = array(' $mwc &>/dev/null; then
635 tee -a $mwc <<'EOF'
636 $wgEnableDnsBlacklist = true;
637 $wgDnsBlacklistUrls = array( 'xbl.spamhaus.org', 'dnsbl.tornevall.org' );
638
639 ini_set( 'pcre.backtrack_limit', '10M' );
640 $wgSpamBlacklistFiles = array(
641 "[[m:Spam blacklist]]",
642 "http://en.wikipedia.org/wiki/MediaWiki:Spam-blacklist"
643 );
644 EOF
645 fi
646 </source>
647
648 ''' [[mediawikiwiki:Extension:TitleBlacklist|Extension:TitleBlacklist]]: Anti-spam '''
649
650 <source lang="bash">
651 mw-ext TitleBlacklist
652 if ! grep -F '$wgTitleBlacklistSources = array(' $mwc &>/dev/null; then
653 tee -a $mwc <<'EOF'
654 $wgTitleBlacklistSources = array(
655 array(
656 'type' => 'local',
657 'src' => 'MediaWiki:Titleblacklist',
658 ),
659 array(
660 'type' => 'url',
661 'src' => 'http://meta.wikimedia.org/w/index.php?title=Title_blacklist&action=raw',
662 ),
663 );
664 EOF
665 fi
666 </source>
667
668 ''' [[mediawikiwiki:Extension:WikiEditor|Extension:WikiEditor]]: Editing box extras and a fast preview tab '''
669
670 <source lang="bash">
671 mw-ext WikiEditor
672 teeu $mwc <<'EOF'
673 # Enable Wikieditor by default
674 $wgDefaultUserOptions['usebetatoolbar'] = 1;
675 $wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
676
677 # Display the Preview and Changes tabs
678 $wgDefaultUserOptions['wikieditor-preview'] = 1;
679 EOF
680 </source>
681
682 ''' [[mediawikiwiki:CategoryTree|Extension:CategoryTree]]: Enables making nice outlines of pages in a category'''
683 <source lang="bash">
684 mw-ext CategoryTree
685 teeu $mwc <<'EOF'
686 # Mediawiki setting dependency for CategoryTree
687 $wgUseAjax = true;
688 EOF
689 </source>
690
691 ''' [[mediawikiwiki:Extension:AbuseFilter|Extension:AbuseFilter]]: Complex abilities to stop abuse '''
692
693 Used by big wiki sites. As a smaller site, we won't use it much, but it's good to have. It's page suggests a few defaults:
694 <source lang="bash">
695 mw-ext AbuseFilter
696 teeu $mwc<<'EOF'
697 $wgGroupPermissions['sysop']['abusefilter-modify'] = true;
698 $wgGroupPermissions['*']['abusefilter-log-detail'] = true;
699 $wgGroupPermissions['*']['abusefilter-view'] = true;
700 $wgGroupPermissions['*']['abusefilter-log'] = true;
701 $wgGroupPermissions['sysop']['abusefilter-private'] = true;
702 $wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = true;
703 $wgGroupPermissions['sysop']['abusefilter-revert'] = true;
704 EOF
705 </source>
706
707 '''[[mediawikiwiki:Extension:ConfirmEdit|Extension:ConfirmEdit]]: Custom Captcha'''
708
709 Uses captchaArray defined in mw_vars.
710
711 <source lang="bash">
712 mw-ext ConfirmEdit
713 captchaArray
714 teeu $mwc <<'EOF'
715 wfLoadExtension( 'ConfirmEdit/QuestyCaptcha' );
716 $wgCaptchaClass = 'QuestyCaptcha';
717 # only captcha on registration
718 $wgGroupPermissions['user' ]['skipcaptcha'] = true;
719 $wgGroupPermissions['autoconfirmed']['skipcaptcha'] = true;
720 EOF
721 if ! grep -Fx 'foreach ( $localSettingsQuestyQuestions as $key => $value ) {' $mwc; then
722 tee -a $mwc <<'EOF'
723 foreach ( $localSettingsQuestyQuestions as $key => $value ) {
724 $wgCaptchaQuestions[] = array( 'question' => $key, 'answer' => $value );
725 }
726 EOF
727 fi
728 </source>
729
730 Enable account creation that we initially disabled.
731 <source lang="bash">
732 sed -i --follow-symlinks "/\\\$wgGroupPermissions\\['\\*'\\]\\['createaccount'\\] = false;/d" $mwc
733 </source>
734
735 == Additional Configuration with Pywikibot ==
736
737 There are quite a few [[mediawikiwiki:Help:Namespaces|special pages]] which act like variables to configure special wiki content and style. A big part of this wiki's style is configured in this section. We use Pywikibot to automate editing those pages.
738
739
740 '''Pywikibot Install'''
741
742 [[mediawikiwiki:Manual:Pywikibot/Installation|Manual:Pywikibot/Installation]]
743
744 <source lang="bash">
745 # get repo
746 if [[ ! -e ~/pywikibot/.git ]]; then
747 git clone --recursive \
748 https://gerrit.wikimedia.org/r/pywikibot/core.git ~/pywikibot
749 fi
750 cd ~/pywikibot
751 #updating
752 git pull --all
753 git submodule update
754 </source>
755
756
757 '''Pywikibot Configuration'''
758
759 Relevent docs: [[mediawikiwiki:Manual:Pywikibot/Use_on_non-WMF_wikis|Manual:Pywikibot/Use_on_non-WMF_wikis]], [[mediawikiwiki:Manual:Pywikibot/Quick_Start_Guide|Manual:Pywikibot/Quick_Start_Guide]]
760
761
762 <source lang="bash">
763 cd $HOME/pywikibot
764 dd of=user-config.py <<EOF
765 mylang = 'en'
766 usernames["$mwfamily"]['en'] = u'$wikiuser'
767 family = "$mwfamily"
768 console_encoding = 'utf-8'
769 password_file = "secretsfile"
770 EOF
771
772 dd of=secretsfile <<EOF
773 ("$wikiuser", "$wikipass")
774 EOF
775
776 # it won't overrwrite an existing file. Remove if if one exists
777 rm -f pywikibot/families/${mwfamily}_family.py
778 if isdeb; then
779 apt-get install -y python-requests
780 else
781 yum -y install python-requests
782 fi
783
784 python generate_family_file.py https://$mwdomain/wiki/Main_Page "$mwfamily"
785
786 # Note, this needed only for ssl site
787 tee -a pywikibot/families/${mwfamily}_family.py<<'EOF'
788 def protocol(self, code):
789 return 'https'
790 EOF
791 </source>
792
793
794 '''Pywikibot Script'''
795
796 This will take a full minute or so because the bot waits a few seconds between edits. Useful doc: [[mediawikiwiki:Pywikipediabot/Create_your_own_script]].
797
798 <source lang="bash">
799 cd "$HOME/pywikibot"
800
801 dd of=scripts/${mwfamily}_setup.py<<EOF
802 import pywikibot
803 import time
804 import sys
805 site = pywikibot.Site()
806 def x(p, t=""):
807 page = pywikibot.Page(site, p)
808 page.text = t
809 #force is for some anti-bot thing, not necessary in my testing, but might as well include it
810 page.save(force=True)
811
812 # Small/medium noncommercial wiki should be fine with no privacy policy
813 # based on https://www.mediawiki.org/wiki/Manual:Footer
814 x("MediaWiki:Privacy")
815
816 # licenses for uploads. Modified from the mediawiki's wiki
817 x("MediaWiki:Licenses", u"""* Same as this wiki's text (preferred)
818 ** CC BY-SA or GFDL| Creative Commons Attribution ShareAlike or GNU Free Documentation License
819 * Others:
820 ** Unknown_copyright|I don't know exactly
821 ** PD|PD: public domain
822 ** CC BY|Creative Commons Attribution
823 ** CC BY-SA|Creative Commons Attribution ShareAlike
824 ** GFDL|GFDL: GNU Free Documentation License
825 ** GPL|GPL: GNU General Public License
826 ** LGPL|LGPL: GNU Lesser General Public License""")
827 x("MediaWiki:Copyright", '$mw_license')
828 x("MediaWiki:Mainpage-description", "$mwdescription")
829
830
831
832 # The rest of the settings are for the site style
833
834 # Remove various clutter
835 x("MediaWiki:Lastmodifiedat")
836 x("MediaWiki:Disclaimers")
837 x("MediaWiki:Viewcount")
838 x("MediaWiki:Aboutsite")
839 # remove these lines from sidebar
840 # ** recentchanges-url|recentchanges
841 # ** randompage-url|randompage
842 # ** helppage|help
843 x("MediaWiki:Sidebar", """* navigation
844 ** mainpage|mainpage-description
845 * SEARCH
846 * TOOLBOX
847 * LANGUAGES""")
848
849 # remove side panel
850 # helpfull doc: https://www.mediawiki.org/wiki/Manual:Interface/Sidebar
851 x("mediawiki:Common.css", """/* adjust sidebar to just be home link and up top */
852 /* panel width increased to fit full wiki name. */
853 div#mw-panel { top: 10px; padding-top: 0em; width: 20em }
854 div#footer, #mw-head-base, div#content { margin-left: 1em; }
855 #left-navigation { margin-left: 1em; }
856
857
858 /* logo, and toolbar hidden */
859 #p-logo, #p-tb.portal {
860 display:none;
861 }
862
863 /* make the font size smaller for the misc stuff */
864 #p-personal {
865 font-size: 0.8em;
866 }
867
868 #footer-info {
869 font-size: 0.8em;
870 }
871 div#mw-content-text {
872 max-width: 720px;
873 }
874 """)
875 EOF
876
877 # this can spam a warning, so uniq it
878 python pwb.py ${mwfamily}_setup |& uniq
879 </source>
880
881
882 ''' Skippable Notes '''
883
884 The docs suggest manually entering the pass with python pwb.py login.py, then it should stay logged in. That didn't work for me, and anyways, we automation, so we use secrets file method.
885
886 Family name, and all its duplicattions documented as supposed to be $wgSitename, but it works fine using any name.
887
888 == Automatic Backups ==
889
890 Here we will have a daily cronjob where a backup host sshs to the mediawiki host, makes a backup then copies it back. Copy ~/mw_vars to the backup host at /root/mw_vars. Setup passwordless ssh from the backup host to the mediawiki host. Then run this code on the backup host. This will make a versioned backup of the wiki to ~/backup.
891
892 <source lang="bash" type="backup">
893 backup_script=/etc/cron.daily/mediawiki_backup
894 sudo dd of=$backup_script <<'EOFOUTER'
895 #!/bin/bash
896 # if we get an error, keep going but return it at the end
897 last_error=0
898 trap 'last_error=$?' ERR
899 source ~/mw_vars
900 # No strict because the host is likely not named the same as
901 # the domain.
902 ssh="ssh -oStrictHostKeyChecking=no"
903 logfile=/var/log/${mwdomain}_backup.log
904 {
905 echo "#### starting backup at $(date) ####"
906 $ssh root@$mwdomain <<ENDSSH
907 set -x
908 tee -a $mwc<<'EOF'
909 \$wgReadOnly = 'Dumping Database, Access will be restored shortly';
910 EOF
911 mkdir -p ~/wiki_backups
912 mysqldump -p$dbpass --default-character-set=binary my_wiki > ~/wiki_backups/wiki_db_backup
913 sed -i '\$ d' $mwc # delete read only setting
914 ENDSSH
915 # add no strict option to the defaults
916
917 rdiff() { rdiff-backup --remote-schema "$ssh -C %s rdiff-backup --server" "$@"; }
918 set -x
919 rdiff root@$mwdomain::/root/wiki_backups ~/backup/${mwdomain}_wiki_db_backup
920 rdiff root@$mwdomain::$mw ~/backup/${mwdomain}_wiki_file_backup
921 set +x
922 echo "=== ending backup at $(date) ===="
923 } &>>$logfile
924 if [[ $last_error != 0 ]]; then
925 echo "backup for $mwdomain failed. See $logfile"
926 fi
927 exit $last_error
928 EOFOUTER
929
930 sudo chmod +x $backup_script
931 </source>
932
933 If you are like most people and don't use the old-school mail spool, setup the backup system to send mail externally. Some ways to do that are on this [http://unix.stackexchange.com/questions/36982/can-i-set-up-system-mail-to-use-an-external-smtp-server stackoverflow answer]. Then make local mail to your user get forwarded to an address you will read:
934
935 '''Optional & requires additional steps'''
936 <source lang="bash" type="example">
937 sed -i --follow-symlinks "/^root:/d" /etc/aliases
938 echo "root: EXAMPLE_ONLY_REPLACE_ME@gmail.com" >> /etc/aliases
939 newaliases
940 </source>
941
942 == Restoring Backups ==
943
944 '''Whenever you implement a backup system, you should test that restoring the backup works.'''
945
946 You ''should'' be able to restore your wiki to a new machine by repeating all install steps, then restoring the database and the images directory. I've done this many times. However, we backup the entire Mediawiki directory in case you forget to record a step or some corner case happens. Since most people don't record the steps they took to setup Mediawiki, this is also the officially recommended method. In the code below we restore only the database and images folder from the full backup. You can try this after setting up a wiki from scratch. If it doesn't work, you know your fresh setup is not replicating your backed up wiki correctly. In that case, you can fall back to doing a full restore by copying the full directory instead of just the images. See [[mediawikiwiki:Manual:Restoring a wiki from backup]] if you run into any problems.
947
948 To test a backup restore:
949 # Do a backup of your wiki with some content in it, as described in the previous section
950 # Move your mediawiki install directory, or setup Mediawiki on a new machine
951 # Re-execute the mediawiki install steps
952 # Change REPLACE_ME in the code below (as in the backup section so you get the right variables),
953 # Execute the code on the backup machine.
954
955 '''Optional'''
956 <source lang="bash" type="example">
957 #!/bin/bash
958 source ~/mw_vars
959 restore="rdiff-backup --force -r now"
960 $restore ~/backup/${mwdomain}_wiki_file_backup /tmp/wiki_file_restore
961 $restore ~/backup/${mwdomain}_wiki_db_backup /tmp/wiki_db_restore
962 o=-oStrictHostKeyChecking=no
963 scp $o -r /tmp/wiki_file_restore/images/* root@$mwdomain:$mw/images
964 scp $o -r /tmp/wiki_db_restore root@$mwdomain:/tmp
965 ssh $o root@$mwdomain <<EOF
966 set -e
967 chmod -R g+w $mw/images
968 chgrp -R www-data $mw/images
969 mysql -u root -p$dbpass my_wiki < /tmp/wiki_db_restore/wiki_db_backup
970 php $mw/maintenance/update.php
971 EOF
972 </source>
973
974 Then browse to your wiki and see if everything appears to work.
975
976 == Updates ==
977
978 Subscribe to get release and security announcements [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki-announce].
979
980 For updates, we simply git pull all the repos, then run the maintenance script. This should be done after a backup. We recommend automatic updates to get security fixes and since not much is changing on the release branch. In this example, we update at 5 am daily (1 hour after the automatic backup example).
981
982 Major version upgrades should be done manually, and it is recommended to use a new installation directory and the same procedure as for backup & restore. Official reference: [[mediawikiwiki:Manual:Upgrading|Manual:Upgrading]]
983
984 Minor updates script:
985 <source lang="bash">
986 s=/etc/cron.daily/mediawiki_update
987 dd of=$s<<'EOF'
988 #!/bin/bash
989 source ~/mw_vars
990 cd $mw
991 for dir in extensions/* skins/* $mw; do
992 [[ -d $dir ]] || continue
993 cd $dir
994 branch=$(git describe --all)
995 branch=${branch#remotes/}
996 git fetch --all -q
997 new_head=$(git rev-parse $branch)
998 log=$(git log HEAD..$new_head)
999 if [[ $log ]]; then
1000 pwd
1001 echo "$log"
1002 fi
1003 git checkout -q $new_head
1004 cd $mw
1005 done
1006 php $mw/maintenance/update.php -q
1007 EOF
1008
1009 </source>
1010
1011 == Upgrading Major Versions ==
1012
1013 Reference documentation is at [[mediawikiwiki:Manual:Upgrading]]
1014
1015 My strategy is:
1016
1017 # Read the "Upgrade notices for MediaWiki administrators" on the upgrade version and any skipped versions at [[mediawikiwiki:Version_lifecycle]].
1018 # Setup a blank test wiki with the new version.
1019 # Backup the old database, restore it to the new wiki, run php maintenance/update.php.
1020 # If everything looks good, repeat and replace the old wiki with the new one.
1021
1022 == Stopping Spam ==
1023
1024 There is a balance between effective anti-spam measures and blocking/annoying contributors. Mediawiki documentation on how to combat spam, is not very good, but it has improved over time: [https://www.mediawiki.org/wiki/Manual:Combating_spam manual: Combating Spam]. It's possible for a spammer to quickly make thousands of edits, and there is no good documentation on purging lots of spam, so you should have a good strategy up front. My current strategy is 3 fold, and is limited to small/medium wiki's:
1025
1026 * Find new spam quickly, revert it & ban the user.
1027 ** Watch, and get notified of changes on all primary content pages: Special:Preferences, Bottom of the page, set an email address, then turn on "Email me also for minor edits of pages and files."
1028 ** Use a rss/atom feed reader, and subscribe to recent changes across the wiki. Newer browsers have an rss feed subscribe button, you can click after going to Special:RecentChanges. If that is not available, you can construct the proper url based on [https://meta.wikimedia.org/wiki/Help:Recent_changes#Web_feed these instructions].
1029 * Require registration to edit, and a custom captcha question on registration.
1030 * Install all non-user inhibiting anti-spam extensions / settings that take a reasonable amount of time to figure out.
1031
1032 == Choosing Extensions ==
1033
1034 Mediawiki.org has pages for ~5200 extensions. Mediawiki maintains ~700 extensions [http://git.wikimedia.org/tree/mediawiki%2Fextensions.git in it's git repo]. Wikipedia uses [https://en.wikipedia.org/wiki/Special:Version over 100 extensions]. Major distributors package [[mediawikiwiki:Comparison_of_extensions_in_distributions| ~36 extensions]]. We looked closely at the distributor's and briefly at the Mediawiki repo extensions. We haven't found any other useful list or recommendations.
1035
1036 Here are brief descriptions of extensions that are part of distributions and why they were rejected for this wiki.
1037
1038 {| class="wikitable"
1039 |+
1040 | '''InputBox''' || Add html forms to pages. Can't imagine using it. Would install if I did.
1041 |+
1042 | '''Pdfhandler''' || Gallery of pages from a pdf file. Can't imagine using it. Would install if I did.
1043 |+
1044 | '''Footnote''' || deprecated in newer versions
1045 |+
1046 | '''NewUserNotif''' || Send me a notification when a user registers. Seems like an excessive notification.
1047 |+
1048 | '''NewestPages''' || A page creation history that doesn't expire like recent-changes. Meh
1049 |+
1050 | '''RSSReader''' || Embed an rss feed. Can't imagine using it. Would install if I did.
1051 |+
1052 | '''Openid''' || Poor UI. 2 pages & 2 links <login> <login with openid> which is confusing & ugly.
1053 |+
1054 | '''Validator''' || dependency of of semantic
1055 |+
1056 | '''Semantic''' || Seems like a lot of trouble around analyzing kinds of data which my wiki will not have.
1057 |+
1058 | '''wikicalendar''' || Make a calendar of events etc. Can't imagine using it. Would install if I did.
1059 |}
1060
1061 == Misc Notes ==
1062
1063 ''' Web Analytics Software '''
1064
1065 I do not recommend using google analytics: it's proprietary software and gives private information of your website visitors to google for them to make money. Piwik has the best features and I recommend it, but I use goaccess because it is simpler to manage and good enough.
1066
1067 ''' Mediawiki Documentation Quality '''
1068
1069 Overall the documentation is good, but like wikipedia, it depends.
1070
1071 The closer a topic is to core functionality and commonly used features, the better the documentation is likely to be. Wikimedia Foundation (WMF) has a competing priority of being a good upstream to mediawiki users and being good for their own sites. That, plus the multitude of unconnected extension developers, and official documentation is sometimes neglected in favor of bug reports, readme files, comments, code, and unpublished knowledge. User's documentation edits vary in quality, and often aren't reviewed by anyone. If you run into an issue, try viewing/diffing the most recent version of a page by the last few editors.
1072
1073 One issue is that mediawiki.org needs a lot of organizing, deleting, and verifying of material, and that is relatively unpopular, tedious, and sometimes difficult work. The discussion pages of mediawiki.org are a wasteland of unanswered questions and outdated conversations, which is [https://www.mediawiki.org/wiki/Help:Talk_pages poor form] for a wiki. However, if you communicate well, you can get great help from their [https://www.mediawiki.org/wiki/Communication support forum, irc, and mailing list].
1074
1075
1076 '''Bash here documents, EOF vs 'EOF' '''
1077
1078 Here documents are used throughout this page, some people may not be aware of a small but important syntax. When the delimiter is quoted, as in <<'EOF', then the contents of the here document are exactly verbatim. Otherwise $ and ` are expanded as in bash, and must be escaped by prefixing them with \, which itself must then also be escaped to be used literally.
1079
1080
1081 ''' Mediawiki automation tools survey 7/2014 '''
1082
1083 Barely maintained:
1084 * https://github.com/ianweller/mw
1085 * http://search.cpan.org/~markj/WWW-Mediawiki-Client/bin/mvs
1086 * https://github.com/alexz-enwp/wikitools 3000 lines of code, no response to a bug reports in 2/2014
1087
1088 Getting basic maintenance
1089 * https://github.com/mwclient/mwclient 2000 lines of code
1090
1091 Actively developed, used by wikimedia foundation a lot.
1092 * [[mediawikiwiki:Manual:Pywikibot]]
1093
1094
1095 ''' Troubleshooting Errors '''
1096
1097 If mediawiki fails to load, or shows an error in the browser, enable some settings and it will print much more useful information. [[mediawikiwiki:Manual:How to debug]]
1098
1099 ''' License '''
1100
1101 This page and this wiki is licensed under cc-by-sa 4.0.
1102 This means the code is compatible with gplv3.
1103
1104 == todo list for this page ==
1105
1106 * Check if there are any new default extensions 1.27 which I haven't evaluated.
1107 * Test for any new config values set by the 1.27 gui install method.
1108 * Get Visual editor extension.
1109 * Don't require registration for edits