Mediawiki
Jump to navigation
Jump to search
Update
- sudo apt-get update
- sudo apt-get upgrade
Install mysql, apache etc
- ----SUPERCEDED
- ----sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring
- </SUPERCEDED>
- ----sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring
with buster version of Raspbian (Debian) mysql-server has been replaced by mariadb, so use
- sudo apt-get install apache2 mariadb-server-10.0 php php-mysql libapache2-mod-php php-xml php-mbstring
Get mediawiki
- ----NOT RECOMMENDED as latest version of mediawiki is rarely available
- sudo apt-get install mediawiki
- </NOT RECOMMENDED>
- sudo apt-get install mediawiki
- get latest version (e.g. v1.34.4)
- mkdir tmp
- cd tmp
- wget https://releases.wikimedia.org/mediawiki/1.3x/mediawiki-1.3x.n.tar.gz
- tar -xvzf mediawiki-1.3x.n.tar.gz
- sudo mkdir /var/lib/mediawiki-1.3x.n
- sudo mv mediawiki-1.3x.n/* /var/lib/mediawiki-1.3x.n
- sudo ln -sfT /var/lib/mediawiki-1.3x.n /var/lib/mediawiki
- Configuring and hardening security
- Configure MySQL
- sudo mysqladmin -u root password "enter the new password here"
- sudo mysql_secure_installation
- and follow defaults
- Create user for mediawiki
- sudo mysql
- > CREATE DATABASE <databasename>;
- > CREATE USER 'mediawiki'@'localhost' IDENTIFIED BY '<password>';
- > USER <databasename>;
- > GRANT SELECT, INSERT, UPDATE, DELETE, ALTER ON <databasename>.* TO 'mediawiki'@'localhost';
- less secure alternativeGRANT ALL PRIVILEGES ON *.* TO 'mediawiki'@'localhost' IDENTIFIED BY 'password';
- Configure PHP
- Edit /etc/php/7.3/apache2/php.ini
- set
- upload_max_filesize = 20M
- memory_limit = 128M
- register_globals = Off
- allow_url_fopen = Off
- session.use_trans_sid = 0
- set
- Configure MediaWiki
- cd /var/www/html
- sudo ln -s /var/lib/mediawiki mediawiki
- goto http://<hostname>/mediawiki to configure using mysql username and database created earlier
- copy LocalSettings.php to /var/lib/mediawiki on host
- and harden suecurity
- change ownership of mediawiki files
- chown -R <username>:<username> /path/to/mediawiki/
- where <username> could be your own username but not root or apache user www-data
- but mediawiki needs access to images (and cache if using)
- chown -R www-data:www-data /path/to/mediawiki/images
- chown -R www-data:www-data /path/to/mediawiki/cache
- and ensure no write access to other users
- chmod -R go-w /path/to/mediawiki
OAuth
Extension:OAuth documentation: https://www.mediawiki.org/wiki/Extension:OAuth
- Download and place the file(s) in a directory called OAuth in your extensions/ folder.
- Add the following code at the bottom of your LocalSettings.php:
- wfLoadExtension( 'OAuth' );
- Run the update script which will automatically create the necessary database tables that this extension needs.
- Configure the general parameters as required.
- Configure the user rights by putting them into the relevant groups in $wgGroupPermissions.
- Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Custom modifications
- RecipeIndex
- to be written