IT Wiki
| 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 addess is not the default, 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.phpimagesskinsresources/assets/Blocks_RGB_160.pngresources/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.
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.
Installed Software
Native software
- 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
Web applications
- MediaWiki 1.33.0
- VisualEditor 1.33
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