VisualEditor/Installation on a shared host
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. parsoid has been integrated into the core and the versions that required the node.js version are obsolete see Parsoid for more information. |
This page describes a hack, not an official setup. |
VisualEditor requires a Parsoid service, which in turn requires Node.js. Most shared-hosting companies don't provide this. If you cannot move your wiki to a dedicated hosting solution such as a VPS, then a workaround is to install Parsoid on a cloud platform which supports Node.js, such as Heroku.com.
Part 1: Heroku.com
edit- Sign up with Heroku.com
- Create a new app
- Go to your app settings
- Scroll to the Buildpack section
- Add a new buildpack
- Select Node.js
Part 2: Your local computer
edit- Install the Heroku Command Line Interface and log in
- Clone Parsoid with
git clone https://gerrit.wikimedia.org/r/mediawiki/services/parsoid
- Enter the Parsoid directory you just created, for example with
cd parsoid
- Edit the hidden file
.gitignore
and remove the linesconfig.yaml
andcomposer.lock
- Create your config file by copying
config.example.yaml
and renaming it toconfig.yaml
- Edit the
config.yaml
file you just created by changing the example URI for the URL of your API, for exampleuri: 'http://www.mywiki.com/w/api.php'
- If your wiki uses https, then uncomment the line
strictSSL: false
- If the
domain: 'localhost'
line is uncommented, comment it (helps to avoid the "Invalid domain" error) - Save the changes
- Add the Heroku remote to your git repo with
heroku git:remote -a APPNAME
- Stage the edited config files for committing with
git add .
- Commit your changes with
git commit -am "Initial commit"
- Push and deploy your changes with
git push heroku master
- Visit https://APPNAME.herokuapp.com to verify that your Parsoid service works
Part 3: Your wiki
edit- Download VisualEditor (don't forget to run
git submodule update --init
as explained in the link) - Add to your LocalSettings.php:
wfLoadExtension( 'VisualEditor' ); $wgVisualEditorEnableWikitext = true; $wgDefaultUserOptions['visualeditor-newwikitext'] = 1; $wgDefaultUserOptions['visualeditor-enable'] = 1; $wgDefaultUserOptions['visualeditor-editor'] = 'visualeditor'; $wgVirtualRestConfig['modules']['parsoid'] = [ 'forwardCookies' => true, 'url' => 'https://APPNAME.herokuapp.com' ];
- Done! Visit your wiki, edit any page and save the changes to test it out!