User:Dantman/Server Config Notes

Apache

 * RewriteRules support a useful %{DOCUMENT_ROOT} variable.
 * Alias does not support %{DOCUMENT_ROOT}.
 * Need to double check whether RewriteRule supports %{DOCUMENT_ROOT} when in Apache config instead of .htaccess.

Basic .htaccess base:

Line to redirect the root to the wiki (if it's blank):

Case needed for root urls:

Root config basics:

Doesn't work with root URLs, you'll need to use rewrite rules in-config.

MediaWiki built-in short URL generator notes
Thanks to Apache's Alias directive the install path can be different than the actual document root. So sometimes the  rules will be invalid. The configuration tool will need to differentiate between these two situations. In theory this can be done by looking at the  MediaWiki is installed in that   is based on, , the directory path in some of the   values, and the known relative path of the current file.

Nginx

 * Don't know how to efficiently reproduce the Apache IE6 fix in Nginx.

Lighttpd

 * Install steps
 * General packages to install: php5-cli, php-apc, php5-mysql, mysql-server, and lighttpd
 * If using php5-cgi and Lighttpd's built in process handling:
 * Packages: php5-cgi
 * Setup fastcgi support with
 * If using php5-fpm:
 * Packages: php5-fpm
 * Setup fastcgi support with
 * -not done yet-
 * Install MediaWiki normally
 * Uncommented the "mod_rewrite", in server.modules
 * Added the rewrite rules.

Short URLs
When installing /phase3/index.php with short URL /wiki/$1 used this config:

When installing /index.php with short URL /wiki/$1 used this config:

When installing /index.php with root URL /$1 used this config:

Other config bits
Error handler (when we build support for this into MediaWiki):

404 Image error handler (till we build support for this into MediaWiki):

IIS

 * Need a unique name="" for each
 * appendQueryString="true" is necessary for QUERY_STRING to be correct.
 * logRewrittenUrl="false" tells IIS to log the original /wiki/$1 url instead of the index.php url inside logs.

Basic rewrite:

Rewrite for root urls:

Rule to rewrite root of the domain to the mainpage when a subdirectory is used:

All these rules are part of a config file that looks like:

Sending 404 errors to index.php in the future: