Difference between revisions of "MediaWiki:Migrate from old server to new server"
| Line 19: | Line 19: | ||
- Database base name : wikipp | - Database base name : wikipp | ||
| + | |||
- Database user name: rootwiki | - Database user name: rootwiki | ||
| − | - Privileges: | + | |
| + | - Privileges: | ||
| + | |||
GRANT USAGE ON *.* TO 'rootwiki'@'mw1002.dfw.labnet' | GRANT USAGE ON *.* TO 'rootwiki'@'mw1002.dfw.labnet' | ||
GRANT ALL PRIVILEGES ON `wikipp`.* TO 'rootwiki'@'mw1002.dfw.labnet' | GRANT ALL PRIVILEGES ON `wikipp`.* TO 'rootwiki'@'mw1002.dfw.labnet' | ||
| − | == | + | ==Mediawiki server installtion and configuration== |
| + | The mediawiki server (mw1002) is running Debian Stretch 9 install: | ||
| + | |||
| + | - PHP 7.3 | ||
| + | |||
| + | - Niginx 1.17 | ||
| + | |||
| + | - php-luasandbox : this is needed otherwise when you run the update.php script, you will have a lot of errors. | ||
| + | |||
| + | sudo apt-get install php-luasandbox | ||
| + | |||
| + | - create a repertory under /srv named mediawiki | ||
| + | sudo mkdir /srv/mediawiki | ||
| + | sudo chown www-data:www-date /srv/mediawiki | ||
| + | sudo chmod 0755 /srv/mediawiki | ||
| + | |||
| + | ===Niginx configuration=== | ||
| + | server { | ||
| + | listen 443 ssl http2; | ||
| + | listen [::]:443 ssl http2; | ||
| + | server_name mw1002.dfw.labnet; | ||
| + | root /srv/mediawiki; | ||
| + | index index.php; | ||
| + | |||
| + | ssl_certificate /etc/ssl/certs/wildcard.tx.labnet.crt; | ||
| + | ssl_certificate_key /etc/ssl/private/wildcard.tx.labnet.key; | ||
| + | |||
| + | # ssl_trusted_certificate /etc/ssl/certs/GlobalSign.crt; | ||
| + | |||
| + | add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"; | ||
| + | |||
| + | charset utf-8; | ||
| + | gzip on; | ||
| + | gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; | ||
| + | |||
| + | location / { | ||
| + | try_files $uri $uri/ /index.php?$query_string; | ||
| + | } | ||
| + | |||
| + | location /api/v0 { | ||
| + | try_files $uri $uri/ /api_v0.php?$query_string; | ||
| + | } | ||
| + | |||
| + | location ~ \.php { | ||
| + | # include fastcgi.conf; | ||
| + | include fastcgi_params; | ||
| + | fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
| + | fastcgi_pass unix:/var/run/php/fpm-www.sock; | ||
| + | fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | |||
==Mediawiki installation== | ==Mediawiki installation== | ||
===Download Mediawiki=== | ===Download Mediawiki=== | ||
Revision as of 09:04, 1 August 2019
Mediawiki is the same software used in Wikipedia. In this tutorial, we are going to move an existing wiki we have already setup to another server. The wiki we are moving is the same wiki I am writing this tutorial on (https://papaulgigitech.com). I am going to move this wiki to a local server in a lab environment.
Prerequisites
- 1 data base server : db1006.dfw.labnet
- 1 Mediawiki server : mw1002.dfw.labnet
- PHP 7.3
- 10.1.38-MariaDB
- Nginx 1.17
- Debain Stretch (9)
Installation
Data base server installtion and configuration
The database server (db1006.dfw.labnet) is running Debian Stretch 9 with MariaDb version 10.1.38. We will not cover the installing of Debian and MariaDB in this tutorial. Once you have your database serve ready, create a databasese for your new Wiki. See Database information below
- Database base name : wikipp
- Database user name: rootwiki
- Privileges:
GRANT USAGE ON *.* TO 'rootwiki'@'mw1002.dfw.labnet' GRANT ALL PRIVILEGES ON `wikipp`.* TO 'rootwiki'@'mw1002.dfw.labnet'
Mediawiki server installtion and configuration
The mediawiki server (mw1002) is running Debian Stretch 9 install:
- PHP 7.3
- Niginx 1.17
- php-luasandbox : this is needed otherwise when you run the update.php script, you will have a lot of errors.
sudo apt-get install php-luasandbox
- create a repertory under /srv named mediawiki
sudo mkdir /srv/mediawiki sudo chown www-data:www-date /srv/mediawiki sudo chmod 0755 /srv/mediawiki
Niginx configuration
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mw1002.dfw.labnet;
root /srv/mediawiki;
index index.php;
ssl_certificate /etc/ssl/certs/wildcard.tx.labnet.crt;
ssl_certificate_key /etc/ssl/private/wildcard.tx.labnet.key;
- ssl_trusted_certificate /etc/ssl/certs/GlobalSign.crt;
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload";
charset utf-8;
gzip on;
gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /api/v0 {
try_files $uri $uri/ /api_v0.php?$query_string;
}
location ~ \.php {
# include fastcgi.conf;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/fpm-www.sock;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}