MediaWiki: Difference between revisions

php-fpm
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
I'm using the [http://www.mediawiki.org/wiki/MediaWiki MediaWiki] software from the WikiMedia Foundation to power my wikis. MediaWiki is written in PHP5, and thus precludes the use of a multi-threaded version of [http://www.apache.org Apache].
I'm using the [http://www.mediawiki.org/wiki/MediaWiki MediaWiki] software from the WikiMedia Foundation to power my wikis. '''The following information is largely [[Debian]]-specific.'''
 
==Use with Apache==
By default (at least on Debian), MediaWiki's PHP is run within Apache's PHP module <tt>mod_php</tt>. This can only be safely run under the multiprocess [https://httpd.apache.org/docs/2.4/mod/prefork.html mpm_prefork] paradigm. To use the (generally superior) [https://httpd.apache.org/docs/2.4/mod/worker.html mpm_worker] or [https://httpd.apache.org/docs/2.4/mod/event.html mpm_event] modules, one ought employ [https://www.php.net/manual/en/install.fpm.php php-fpm], the PHP "fast process manager" (note that FastCGI is also a thing. I don't know much about it).


==Installing MediaWiki==
==Installing MediaWiki==
'''The following information is largely [[Debian]]-specific.'''
* Have handy the administrator account/password for your MySQL installation.
* Have handy the administrator account/password for your MySQL installation.
** I advise you to install MySQL ''before'' MediaWiki, not as a single <tt>apt</tt> step.
** I advise you to install MySQL ''before'' MediaWiki, not as a single <tt>apt</tt> step.
Line 49: Line 51:
** Load <tt>Mediawiki:mainpage</tt>, and update it to reflect this change
** Load <tt>Mediawiki:mainpage</tt>, and update it to reflect this change
* Optionally, remove the 'discussion' tab:
* Optionally, remove the 'discussion' tab:
** Edit <tt>mediawiki/includes/SkinTemplate.php</tt>, and comment out the following:<code>
** Edit [[MediaWiki:Common.css]], and add the following:<code>#ca-talk { display:none!important; }</code>
$content_actions['talk'] = $this->tabAction(
** Ensure <tt>$wgUseSiteCss=true</tt> in LocalSettings.php
                                $talkpage,
                                'talk',
                                $this->mTitle->isTalkPage() && !$prevent_active_tabs,
                                '',
                                true);</code>
===Managing Uploads===
===Managing Uploads===
* Enable uploads: <tt>sudoedit /etc/mediawiki/LocalSettings.php</tt> and add
* Enable uploads: <tt>sudoedit /etc/mediawiki/LocalSettings.php</tt> and add
** <code>$wgEnableUploads = true;</code>
** <code>$wgEnableUploads = true;</code>
* Support uploading non-images: <tt>sudoedit /etc/mediawiki/LocalSettings.php</tt> and add
* Support uploading non-images: <tt>sudoedit /etc/mediawiki/LocalSettings.php</tt> and add
** <code>$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'pdf', 'ps', 'xls', 'txt', 'svg' );</code>
** <pre>$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'pdf', 'ps', 'xls', 'txt', 'svg' );</pre>
** Supposedly, all types can be allowed via:<code>
** Supposedly, all types can be allowed via:
<pre>
  $wgCheckFileExtensions = false;
  $wgCheckFileExtensions = false;
  $wgStrictFileExtensions = false;
  $wgStrictFileExtensions = false;
  $wgVerifyMimeType = false;
  $wgVerifyMimeType = false;
  $wgFileBlacklist = array();
  $wgFileBlacklist = array();
  $wgMimeTypeBlacklist= array();</code>
  $wgMimeTypeBlacklist= array();
</pre>
* To allow files larger than the default 2M to be uploaded, edit the value of <tt>upload_max_filesize</tt> in <tt>/etc/php.ini</tt>
* To allow files larger than the default 2M to be uploaded, edit the value of <tt>upload_max_filesize</tt> in <tt>/etc/php.ini</tt>
** This requires a web server restart to take effect
** This requires a web server restart to take effect
===System strings===
Most strings in e.g. sidebars can be edited in the Special:AllMessages area. To see what message key a string corresponds to, add "uselang=qqx" to a URI, e.g. https://nick-black.com/dankwiki/index.php?title=User:Dank&uselang=qqx.
==Moving a wiki==
There's a [http://www.mediawiki.org/wiki/Manual:Moving_a_wiki manual entry] on this. My notes follow:
* The uploaded files are '''not''' stored in your database, and need be copied by themselves
** By default, this is the 'images' directory off your wiki toplevel
** Use a copying method that preserves timestamps, such as tar
* Be sure you grab your configuration files, particularly /etc/mediawiki/LocalSettings.php
* You will also likely want to transfer your web server config as it relates to the wiki
* If you're using Mediawiki account permissions only, they'll be stored in your wiki database
** Otherwise, you'll of course need to copy over and prepare this supporting infrastructure
* Export your database with mysqldump as explained in the manual, and import it on the new machine
* If you can't do a database dump/load, you can do an XML export of all your pages
** This won't copy things like account data!


==Maintenance==
==Maintenance==
Line 99: Line 114:
Wikipedia's tutorials and the Mediawiki help pages are the best references here:
Wikipedia's tutorials and the Mediawiki help pages are the best references here:
* [http://en.wikipedia.org/wiki/Image_tutorial Wikipedia image tutorial]
* [http://en.wikipedia.org/wiki/Image_tutorial Wikipedia image tutorial]
I also have [[MediaWiki editing|some information]].
===Editing permissions===
Some editing capabilities are by default disabled even for sysops:
<pre>
$wgGroupPermissions['sysop']['deleterevision']  = true;
$wgGroupPermissions['sysop']['editsitecss']  = true;
$wgGroupPermissions['sysop']['editsitejs']  = true;
</pre>


==See Also==
==See Also==
* [http://www.debian-administration.org/articles/137 mod_deflate configuration] for [[Debian]]
* [http://www.debian-administration.org/articles/137 mod_deflate configuration] for [[Debian]]