Installing MediaWiki on SLES 9

From CoolSolutionsWiki

This page provides details on how to install MediaWiki on SUSE Linux Enterprise Server 9

This page is part of the MediaWiki knowledge set.

Contents

Set up a Base System

Before you continue, you must need to have a system with SUSE Linux Enterprise Server 9 installed, including the latest patches, and a network card configured with an IP address.

This system will serve as your base platform for the rest of the instructions in this document.

Configure the Foundation Applications for MediaWiki

MediaWiki is a LAMP application. That means it requires:

  • Apache2
  • MySQL
  • PHP4

The SUSE Linux setup tool "YaST" is probably the best tool for installing these.

Steps to Configure LAMP for MediaWiki

Note: The following steps apply to SUSE Linux Enterprise Server 9 and earlier. In newer versions of SUSE Linux and SUSE Linux Enterprise Server, YaST may have a MediaWiki package available that does the whole install and configuration of MediaWiki.

Install LAMP Packages

SUSE Linux makes it easy to install Apache, MySQL and PHP. Follow these steps to do so:

  1. Start YaST
  2. In YaST's Software optionns, start the Software Management module.
  3. In the Software Management module, use the Search field to add
    • Apache2
    • Apache2-mod_auth_mysql
    • Apache2-example-pages
      • This package is optional, but helps you test and troubleshoot by creating a demo Apache page
    • Apache2-mod_php4
    • Apache2-prefork
      YaST showing MySQL files selected for install
      Enlarge
      YaST showing MySQL files selected for install
    • mysql
    • mysql-client
    • mysql-shared
    • php4
    • php4-exif
    • php4-gd
      • This is necessary for working with thumbnails
    • php4-gettext
    • php4-ldap
    • php4-mysql
    • php4-session
  4. Once you have selected all of the packages above, click Accept to commplete the install.
    • YaST will automatically determine several additional packages that are needed to support the packages you chose to install.

Configure MySQL

Create the MySQL Install Database

  1. Open a Terminal
  2. Become the root user by using
    # su
    and entering the root user password
  3. Use the following command to start configuring MySQL
    # mysql_install_db --user=mysql
    • Per the instructions, be sure to set a password for the root user on your database, by running the following commands. Note the password, as it will be needed during the wiki installation later.
      # /usr/bin/mysqladmin -u root password 'new-password'
      # /usr/bin/mysqladmin -u root -h hostname password 'new-password'
  4. Close the Terminal window

Create "mysql" Group

  1. Start Yast
  2. In YaST, select Security and Users on the left-side navigation
  3. In Security and Users, start the Edit and create group module
  4. In the Edit and create group module, create a group named mysql
  5. Add the following as members of the new mysql group:
    • daemon
    • mysql
    • root
  6. Click Accept to save the group and close the creation dialog for the new group
  7. Click Finish to finalize all changes to your system's groups

Grant Required File System Permissions

  1. Open a Terminal
  2. Become the root user by using
    # su
    and entering the root user password
  3. Use the following command to set the group owner of /var/lib/mysql to the new mysql group
    chown -Rv mysql /var/lib/mysql
  4. Use the following command to grant file system rights to the new mysql group
    chmod -Rv 774 /var/lib/mysql
  5. Close the Terminal window

Increase Available Memory for PHP

  1. Become root and open your favorite editor
  2. Edit /etc/php.ini
  3. Find memory_limit = 8M in the file and change it to memory_limit = 20M

Note: This step is normally automated by the MediaWiki configuration script. However, it is helpful to have some familiarity with the php.ini file

Start the Apache and MySQL Daemons

Now you need to start the Apache2 daemon, and set it to automatically run every time it the server starts.

  1. Start Yast
  2. Select System in the left hand panel.
  3. Start the Run Level module in the right-hand panel
    • Note: Later versions of YaST call this "System Services"
  4. Click the Expert Mode radio button
  5. Select the apache2 Service
  6. Click the Set/Reset Button and select Enable This Service
  7. Click the Start/Start/Refresh Button and select Start Now
  8. Select the mysql Service
  9. Click the Set/Reset Button and select Enable This Service
  10. Click the Start/Start/Refresh Button and select Start Now

Installing MediaWiki

Note: Some versions of SUSE Linux include MediaWiki as an optional component that can be installed from YaST.

  1. Download the latest version of MediaWiki from SourceForge.net
    • You need MediaWiki 1.51 or newer to use Novell eDirectory for authentication
    • Note: Starting with MediaWiki 1.7, php5 is required. The release notes suggest sticking with 1.6.x for php4. --Fowlerdm 10:46, 18 September 2006 (MDT)
  2. Open a Terminal
  3. Become the root user by using
    # su
    and entering the root user password
  4. Extract tar.gz file by running
    # tar -xvzf {path to downloaded MediaWiki file}/mediawiki-*tar.gz -C /srv/www/htdocs
    • Tar will expand the contents of this compressed file into a folder called mediawiki-1.5.6 (or whatever the version number is)
  5. Rename the extracted directory to "wiki"
    mv /srv/www/htdocs/mediawiki-1.5.* /srv/www/htdocs/wiki
  6. Change permissions on the wiki folder
    chmod a+w /srv/www/htdocs/wiki/config
    • This allows the MediaWiki application to create and update its configuration files.
  7. Close the Terminal window

Configure the Wiki

  1. Open a a browser to http://127.0.0.1/wiki/config
  2. The MediaWiki configuration tool will open and check the environment
Checking environment...
PHP 4.3.4: ok
PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
Have XML / Latin1-UTF-8 conversion support.
PHP's memory_limit is 8M. If this is too low, installation may fail!
Attempting  to raise limit to 20M... ok.
No zlib support.
Neither Turck MMCache nor eAccelerator are installed, can't use object caching  functions
Found GNU diff3: /usr/bin/diff3.
Couldn't find GD library or ImageMagick; image thumbnailing disabled.
Installation directory: /srv/www/htdocs/wiki
Script URI path: /wiki

  • Notice the "image thumbnailing disabled" error. You can fix this by adding either the GD Libraries or ImageMagick via Yast.

Parameters Required by MediaWiki

The MediaWiki setup needs the following information:

  • Site Name
    • Note: Cannot have special charactors or punctuation
  • Sysop's account name and password
  • Database Configuration
    • Database name
    • DB usersname
    • DB password
    • Superuser account (MySQL superuser)
    • Superuser password (MySQL superuser password)

Example

  • Site Name: MyKillerWiki
  • Sysop: Admin-Dude
  • Password: N0b0dyL1k3sM3
  • Database name: MyWikiDB
  • DB usersname: WikiUser
  • DB password: LetMeIn
  • Superuser account: root'
  • Superuser password: 'MySQLROOT_P4ssw0rd'

Note: Some users have reported the following error when trying to perform the installation with the SQL Server Host set to localhost:

  • Attempting to connect to database server as root...failed with error [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13).

If this occurs, try setting the SQL Server Host' to 127.0.0.1 instead.

ERIN: WE NEED TO NOTE WHAT BUTTON TO CLICK TO GIVE THIS SECTION A SENSE OF COMPLETION.

Copy LocalSettings.php

Copy the LocalSettings.php file from /srv/www/htdocs/wiki/config to /srv/www/htdocs/wiki using this command
cp /srv/www/htdocs/wiki/config/LocalSettings.php /srv/www/htdocs/wiki



Use Your Wiki

  • On the server:
  • From any machine:
    • Open a browser to http://<machine's IP or DNS address>/wiki

See Also

Setting Up Apache/MySQL/PHPon SUSE Linux

Integrating with Other Novell Software