MediaWiki/Deployment: Difference between revisions

From Bibliotheca Anonoma
(Created page with "Now, the MediaWiki code itself can be set up. Download the MediaWiki code using the following command, then unzip and move to : {{bc| curl -O https://releases.wikimedia.org/m...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
sudo mv mediawiki-1.28.1 /var/www/
sudo mv mediawiki-1.28.1 /var/www/
sudo ln -s /var/www/mediawiki-1.28.1 /var/www/mediawiki
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
}}
}}


Line 28: Line 30:
And:
And:


{{bc|
{{bc|<nowiki>
# Uncomment after installation!
# Uncomment after installation!
location / {
location / {
Line 34: Line 36:
   rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&amp;$2 last;
   rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&amp;$2 last;
}
}
}}
</nowiki>}}


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


{{bc|sudo systemctl restart nginx}}
{{bc|sudo systemctl restart nginx}}

Latest revision as of 21:54, 10 April 2017

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[edit]

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