MediaWiki - gdamjan/gdamjan.github.io GitHub Wiki
Some notes on MediaWiki installation. The wiki will be installed on the root url on the domain, even though that setup is not recommended by mediawiki.
- MediaWiki will be unpacked in /srv/wiki.example.net (and it will create the mediawiki-x.yy.z top dir there);
- Uploaded files will go to /srv/wiki.example.net/uploads;
- robots.txt and favicon.ico will be in /srv/wiki.example.net
These extensions are needed, and must be enabled in php.ini:
extension=gd.so extension=mysql.so extension=zlib.so extension=sockets.so extension=iconv.so extension=mbstring.so extension=dba.so
{{{#!apache <VirtualHost *:80> ServerName wiki.example.net DocumentRoot "/srv/wiki.example.net"
Alias /icons/ "/usr/share/httpd/icons/" Alias /robots.txt "/srv/wiki.example.net/robots.txt" Alias /favicon.ico "/srv/wiki.example.net/favicon.ico" Alias /images "/srv/wiki.example.net/uploads/"
- direct access for css, js and apis Alias /skins "/srv/wiki.example.net/mediawiki-1.18.1/skins/" Alias /extensions "/srv/wiki.example.net/mediawiki-1.18.1/extensions/" Alias /api.php "/srv/wiki.example.net/mediawiki-1.18.1/api.php/" Alias /load.php "/srv/wiki.example.net/mediawiki-1.18.1/load.php/"
- this one is needed only for the instalation (and upgrades) Alias /mediawiki-1.18.1/ "/srv/wiki.example.net/mediawiki-1.18.1/"
Alias /index.php "/srv/wiki.example.net/mediawiki-1.18.1/index.php/" Alias / "/srv/wiki.example.net/mediawiki-1.18.1/index.php/"
<Directory "/srv/wiki.example.net"> Order allow,deny Allow from all </Directory> </VirtualHost> }}}
This file instructs crawlers to avoid pages that are expensive and generally not needed in indexes:
User-agent: * Disallow: /index.php/ Disallow: /mediawiki-1.18.1/ Disallow: /Special:Search Disallow: /Special:Random
Make sure at least these settings are correct in LocalSettings.php:
$wgScriptPath = ""; $wgArticlePath = '/$1'; $wgUsePathInfo = true; $wgUploadDirectory = "/srv/wiki.example.net/uploads";
If Apache config file is not editable, this .htaccess might work:
{{{#!apache RewriteEngine On
RewriteRule ^favicon.ico$ - [L] RewriteRule ^robots.txt$ - [L]
RewriteRule ^images/(.*)$ uploads/$1 [L]
RewriteRule ^skins/(.*)$ mediawiki/skins/$1 [L] RewriteRule ^extensions/(.*)$ mediawiki/extensions/$1 [L]
RewriteRule ^api.php$ mediawiki/api.php [L,QSA] RewriteRule ^load.php$ mediawiki/load.php [L,QSA] RewriteRule ^index.php/(.*)$ mediawiki/index.php?title=$1 [L,QSA] RewriteRule ^$ mediawiki/index.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ mediawiki/index.php?title=$1 [NS,L,QSA] }}}
# media wiki location /resources { alias /usr/share/webapps/mediawiki/resources/; } location /skins { alias /usr/share/webapps/mediawiki/skins/; } location / { include uwsgi_params; uwsgi_pass 127.0.0.1:3035; uwsgi_modifier1 14; }
[uwsgi] master = true socket = 127.0.0.1:3035 plugins = php php-docroot = /usr/share/webapps/mediawiki php-allowed-ext = /usr/share/webapps/mediawiki/index.php php-allowed-ext = /usr/share/webapps/mediawiki/load.php php-allowed-ext = /usr/share/webapps/mediawiki/api.php # this is required only for the installation wizard #php-allowed-ext = /usr/share/webapps/mediawiki/mw-config/index.php php-set = open_basedir=/tmp/:/usr/share/pear/:/usr/share/webapps/mediawiki:/var/lib/mediawiki/ php-set = date.timezone=Europe/Skopje processes = 5 cheaper = 1 chdir = /var/lib/mediawiki/