User:MeowyCats2/Install CreateWiki and ManageWiki on your wiki
Note: This is less of a "tutorial" and more of a "memo" on the means by which I have been successful. Disclaimer: I, Waki285, will not be liable for any damages caused by this memo.
Note: This was done for production, but could also be used for development as an extension development.
Prerequisites
This is the environment in which I have succeeded. I am not sure if I would be successful in any other environment than this.
- VPS with 4-core CPU, 8GB memory, free IP port open, and sudo privileges
- Ubuntu Server 22.02
- Nginx 1.18.0
- MySQL 8.0.36
- Cloudflare (I bought 1 domain for this)
Procedure
- Install packages such as php-intl and mysql, which are required for a normal MediaWiki installation. We will also purchase a domain and connect it to Cloudflare.
- Extract MediaWiki to
/var/www/mediawiki
. - Enter MySQL and create a database named "testwiki".
- Write the following in
/etc/nginx/conf.d/mediawiki.conf
(the file name can be anything, but it should end with .conf), save it, and reload nginx withsystemctl reload nginx
. - Go to Cloudflare and add the following to your DNS.
- Type:
A
Name:*
IPv4 address: Your VPS IP Proxy status:Proxied
- Go to the Cloudflare SSL/TLS settings and set the SSL/TLS encryption mode to Flexible.
- At this point, go to test.[yourdomain.tld] and you should see "LocalSettings.php not found. Please set up the wiki first."
- Click "set up the wiki", set up the wiki as usual, but install the extensions AbuseFilter, Interwiki and Echo. Set the database name to "testwiki" created earlier and leave the table prefix blank.
- After setup is complete and the downloaded LocalSettings.php is in place, verify that MediaWiki starts properly.
- Install mw:Extension:AntiSpoof.
- TODO
server {
listen 80;
listen [::]:80;
server_name .yourdomain.tld; # Make sure to insert '.' first to your domain
root /var/www/mediawiki;
index index.php index.html index.htm;
location / {
rewrite ^/$ /wiki/ permanent;
}
location /wiki/ {
rewrite ^/wiki/([^\?]*) /index.php?title=$1&$args last;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; # Make sure to change it to your PHP version
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_log /var/log/nginx/mediawiki_error.log;
access_log /var/log/nginx/mediawiki_access.log;
}