HowTo Setup MediaWiki

A collection of tips on howto tweak your Bubba.
Post Reply
Herman
Posts: 1
Joined: 26 Feb 2008, 12:39

HowTo Setup MediaWiki

Post by Herman » 26 Feb 2008, 14:23

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.

    Code: Select all

    /etc/init.d/samba stop
    /usr/sbin/update-rc.d -f samba remove
    
  • Tune apache2, using Bubba forums info, to reduce memory footprint.

    Code: Select all

    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.

    Code: Select all

    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.

    Code: Select all

    apt-get install unzip  # installs single new package unzip_5.52-1sarge4_arm.deb
    
  • Install mysql-server.

    Code: Select all

    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.

    Code: Select all

    /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.

    Code: Select all

    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.

    Code: Select all

    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.

    Code: Select all

    http://bubba/
    
  • Configure mediawiki.

    Code: Select all

    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

    Code: Select all

    # 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

Ubi
Posts: 1547
Joined: 17 Jul 2007, 09:01

Post by Ubi » 27 Feb 2008, 15:22

Excellent howto!

thanks!

Post Reply