Install MediaWiki

From BubbaWiki
Jump to: navigation, search

Install MediaWIki

Author: herman

Initial disclaimer and notes:

  • The emphasis here is on setting up a MediaWiki service. As the Bubba server is memory constrained, this setup disables ALL normal Bubba services including Samba. This may be unnecessary. The recommendation is to start as described below and, if desired, gradually reactivate services.
    * The author of this HowTo is primarily a RedHat Linux user; he is not a Debian Linux expert.
    * The author performed the customizations using the putty ssh and scp programs from a Windows-based machine.
    * It is assumed that the user has read the standard Bubba server documentation and has already performed the standard setup. Also, that the user has ssh'ed into the server at least once and knows how to "su" to root.
    * The commands described below are all performed as root (not admin).
    * The author used the vi editor when modifying files on the Bubba server. The ":wq" mark below indicates that the vi editor changes described be written and the vi editor exited.
    * The author made an original copy of each file as -orig prior to the first editing. This way it was easy to revert back, if needed, plus it was simple to view the changes made by using the diff command.
    * The author made a best effort at transcribing his experience below.
    * Pound signs (#) indicate start of comments. Do not enter it or the following text on a command line.
    * Via the Bubba server web interface, disable all available services.
    * Disable the Samba service.
/etc/init.d/samba stop
/usr/sbin/update-rc.d -f samba remove
  • Tune apache2, using Bubba forums info, to reduce memory footprint.
cd /etc/apache2
cp -p apache2.conf apache2.conf-orig
vi /etc/apache2/apache2.conf
# Below the heading <IfModule prefork.c>, change the following four values:
StartServers 5 change to 3
MinSpareServers 5 change to 3
MaxSpareServers 10 change to 6
MaxClients 20 leave unchanged
MaxRequestsPerChild 0 change to 500
:wq
/etc/init.d/apache2 restart
  • Setup apt so can download and install additional packages.
cd /etc/apt
cp -p sources.list sources.list-orig
vi sources.list
# Change first line from:
#deb http://ftp.se.debian.org/debian/ sarge main
# to:
deb http://ftp.us.debian.org/debian/ sarge main
:wq
apt-get update # update local packages list
  • Install unzip.
apt-get install unzip # installs single new package unzip_5.52-1sarge4_arm.deb
  • Install mysql-server.
apt-get install mysql-server # 2 upgraded(mainly perl stuff); 8 newly installed (including mysql-client)
  • Tune MySQL, using Bubba forums info, to reduce memory footprint.
/etc/init.d/mysql stop
cd /etc/mysql
cp -p my.cnf my.cnf-orig
vi my.cnf
# Change the following five values:
key_buffer = 16M change to 32K
max_allowed_packet = 16M change to 1M
thread_stack = 128K change to 64K
query_cache_size = 16777216 change to 8388608
query_cache_type = 1 change to 0
:wq
/etc/init.d/mysql start
mysqladmin -u root password 'aPassword' # set mysql root password
  • Install mediawiki 1.5.
cd /etc/apt
vi sources.list
# Add following line to bottom of file
deb http://www.backports.org/debian sarge-backports main contrib non-free
:wq

apt-get update # update local packages list again

apt-get -t sarge-backports install mediawiki1.5
* Revert apt back to original for future firmware updates.

cd /etc/apt cp -p sources.list sources.list-backports cp -p sources.list-orig sources.list


apt-get update # refresh local packages list
  • Verify normal web interface still works.
http://bubba/
  • Configure mediawiki.
http://bubba/mediawiki/
# Fillin responses to configuration prompts
# For example:
# Site name: HomeWiki
# Contact e-mail: webmaster@bubba
# Language: en-English
# Copyright/license: no license metadata
# Sysop account name: WikiSysop
# password: aPassword
# Shared memory caching: none
# E-mail setup: all disabled
# MySQL server: localhost
# Dababase name: wikidb
# DB username: wikiuser
# DB password: aPassword
# DB table prefix: mw_
# DB charset: backwards-compatible UTF-8
# root - specify mysql root password set earlier via mysqladmin
mv /var/lib/mediawiki1.5/config/LocalSettings.php /etc/mediawiki1.5/LocalSettings.php
chmod 600 /etc/mediawiki1.5/LocalSettings.php

http://bubba/mediawiki/index.php # After a delay, you should see a normal MediaWiki home page

  • Set thumbnail of your choice for upper lefthand corner of each page
# Find or create a 135x135 pixel png image
# Upload, via scp, to /var/www/html/images directory
cd /etc/mediawiki1.5
cp -p LocalSettings.php LocalSettings.php-orig
vi LocalSettings.php
# Change $wgLogo line to look like the following:
$wgLogo = "/images/yourImageName.png";
:wq

http://bubba/mediawiki/index.php # Mediawiki home page with your thumbnail should appear

Notes:

# Valuable files to look at in case of problems:
/var/log/messages
/var/log/apache2/error.log
/var/log/apache2/access.log