User:MeowyCats2/Install CreateWiki and ManageWiki on your wiki

From Meta Wiki
Revision as of 10:54, 25 May 2024 by mh:meta>Waki285 (TODO)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

 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

  1. 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.
  2. Extract MediaWiki to /var/www/mediawiki.
  3. Enter MySQL and create a database named "testwiki".
  4. 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 with systemctl reload nginx.
  5. 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;
    }
    
  6. Go to Cloudflare and add the following to your DNS.
  7. Type: A Name: * IPv4 address: Your VPS IP Proxy status: Proxied
  8. Go to the Cloudflare SSL/TLS settings and set the SSL/TLS encryption mode to Flexible.
  9. At this point, go to test.[yourdomain.tld] and you should see "LocalSettings.php not found. Please set up the wiki first."
  10. 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.
  11. After setup is complete and the downloaded LocalSettings.php is in place, verify that MediaWiki starts properly.
  12. Install mw:Extension:AntiSpoof.
  13. TODO