MediaWiki/Deployment

From Bibliotheca Anonoma
Revision as of 21:54, 10 April 2017 by Antonizoon (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Now, the MediaWiki code itself can be set up. Download the MediaWiki code using the following command, then unzip and move to :

curl -O https://releases.wikimedia.org/mediawiki/1.28/mediawiki-1.28.1.tar.gz
tar xvzf mediawiki-1.28.1.tar.gz
sudo mv mediawiki-1.28.1 /var/www/
sudo ln -s /var/www/mediawiki-1.28.1 /var/www/mediawiki
sudo chown www-data:www-data -R /var/www/mediawiki/mediawiki-1.28.1 # debian and ubuntu only
sudo chown nginx:nginx -R /var/www/mediawiki/mediawiki-1.28.1 # centos only

Configuration

Start the MediaWiki configuration by going to http://your-server-ip.org/mw-config/:

The installation will prompt you for your MySQL/MariaDB username and password, as well as the database name. Default extensions can then be enabled and disabled.

After the configuration is complete, you will receive a LocalSettings.php file with the configurations created. Upload this file to the server using sftp, replacing the placeholders with your username and your server domain:

sftp <em>[email protected]</em> (your-username at your-server dot org)

Then move the LocalSettings.php file to the /var/www/mediawiki/ directory.

Finally, uncomment these two sections of LocalSettings.php:

location ^~ /mw-config/ { internal; } #Uncomment after installation

And:

# Uncomment after installation!
location / {
  index index.php;
  rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&amp;$2 last;
}

Restart the nginx server to load the new configuration. Your MediaWiki site is ready to use.

sudo systemctl restart nginx