MediaWiki: Difference between revisions

imported>Webxem
No edit summary
m fix mediawiki extension url
 
(4 intermediate revisions by 3 users not shown)
Line 7: Line 7:
services.mediawiki = {
services.mediawiki = {
   enable = true;
   enable = true;
  # Prior to NixOS 24.05, there is a admin name bug that prevents using spaces in the mediawiki name https://github.com/NixOS/nixpkgs/issues/298902
   name = "Sample MediaWiki";
   name = "Sample_MediaWiki";
   httpd.virtualHost = {
   httpd.virtualHost = {
     hostName = "example.com";
     hostName = "example.com";
Line 27: Line 26:
     # https://www.mediawiki.org/wiki/Extension:TemplateStyles
     # https://www.mediawiki.org/wiki/Extension:TemplateStyles
     TemplateStyles = pkgs.fetchzip {
     TemplateStyles = pkgs.fetchzip {
       url = "https://extdist.wmflabs.org/dist/extensions/TemplateStyles-REL1_40-c639c7a.tar.gz";
       url = "https://extdist.wmflabs.org/dist/extensions/TemplateStyles-REL1_40-5c3234a.tar.gz";
       hash = "sha256-YBL0Cs4hDSNnoutNJSJBdLsv9zFWVkzo7m5osph8QiY=";
       hash = "sha256-IygCDgwJ+hZ1d39OXuJMrkaxPhVuxSkHy9bWU5NeM/E=";
     };
     };
   };
   };
Line 38: Line 37:
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.
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 lang="nix">
<syntaxhighlight lang="nix">
Line 50: Line 49:
</syntaxhighlight>
</syntaxhighlight>


Alternatively, <code>services.mediawiki.webserver</code> can be set to <code>"nginx"</code> to use nginx instead of apache.
Alternatively, <code>services.mediawiki.webserver</code> can be set to <code>"nginx"</code> to use nginx instead of [[Apache HTTP Server|apache]].


== Troubleshooting ==
== Troubleshooting ==
=== Edit php.ini ===
=== 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.
A [[Phpfpm|php-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">
<syntaxhighlight lang="nix">
Line 65: Line 64:
== See Also ==
== 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]
* [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.
* [[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.
* [[Outline]], a modern web based wiki and knowledge base for teams.


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