[Tip] Install Mediawiki on AIX

Thread Tools Search this Thread
Operating Systems AIX [Tip] Install Mediawiki on AIX
# 1  
Old 12-11-2013
[Tip] Install Mediawiki on AIX


If one searches the web for procedures on how to install the ubiquitious Mediawiki-Software there are an abundance of links - for Linux, for Windows and probably for Mac-OS. There is a stunning silence about how to do it on AIX. Of course, it is perhaps possible to compile all the necessary components from source. It takes only a short few years to understand and debug all the problems arising, especially with using either the (on AIX) not very well supported gcc or the - in some respects - very peculiar IBM VAC compiler and soon enough you might eventually have a running Wiki - or maybe not. (If you sense some sarcasm here: been there, done that, so i think i am entitled to it.)

So, here, for the first time, a really complete and thorough procedure on how to install Mediawiki on AIX:

Before you begin
Having a Wiki makes a lot of work: not because the software would be hard to maintain, but because it takes a lot of work to write articles, organize them in meaningful categories, edit them, ... . You want to live with what you build for a long time. Planning is therefore imperative. Plan thorough and plan twice, then revise your plans. Only then start to execute them. Take what i write as a blueprint: it works, but you might be better off revising some of my decisions because you face different circumstances. Feel free to experiment whereever it might be necessary and write about your experiences here. I'll appreciate not only telling you my knowledge but also getting yours back in return.

All the software mentioned here (with the exception of MySQL, see below) was loaded from Michael Perzls AIX Software Repository. These packages are extremely well crafted (IMHO much better than what IBM does in its laughable "Linux Affinity Initiative") and i would take these over the respective IBM-rpms any day and twice on Sunday.

I started with a freshly installed LPAR with AIX 7.1 (7100-02-03-1334) with 4GB of RAM with AMS (1.2) and 0.5 CPUs. The system will be used for other things internal to the system administration (namely LPAR2RRD and statistics for our VMAXes served via web). For the Wiki alone probably a lot less would have sufficed.

In particular i downloaded:

and all its dependencies. Notice, that there are really many (package A depending on B and C, B depending on D, E and F, ... ad nauseam) and some dependencies are circular (A having B as prerequisite and B having A as prerequisite). See the Perzl site's FAQ about how to solve this problem, i will eventually post a list of dependencies as a follow-up, so you can download in one pass.

I didn't want to compile MySQL for AIX, so i searched for a precompiled version and found 5.0.91 on the MySQL-Site. Go to http://downloads.mysql.com/archives/community/ and select "5.0.91 , Community Server" from the drop-down menu, then select AIX as your OS.

In the meantime there is a MySQL-package available from the Perzl-Site and if i had to do it again I'd probably go with this instead. Still, with the version i used i encountered no problems.

Finally i downloaded the MediaWiki software in version 1.21.2, but changed that to 1.23.rc03 later (see below why). Since i did the installation 1.22.0 has been released and you probably want to use this instead. I didn't and it worked well, but I'd prefer using released software instead of alpha versions.


A) OS Preparations
I created a separate VG with 16GB of disk space to take all the Wiki components and a software repository. I figured that i would have to download lots of packages and wanted a central place to collect them on the system if i'd had to start over at some point. Here is my layout (the wiki_old_lv) is not necessary any more). My PP size is 64 MB:

# lsvg -l wikivg
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
instpkglv           jfs2       48      48      1    open/syncd    /opt/repo
wiki_old_lv        jfs2       8       8       1    open/syncd    /var/www/htdocs/mediawiki-1.21.2
mysqllv             jfs2       8       8       1    open/syncd    /opt/freeware/mysql
phplv               jfs2       4       4       1    open/syncd    /opt/freeware/php
wikilv              jfs2       8       8       1    open/syncd    /var/www/htdocs/mediawiki-1.22.0rc3

I created the following users and groups with their properties (primary groups in bold):

Component 		User 		Groupset 		Home
Apache 2.4 		apache 		apache, staff	 	/home/apache
MySQL 5.0.91 		mysql 		mysql, staff, apache 	/opt/freeware/mysql
Mediawiki 1.22.rc03 	wikiroot 	apache, staff 		/var/www/htdocs

Finally i created the following links so that the versioned directories would be accessible under simple names:

root@lpar # ln -s /opt/freeware/mysql-5.0.91-aix5.3-powerpc-64bit /opt/freeware/mysql
root@lpar # ln -s /opt/freeware/php-5.5.6 /opt/freeware/php
root@lpar # ln -s /var/www/htdocs/mediawiki-1.22.0rc3 /var/www/htdocs/wiki

If you happen to use other versions you should probably name the orginal mount points differently and adjust the respective links accordingly. I do it this way always when i deal with software which i suppose to go through some versions: create a directory /some/where/sw-<version> where i put the software and then a link /some/where/sw-<version> -> /some/where/sw so that it is accessible from a common directory. A new version would get a different directory and finally i would remove the link and let it point to the new version.

B) Apache and mod_PHP Installation
Install the three packages mentioned above and all their dependencies. Test your Apache installation after the "httpd"-package with

root@lpar # /opt/freeware/sbin/apachectl start

and you should see the logo page of an unconfigured Apache web server with your browser. After installation of "mod_php" restart the server and watch out for the displayed error message:

root@lpar # /opt/freeware/sbin/apachectl restart
httpd: Syntax error on line 532 of /opt/freeware/etc/httpd/conf/httpd.conf:
Syntax error on line 6 of /opt/freeware/etc/httpd/conf/extra/httpd-php.conf:
Cannot load /opt/freeware/lib/httpd/modules/libphp5.so into server:
Could not load module /opt/freeware/lib/httpd/modules/libphp5.so.\n
System error: No such file or directory

In this case you have to change ".../lib/..." to ".../lib64/..." in the file /opt/freeware/etc/httpd/conf/extra/httpd-php.conf, then restart the server again. You can check the success of your effort by listing the load Apache modules:

apache@lpar # /opt/freeware/sbin/httpd -L
               PHP Value Modifier
                       Allowed in *.conf anywhere and in .htaccess
                       when AllowOverride includes Options
               php_flag (mod_php5.c)
                       PHP Flag Modifier
                       Allowed in *.conf anywhere and in .htaccess
                       when AllowOverride includes Options
               php_admin_value (mod_php5.c)
                       PHP Value Modifier (Admin)
                       Allowed in *.conf anywhere
               php_admin_flag (mod_php5.c)
                       PHP Flag Modifier (Admin)
                       Allowed in *.conf anywhere
               PHPINIDir (mod_php5.c)
                       Directory containing the php.ini file

Another test is to place into /var/www/htdocs/wiki/phpinfo.php:
     <body <h1> PHP testing </h1>
            <?PHP phpinfo() ?>

Now direct your browser to: http://<yourhostname>/phpinfo.php. The displayed info is intersting for a lot of things, i suggest you keep it there.

C) MySQL Installation
In the meantime there is a MySQL package from Perzl and if i had to install again I'd go for that, perhaps. It was not there when i installed and i used the "Community Server" version 5.0.91 (the most recent AIX binary provided) instead. I encountered no problems so far. Installation is straight-forward: dump the software to a directory.

su - mysql
gzip -cd /opt/repo/mysql/mysql-5.0.91-aix5.3-powerpc-64bit.tar.gz | tar xf -

After this you have to initialise the database instance:

mysql@lpar # /opt/freeware/mysql/scripts/mysql_install_db
mysql@lpar # cd ; ./bin/mysqld_safe &
mysql@lpar # ./bin/mysql_secure_installation
     root PW: "mysql"
     Remove anonymous users? [Y/n] y
     Disallow root login remotely? [Y/n] y
     Remove test database and access to it? [Y/n] y
     Reload privilege tables now? [Y/n] y

I suggest you use support-files/mysql.server (the provided start-/stop-script blueprint) and construct a SRC-startable service from it. You could also create a regular RC-file and put it into the /etc/rc.*-hierarchy. For our goal it doesn't matter how you start MySQL, it has to be just running.

D) MediaWiki Installation
When i started to install MediaWiki the latest stable release was 1.21.2 and thereofr i did go with that. Unfortunately it doesn't work, because the mod_php-package from Perzl supports only the two newer APIs to MySQL: PDO and MySQLInd. The Wiki software, alas, only uses the old (and, as far as PHP sources are concerned, deprecated) API. This was why in the web-based installation MySQL was not a selectable option. I tried to compile a new mod_php using Perzls source-rpm, but failed to get a successful complilation (after an extended debugging worth its own article).

I was about to write a mail to the packages provider for help when i found that the new release candidate utilizes the new MySQLInd API. Right now there is the release 1.22.0 and you should go with this instead of the release candidate i used, but this was not available when i installed and right now i do not feel like upgrading to the final release.

Installation is quite easy: unpack the tarball to /var/www/htdocs/wiki and you are finished. Depending on the exact version you are installing you will have to adjust the following commands somewhat:

root@lpar # su - wikiroot
wikiroot@lpar $ gzip -cd /opt/repo/wiki/mediawiki-1.21.3.tar.gz | tar xf -

Now prepare the database the Wiki will use:

root@lpar # su - mysql
mysql@lpar $ mysql -u root mysql -p
     mysql> delete from mysql.user where user != "root";
     mysql> delete from mysql.db where user = "wikiroot";
     mysql> flush privileges;
     mysql> DROP DATABASE my_wiki ;
     mysql> CREATE DATABASE my_wiki ;
     mysql> CREATE USER wikiroot;
     mysql> USE my_wiki;
     mysql> GRANT SELECT ON my_wiki.* TO wikiroot;
     mysql> GRANT UPDATE ON my_wiki.* TO wikiroot;
     mysql> GRANT INSERT ON my_wiki.* TO wikiroot;
     mysql> GRANT DELETE ON my_wiki.* TO wikiroot;

This is out of the installation instruction from www.mediawiki.org, but you might use

mysql> GRANT ALL ON my_wiki.* TO wikiroot;

alternatively. I did that with no adverse effects.

Now direct your web browser to http://<yourhostname>/wiki/index.php and start the webbased Installation. Save the resulting file "LocalSettings.php", put it into the directory /var/www/htdocs/wiki and you should be good to go.

A few additions to this file might help, i have commented them below:

The following i have put in at the start so i have just to uncomment it if i ever need to debug the Wiki software. This helped my finally track down the problem with importing data from the previous version of the wiki i had on Linux. The database format (tables, fields) has changed between version 1.21 and 1.22.

# --------------------------------------------------- debugging starts
# from http://www.mediawiki.org/wiki/Manual:How_to_debug
#                                                     PHP errors
# error_reporting( -1 );
# ini_set( 'display_error', 1 );

#                                                     SQL errors
# $wgShowSQLErrors = true;
# $wgDebugDumpSql  = true;
# ----------------------------------------------------- debugging ends

Per default Wiki limits uploads to only a very few select file extensions. Here, some more of common extensions are allowed. It makes indeed sense to limit this in a very public Wiki for security reasons, but i use mine for documentation and share it with a very few colleagues, so that the rules can be much less restrictive.
# -------------------------------------------------- Upload file types
# Add new types to the existing list from DefaultSettings.php
# (in case of problems also consult $wgFileBlacklist and/or
# $wgMimeTypeBlacklist) see:
# http://www.mediawiki.org/wiki/Manual:Configuring_file_uploads
$wgFileExtensions[] = 'doc';
$wgFileExtensions[] = 'xls';
$wgFileExtensions[] = 'pdf';
$wgFileExtensions[] = 'mpp';
$wgFileExtensions[] = 'odt';
$wgFileExtensions[] = 'ods';
# --------------------------------------------------------------------

We have several different web-tools on our system and didn't want to start with having to configure virtual hosts on the Apache server (one step at a time). We therefore have a visible "/wiki" directory in our URLs. You might want to trim that if the wiki is the only web service on your host. Change the following variable to "/" in this case and also modify the "DocumentRoot" in the Apache-config accordingly to point at /var/www/htdocs/wiki instead of /var/www/htdocs

$wgScriptPath = "/wiki";

OK, so far from me. Have a happy time with your Wiki on AIX.


Last edited by bakunin; 12-12-2013 at 06:01 AM..
This User Gave Thanks to bakunin For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Install Numpy in AIX 6.1

Hi I have been trying install numpy in AIX 6.1 unsuccessfully, the versions are numpy (1.7 or 1.6), ( IBM XL C/C++ for AIX, V11.1 or gcc 4.7.2 ) I put in site.cfg from numpy the following library_dirs = /opt/freeware/lib:/usr/lib:/usr/lib64:/lib:/usr/local/lib64 include_dirs =... (0 Replies)
Discussion started by: Brunolac
0 Replies

2. AIX

[Tip] Backup and restore on AIX

Pretty penny's. Just remember that mksysb and savevg are just front-ends for backup. In other words, backups on AIX are organized by volume groups. mksysb is specialized for rootvg and savevg is used for other volume groups. Ignoring that rootvg also creates files needed to boot a system... (1 Reply)
Discussion started by: MichaelFelt
1 Replies

3. UNIX and Linux Applications

mediawiki page won't load - fedora 16, MediaWiki version 1.18.2

I created a mediawiki page and it was completely working and I had multiple pages within it. When I edited the $wgLogo = " "; to something I wanted (I put the link to the picture within " ") I had to edit the logo on the top right but now I can't even load any of my pages, I may have... (10 Replies)
Discussion started by: kelth
10 Replies

4. Red Hat

mediawiki page won't load - fedora 16, MediaWiki version 1.18.2

I created a mediawiki page and it was completely working and I had multiple pages within it. When I edited the $wgLogo = " "; to something I wanted (I put the link to the picture within " ") I had to edit the logo on the top right but now I can't even load any of my pages, I may have touched... (1 Reply)
Discussion started by: kelth
1 Replies

5. Solaris

how to install mediawiki

hi everybody.. i download and untar mediawiki ... i dont know how to install mediawiki.. there is no configure ... plz help me how to do it step bu step ... (1 Reply)
Discussion started by: coolboys
1 Replies

6. AIX

How to install AIX 5.3 on vmware

Hi, I want to install AIX 5.3 for running DB2. As AIX cannot be installed on normal PCs without vmware, trying to install it on vmware. Could any one help me out how to do it. Thanks in advance. (9 Replies)
Discussion started by: prasadg034
9 Replies

7. AIX

Install bash on AIX

Hi, Im trying to install bash on AIX, I have rpm installed but get: rpm --install bash-3.0-19.3.ppc.rpm error: failed dependencies: libc.so.6 is needed by bash-3.0-19.3 libc.so.6(GLIBC_2.0) is needed by bash-3.0-19.3 libc.so.6(GLIBC_2.1) is needed by... (0 Replies)
Discussion started by: chris5126
0 Replies

8. AIX

MYSQL Install on AIX

Hello All: I've been asked to install mysql on AIX box and I have very little experience in UNIX. Does anybody have any step by step directions on installing MYSQL? Any guidance would be appreciated! Thanks (1 Reply)
Discussion started by: rmnv
1 Replies

9. UNIX Desktop Questions & Answers

Can I Install AIX 4.3.3 on a PC?

Would it be possible to install AIX ver 4.3.3 on a Pc so I can Practice commands and become familiar with the system? Is there anything special that i would have to do? Thanks Frank (1 Reply)
Discussion started by: wumagic
1 Replies
Login or Register to Ask a Question