My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Showing posts with label mediawiki. Show all posts
Showing posts with label mediawiki. Show all posts

Friday, October 3, 2008

Upgrading Mediawiki

There was an announcement of a security update to mediawiki, so I upgraded. Here are the steps that worked for me, based on the directions at http://www.mediawiki.org/wiki/Manual:Upgrading_MediaWiki.

Download the latest version:
# cd /tmp
# wget http://download.wikimedia.org/mediawiki/1.13/mediawiki-1.13.2.tar.gz

Stop Apache:

# /etc/init.d/apache2 stop


Backup the database:

# mysqldump --all-databases --xml -p > db-backup.xml
Enter password:
root@web-server:~# ls -l db-backup.xml
-rw-r--r-- 1 root root 6008760 2008-10-03 06:34 db-backup.xml

Backup my current wiki directory:

# cd /var/www
# tar cvfz wiki-backup.tar.gz wiki/


Installed the new software:

# tar xvfz /tmp/mediawiki-1.13.2.tar.gz -C wiki/ --strip-components=1


I didn't have AdminSettings.php, so I created that, setting values for wgDBadminuser and wgDBadminpassword:

# cd wiki
# cp AdminSettings.sample AdminSettings.php
# vi AdminSettings.php


Ran update.php:
# cd maintenance/
# php update.php
MediaWiki 1.13.2 Updater

Going to run database updates for wikidb-mw_
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds...0
...have ipb_id field in ipblocks table.
...snip...
Deleting old default messages (this may take a long time!)...Done
Checking site_stats row...ok.
Purging caches...done.
Done.


Restart Apache:

# /etc/init.d/apache2 start
* Starting web server apache2
...done.


And fired up a web browser and tested. Everything looked good.

Saturday, March 17, 2007

Securing Mediawiki

I noticed that mediawiki was allowing anonymous editing of pages. I wanted to lock it down so that only those I grant accounts to could edit it.

I found the directions here. Which work for the most part, with some tweaks...

I started by restricting the wiki so that users had to be logged in to edit. That went fine.

Then I wanted to give myself sysop privileges. This was more complicated. The big issue is that when I installed mediawiki, I specified a prefix for my mediawiki tables:
$ grep wgDBprefix /etc/mediawiki/LocalSettings.php
$wgDBprefix = "mw_";
So I had to prefiex "mw_" to all the table names on the page. The specific steps were:
  1. First, I had to figure out what version of mediawiki I was running. Fortunately there is a Special:Version page that tells you that.
  2. Now I need to figure out my uid for the 1.4 comments. the best way I found to do that was to log into the mysql database and then issued the following command. From the output I was able to figure out my uid was '2'.
    mysql> SELECT user_id, user_name from mw_user;
  3. Now I could issue the command on the page:
    mysql> UPDATE mw_user_rights SET ur_rights="bureaucrat,sysop" WHERE ur_user=2;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0
That did it. I didn't even have to log out and back into the wiki.

Saturday, March 10, 2007

Installing MediaWiki on Ubuntu

  1. Start by installing MySQL.
    1. I had to use the directions here to set the root password for the mysql DB. Specifically the directions at the bottom of the page for a forgotten root password.
  2. Follow the directions at the following URL to install and configure MediaWiki: http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu_GNU/Linux
    1. Note that the current version of MediaWiki has different paths that what are given at the URL