IT Wiki

From CES IT Wiki
Revision as of 20:35, 3 September 2019 by Peterstevens (talk | contribs) (Configuration: Added mwjobrunner info.)
Jump to navigation Jump to search
IT Wiki
IP address 192.241.158.155
Domain name ces-wiki.fas.harvard.edu
Droplet name ces-wiki-prod
Operating system Ubuntu 16.04.4 x64
Host DigitalOcean
Region NYC1
Creation Date June 8, 2018

IT wiki is an Ubuntu-based Digital Ocean droplet. It hosts the CES IT wiki, which is powered by MediaWiki. It has weekly backups provided by Digital Ocean. SSL certificates are provided by Let's Encrypt.

Configuration

VisualEditor installation

VisualEditor is a MediaWiki extension written in PHP. It is located in /var/www/html/extensions. MediaWiki's configuration file is /var/www/html/LocalSettings.php. MediaWiki has been configured to load VisualEditor, and to access the Parsoid via http://localhost:8000. VisualEditor is not loaded by default for each user. They must elect to edit with Visual Editor.

It requires Parsoid, a Node.js package. Node.js runs independently of Apache. The VisualEditor uses an API via HTTP on port 8000 to interact with Parsoid. This traffic is not encrypted because it does not leave the host. Parsoid's configuration file is located at /usr/local/lib/node_modules/parsoid/config.yaml. It is copied from the default packaged configuration at config-example.yaml.

The CES wiki API is not at the default address, https://ces-wiki.fas.harvard.edu/w/api.php. The Parsoid configuration has been updated to reflect the correct address, https://ces-wiki.fas.harvard.edu/api.php. Because the wiki is private, Parsoid cannot access the wiki API without a password. Permissions have been updated to be public for the localhost and private for the rest of the world. It does not test for the literal "localhost" but rather the server's IP address, 192.241.158.155.

MediaWiki was updated to 1.33 because VisualEditor was not compatible with 1.30.

To start Parsoid, navigate to /usr/local/lib/node_modules/parsoid, and run npm start. This process will end as soon as the terminal is closed, causing VisualEditor to fail to load.

PM2

To run Parsoid as a daemon, the Node.js package pm2 was installed. To start Parsoid as a service, run the following:

pm2 start /usr/local/lib/node_modules/parsoid/bin/server.js

Backing up the databases

The databases can be backed up using the following command:

mysqldump --all-databases > ~/Backups/$(date +%F)_wiki_db_backup.sql

Backups are stored in /home/peterstevens/Backups. Old backups do not clear out. Additionally, DigitalOcean backs up the entire server image once a week.

Updating MediaWiki

Always back up the database and the image assets before updating. MediaWiki can be updated by creating new directory /var/www/html_upgrade and unzipping the latest copy of MediaWiki there. Then, copy the following files and directories from /var/www/html:

  • LocalSettings.php
  • images
  • skins
  • resources/assets/Blocks_RGB_160.png
  • resources/assets/favicon-16x16.png

Set html_upgrade permissions to 755. Rename html to html_old, and rename html_upgrade to html. At this point, requests to the server will likely fail, because the database schema has not been updated. Change directory to /var/www/html/maintenance, and run the following command:

php update.php

If the schema hasn't been changed, a rollback is as simple as renaming html back to html_upgrade, and html_old back to html. If the schema has changed, the database will need to be blown up and recreated using the latest backup.

Job runner

There is a bash script at /usr/local/bin/mwjobrunner which runs MediaWiki maintenance scripts every ten seconds. It is based on this webpage: https://www.mediawiki.org/wiki/Manual:Job_queue#Simple_service_to_run_jobs

Cron jobs

The database is backed up once a day at midnight. Let's Encrypt renews its certificate every three months.

Restarting

If you restart the server, the necessary daemons may not run at startup. Apache, MySQL, and Parsoid may need to be started manually.

Mail

In order for MediaWiki to send mail, Peter Stevens installed PEAR, Mail, and Net_SMTP. It is currently configured to send from peterstevens@fas.harvard.edu. This will be updated with a new address. The configurations for the SMTP server are located in /var/www/html/LocalSettings.php. Mail and Net_SMTP are PHP packages located in /usr/share/php/.

Logs

  • /var/log/apache2
  • /var/log/php7
  • /var/log/mysql

Installed software

Binaries

  • Apache 2.4.18
  • MariaDB 10.0.34
  • PHP 7.0.30-0
  • ImageMagick 7.0.8-8 Q16 x86_64 2018-07-26
  • Node.js 10.16.3
  • PEAR 1.10.1

Web applications and extensions

  • MediaWiki 1.33.0
  • VisualEditor 1.33

PEAR packages

  • Archive_Tar 1.4.0
  • Console_Getopt 1.4.1
  • Mail 1.4.1
  • Net_SMTP 1.8.1
  • Net_Socket 1.2.2
  • PEAR 1.10.1
  • PEAR_Manpages 1.10.0
  • Structures_Graph 1.1.1
  • XML_Util 1.3.0

Node packages

  • pm2 3.5.1
  • Parsoid 0.10.0

Apache modules

  • core_module (static)
  • so_module (static)
  • watchdog_module (static)
  • http_module (static)
  • log_config_module (static)
  • logio_module (static)
  • version_module (static)
  • unixd_module (static)
  • access_compat_module (shared)
  • alias_module (shared)
  • auth_basic_module (shared)
  • authn_core_module (shared)
  • authn_file_module (shared)
  • authz_core_module (shared)
  • authz_host_module (shared)
  • authz_user_module (shared)
  • autoindex_module (shared)
  • deflate_module (shared)
  • dir_module (shared)
  • env_module (shared)
  • filter_module (shared)
  • mime_module (shared)
  • mpm_prefork_module (shared)
  • negotiation_module (shared)
  • php7_module (shared)
  • rewrite_module (shared)
  • setenvif_module (shared)
  • status_module (shared)

PHP Modules

  • apcu
  • calendar
  • Core
  • ctype
  • date
  • dom
  • exif
  • fileinfo
  • filter
  • ftp
  • gettext
  • hash
  • iconv
  • imagick
  • intl
  • json
  • libxml
  • mbstring
  • mcrypt
  • mysqli
  • mysqlnd
  • openssl
  • pcntl
  • pcre
  • PDO
  • pdo_mysql
  • Phar
  • posix
  • readline
  • Reflection
  • session
  • shmop
  • SimpleXML
  • sockets
  • SPL
  • standard
  • sysvmsg
  • sysvsem
  • sysvshm
  • tokenizer
  • wddx
  • xml
  • xmlreader
  • xmlwriter
  • xsl
  • Zend OPcache
  • zlib