Jump to content

MediaWiki: Difference between revisions

m
imported>Alyaeanyx
mNo edit summary
 
(14 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[https://www.mediawiki.org/wiki/MediaWiki MediaWiki] is available as a [[Module|NixOS module]].
[https://mediawiki.org/ {{PAGENAME}}] ([[wikipedia:en:{{PAGENAME}}]]) is available as a [[module]].
Sample configuration:
 
<syntaxhighlight>
== Configuration Examples ==
=== Small Configuration ===
 
<syntaxhighlight lang="nix">
services.mediawiki = {
services.mediawiki = {
   enable = true;
   enable = true;
   name = "Sample MediaWiki instance";
   name = "Sample MediaWiki";
   virtualHost = {
   httpd.virtualHost = {
     hostName = "example.com";
     hostName = "example.com";
     adminAddr = "admin@example.com";
     adminAddr = "admin@example.com";
   };
   };
   passwordFile = "/var/mediawiki/passwordFile"; # put the initial password for the admin account here
   # Administrator account username is admin.
  # Set initial password to "cardbotnine" for the account admin.
  passwordFile = pkgs.writeText "password" "cardbotnine";
   extraConfig = ''
   extraConfig = ''
     # Disable anonymous editing
     # Disable anonymous editing
Line 16: Line 21:


   extensions = {
   extensions = {
     VisualEditor = pkgs.fetchzip {
    # some extensions are included and can enabled by passing null
       url = "https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_37-3aeea63.tar.gz";
     VisualEditor = null;
       sha256 = "sha256:0y7yysnm64vclyj0nh18ibsbrwsycdi7f8mf8j1b991qggqnclys";
 
    # https://www.mediawiki.org/wiki/Extension:TemplateStyles
    TemplateStyles = pkgs.fetchzip {
       url = "https://extdist.wmflabs.org/dist/extensions/TemplateStyles-REL1_40-c639c7a.tar.gz";
       hash = "sha256-YBL0Cs4hDSNnoutNJSJBdLsv9zFWVkzo7m5osph8QiY=";
     };
     };
   };
   };
Line 24: Line 33:
</syntaxhighlight>
</syntaxhighlight>


By default, the <code>services.mediawiki</code> module creates a <code>services.httpd.virtualHost</code> which can be configured via the <code>services.mediawiki.virtualHost</code> submodule.
== Web Server ==
 
By default, the <code>services.mediawiki</code> module creates a <code>services.httpd.virtualHost</code> which can be configured via the <code>services.mediawiki.httpd.virtualHost</code> submodule.


If you are using another web server (like Nginx), you can configure MediaWiki for a reverse proxy with the <code>services.mediawiki.virtualHost.listen</code> option:
If you are using another web server (like Nginx), you can configure MediaWiki for a reverse proxy with the <code>services.mediawiki.virtualHost.listen</code> option:
<syntaxhighlight>
 
services.mediawiki.virtualHost.listen = [
<syntaxhighlight lang="nix">
   ip = "127.0.0.1";
services.mediawiki.httpd.virtualHost.listen = [
  port = 8080;
   {
  ssl = false;
    ip = "127.0.0.1";
} ];
    port = 8080;
    ssl = false;
  }
];
</syntaxhighlight>
 
Alternatively, <code>services.mediawiki.webserver</code> can be set to <code>"nginx"</code> to use nginx instead of apache.
 
== Troubleshooting ==
=== Edit php.ini ===
An fpm pool is automatically created when Mediawiki is enabled. The <code>php.ini</code> file can be modified by using <code>phpOptions</code>. The following example shows how to increase the allowed file upload size.
 
<syntaxhighlight lang="nix">
services.phpfpm.pools.mediawiki.phpOptions = ''
    upload_max_filesize = 10M
    post_max_size = 15M
'';
</syntaxhighlight>
</syntaxhighlight>


== See Also ==


* [https://github.com/NixOS/nixos-wiki-infra Configuration of the NixOS wiki]
* [https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/mediawiki.nix nixos/tests/mediawiki.nix]
* [[Dokuwiki]], simple PHP- and web-based wiki software which uses file based storage for its content.
* [[Outline]], a modern web based wiki and knowledge base for teams.




[[Category:Guide]]
[[Category:Guide]]
[[Category:Applications]]
[[Category:Server]]
[[Category:Web Applications]]
trusted
596

edits