Satria (Diskussion | Beiträge) |
Satria (Diskussion | Beiträge) K (→Starten aus einem Netzwerkpfad) |
||
Zeile 46: | Zeile 46: | ||
Alter Inhalt:<br> | Alter Inhalt:<br> | ||
− | <code><poem> | + | <code><poem class="toccolours"> |
if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) { | if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) { | ||
global $IP; | global $IP; | ||
Zeile 54: | Zeile 54: | ||
Neuer Inhalt:<br> | Neuer Inhalt:<br> | ||
− | <code><poem> | + | <code><poem class="toccolours"> |
if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' | if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' | ||
<b>&& substr ($filename, 0, 2) != "\\\\")</b> | <b>&& substr ($filename, 0, 2) != "\\\\")</b> |
Version vom 22. August 2014, 10:14 Uhr
Inhaltsverzeichnis
Geschwindigkeit erhöhen
Aaron Schulz
- Use cache.
- To LocalSettings.php, add (replace paths as needed):
Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMessageCacheType = CACHE_ACCEL;
$wgCacheDirectory = '<SOME DIRECTORY>';
$wgParserCacheType = CACHE_ACCEL;
$wgMemCachedServers = array();
$wgUseGzip = true;
$wgEnableSidebarCache = true;
NO DB HITS!
$wgDisableCounters = true;
$wgMiserMode = true;
Text cache
$wgCompressRevisions = true;
$wgRevisionCacheExpiry = 3*24*3600;
$wgParserCacheExpireTime = 14*24*3600;
- Diffs
$wgDiff = 'C:/Server/xampp/htdocs/MW/bin/GnuWin32/bin/diff.exe';
$wgDiff3 = 'C:/Server/xampp/htdocs/MW/bin/GnuWin32/bin/diff3.exe';
- Set $wgCacheDirectory (above) to use interface message caching.
- Set up caching squid servers if possible. Otherwise, at least enable file caching.
- Set up Memcached if possible. If you do, set $wgMainCacheType and $wgParserCacheType to CACHE_MEMCACHED in LocalSettings.php instead. This is recommended if you have a cluster of servers.
- Run php maintenance/rebuildFileCache.php if you use file caching (not squids).
- Set $wgJobRunRate to 0 and set up a crontab or shell script to run jobs (like this with this for example). With $wgJobRunRate at 0 and the above changes, you should be able to avoid db hits on many requests.
- Set $wgDiff and $wgDiff3 to gnu diff utility (download as needed). This is recommended. The default PHP diff code is slow and crashy.
- Edit the MediaWiki:Aboutsite and MediaWiki:Pagetitle system messages by changing {{SITENAME}} into your site name. This avoids extra parsing on each hit.
- If you really need hitcounters, use $wgHitcounterUpdateFreq instead of the $wgDisableCounters setting above.
- In the webserver's php.ini file. Make sure realpath_cache_size is set, perhaps to 512k or more.
- Consider enabling EnableMMAP and EnableSendfile in httpd.conf (for Apache). Please read the apache docs for NFS and compatibility issues first.
- [MySQL] Set your mysql server config files to only use server modes corresponding to $wgSQLMode (default is "" for no modes). Restart the mysql server, and then set $wgSQLMode = null.
Some variables
$wgDisableCounters = true; [2]
$wgCheckSerialized = false; [3]
Starten aus einem Netzwerkpfad
Befindet sich das Basisverzeichnis des Webservers und/oder wikis auf einem Netzwerk, auf das per UNC zugegriffen wird (z.B. \\NAS\Folder1\...), muss eine Datei von mediawiki angepasst werden, da sonst die Pfadbildung fehlerhaft ist: includes\AutoLoader.php:
Alter Inhalt:
if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) {
global $IP;
$filename = "$IP/$filename";
}
Neuer Inhalt:
if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':'
&& substr ($filename, 0, 2) != "\\\\")
{
global $IP;
$filename = "$IP/$filename";
}