|
|||||||||||||
MediaWiki
Setup, Backup, Upgrading, Tuning |
|
|
Initial Setup
$ rcsdiff /etc/httpd/conf/httpd.conf 1131a1132,1136 > <VirtualHost *:80> > DocumentRoot /public/oldquad/wiki > ServerName wiki.oldquad.org > </VirtualHost> $ dig wiki.oldquad.org @ns1.foobar.com +short 64.32.175.104 $ cd /public/oldquad $ tar xvzf /public/installers/mediawiki-1.7.1.tar.gz $ mv mediawiki-1.7.1 wiki
# mysql -u root -p > use mysql > mysql> SELECT * FROM `user` WHERE user = 'root'; +------------------+------+------------------+-------------+-------------+-------------+-------------+- ... -+ | Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | | +------------------+------+------------------+-------------+-------------+-------------+-------------+- ... -+ | localhost | root | 0cbd366c6353a01f | Y | Y | Y | Y | | | wiki.oldquad.org | root | 0cbd366c6353a01f | Y | Y | Y | Y | | +------------------+------+------------------+-------------+-------------+-------------+-------------+- ... -+
$ cd /public/oldquad/wiki $ ls -ld config drwxr-sr-x 2 fredness oldquad 4096 Jul 8 22:45 config $ chmod 777 config
Wiki name: OldQuad Contact: wiki@oldquad.org ... Admin username: WikiSysop Password: ****** ... Database type: MySQL Database host: localhost Database name: wikioq DB username: wikioq DB password: ****** ... Superuser account: root Superuser password: ******** (this should be known already) Install MediaWiki! [ can take over a minute? ]
$ pwd /public/oldquad/wiki $ mv config/LocalSettings.php .
Backup
# mysql -u wiki -p mysql> use wikidb mysql> show tables ... mysql> \q # cp -a /var/www/html/wiki [backupfiles] # mysqldump wikidb -u wiki -p --skip-opt > [dbbackupfile]
Restore
# mysqldump mysql userIf this is fresh system, you need to also import the MySQL database if it is not already present.
# mysql scalixwiki -u wiki -p < /public/archive/wiki-20060912-daily2.sqlCreate a AdminSettings.php file by adopting it from AdminSettings.sample file.
# rcsdiff AdminSettings.php diff -r1.1 AdminSettings.php 23,24c23,24 < $wgDBadminuser = 'wikiadmin'; < $wgDBadminpassword = 'adminpass'; --- > $wgDBadminuser = 'wiki'; > $wgDBadminpassword = 'xilacs';Make sure php-mysql package is installed
yum install php-mysqlMake sure to copy over your LocalSettings.php file. If this is a new conifuration, may need to adjust LocalSettings.php $IP = include path.
[root@morpheus wiki]# diff ../wiki-old/LocalSettings.php LocalSettings.php 7c7 < $IP = "/var/www/html/scalix.com/wiki"; --- > $IP = "/var/www/html/wiki";
[root@morpheus maintenance]# php update.php A copy of your installation's LocalSettings.php must exist in the source directory. [root@morpheus maintenance]# pwd /var/www/html/wiki/maintenance [root@morpheus maintenance]#Note: LocalSettings.php may morph slightly from one version to another. May be worth setting up scratch pad of net wiki and comparing the default Locasettings it creates ofr a new wiki vs the one you are usign from you last wiki.
Miscellanious
# php update.php PHP Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/www/html/wiki/includes/Exception.php on line 114 Content-type: text/html X-Powered-By: PHP/4.3.9
2009, fredness
Disabling Anonymous Edits
$ rcsdiff LocalSettings.php 110a111,116 > # The following lines set permissions so that wiki page can only be edited by > # registered and logged in users > # Added by Nick Atkins - 01/06/06 > $wgGroupPermissions['*' ]['createaccount'] = true; > $wgGroupPermissions['*' ]['read'] = true; > $wgGroupPermissions['*' ]['edit'] = false;
Sysop Users
Users with SysOp priviledges have additional special pages they can view, and normal pages will include a delete tab. Which accounts have SysOp access is controlled by editing/adding records in the Wiki's mw_user_groups table.