Mediawiki: Difference between revisions

From Bitpost wiki
No edit summary
No edit summary
Line 1: Line 1:
{| class="mw-collapsible mw-collapsed wikitable"
{| class="mw-collapsible mw-collapsed wikitable"
! Updating mediawiki installation
! Install on Ubuntu
|-
| * Install by extracting to a web folder
 
* Enable Short Urls
 
This just means to get rid of the .php on the end.  Mediawiki will NOT do this for you, the silly thing.
You need to do a few silly things.  [https://www.mediawiki.org/wiki/Manual:Short_URL/Apache This] horrible mess describes it, in far too much detail.
Just add this to your apache virtual host (eg /etc/apache2/sites-enabled/000-default.conf:
    # MDM mediawiki                                                                                                                                                                                           
    RewriteEngine On
    RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
    RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
Also need to update default of /etc/apache2/apache2.conf
<Directory /var/www/>
  AllowOverride All
Also need to install mod_rewrite:
sudo a2enmod rewrite
|}
 
{| class="mw-collapsible mw-collapsed wikitable"
! Updating mediawiki
|-
|-
|
|

Revision as of 05:00, 5 February 2021

Install on Ubuntu
* Install by extracting to a web folder
  • Enable Short Urls

This just means to get rid of the .php on the end. Mediawiki will NOT do this for you, the silly thing. You need to do a few silly things. This horrible mess describes it, in far too much detail. Just add this to your apache virtual host (eg /etc/apache2/sites-enabled/000-default.conf:

   # MDM mediawiki                                                                                                                                                                                             
   RewriteEngine On
   RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
   RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]

Also need to update default of /etc/apache2/apache2.conf

<Directory /var/www/>
  AllowOverride All

Also need to install mod_rewrite:

sudo a2enmod rewrite
Updating mediawiki
cd /var/www/localhost/htdocs/mediawiki
emacs LocalSettings_redirector.php (to hardcode each site)
php maintenance/update.php
(repeat for each site)
emacs LocalSettings_redirector.php (to reset dynamic behavior)

META FTW! Mediawiki how do i love thee, let me count the ways... Here are some tricks to keep things humming.

Stick with flat lists whenever you can

  • TRUST ME you don't want to deal with numbered lists (see below if you have to)
  • Also use === Section Headers === for any page that needs scrolling - after 3 you autoget a table of contents
  • Collapsible sections like the one above are often very useful for pages with lots of small bits of info

Embed comments in a numbered list

  1. one
    some stuff
    some more stuff
  2. two

htmlets extention

These have served me well in the past for all kinds of goodies. Haven't researched the latest lately, though. When checking also check if tree formats are available.

MobileFrontend extention

This is the official one used by wikipedia. See end of LocalSettings_redirector.php for details.