IMPORTANT: This tutorial is not complete. if you scroll to the bottom you will see that there is a bug with mod_wsgi that I have not been able to fix as of yet.
For the setup of Apache2 I have used the RPMs contributed by Michael Perzl http://www.perzl.org/aix/index.php?n=Main.Apache
For most of my packages I tend to use the AIX Toolbox for Linux Applications but it seems that they only provide RPMs for Apache 1.3 since they now have an IBM http server which is based off of Apache 2.0. I haven’t used this and I don’t really want to pay for it. (At the time of writing this the IBM http server website only offers trial versions)
First things first, lets install wget onto the system so that we can get the rest of our files much easier. The versions i used here may have changed so please visit http://www.perzl.org/aix/index.php?n=Main.Wget and check out the current version, along with it’s dependencies.
Node Take note that I installed gettext-0.17-1.aix5.1.ppc.rpm with the –nodeps flag this is to get around a dependence on libxlsmp.a(smprt.o)
Now that we have wget we can download the following files directly to the server. You can use the following command but I would HIGHLY recommend going to the site and getting the most recent versions. <pre&
Installing the http development files which may be needed of you are compiling modules such as mod_wsgi. Sadly this has a lot pr deps associated with it as you can see from looking at the website. Most notably it require freetds which is dependent on gnutls which has a large number of deps. so here we go.
Installing the manuals for apache never hurts
And finally we will install mod-ssl onto the system.
The files related to Apache should now be located under the following directories(just to list a few):
Now not to say that you are the type of person to make terrible mistakes such as myself. But now would be a good time to make a mksysb of the system in this state before proceeding to installing the python, mod_python and django.
Ok, so now for python I have decided to use version 2.6.2 from the IBM AIX Toolbox for Linux Applications. Available through:
Website http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html FTP Server ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox
I will be getting my files from the FTP server, and as always just use this as an example get the urls for the latest versions:
Ok so now comes the point where I ran into a dependancy problem on python-tools-2.6.2-1.aix5.3.ppc.rpm stating that:
To get around this problem I did the following, feel free to leave a better solution in the comments if you have one.
So yay all is well we now have Python 2.6.2 (r262:71600, Aug 26 2010, 14:46:22), lets see if we can get Django up and running. To do this head on over to https://www.djangoproject.com/download/ and get your version of Django. In my case this will be Django-1.2.7.tar.gz
When you have the file send it to the server and extract, build, install.
That should be enough to get everything installed and running on the system and you can verify this by running python and checking your Django VERSION variable.
Now that we have Apache2, Apache2-devel, Python, and Django we will need to setup mod_wsgi to tie it all together. Although they are not mentioned in the docs there are a few more pre-reqs that must be met before this will work on our AIX box. Most notably we need to install tools such as GCC for compiling, and this can be very troublesome since it is tightly bound to the version of AIX you are using since gcc relies on the IBM XL compilers to generate object code.
Now at this point I should mention that it seems that in order for this you will need to have IBM XL C compiler installed and this certainly doesn’t seem to be a free product. So you will need to get the filesets for this and install it using smit or installp. For me I have access to the Academic Initiative so I downloaded all the XL C/C++ files I needed. And then proceeded through the labyrinth that is IBM FixCentral.
Fun fact if you have Rational, XL C,C++ Compiler version 11.1.0.0, for AIX which is the base install. It is NOT compatible with AIX 7.1 you will need to download a PTF for it. Go to http://www.ibm.com/support/fixcentral/ and search under:
Product Group Rational
Product: XL C,C++ Compiler
Installed version 11.1.0.0 (in my case)
Platform AIX
Once you get past this you can search for APAR IZ84777 and download the PTF to fix this madness up.
So after that digression we will continue. If you are reading past here I’ll assume you have XL C installed and patched up.
Lets install SED, and some compiler tools.
At this point you have to edit /opt/freeware/etc/httpd/conf/httpd.conf and add LoadModule wsgi_module /opt/freeware/lib/httpd/modules/mod_wsgi.so
After running /etc/rc.d/init.d/httpd restart I found two errors stating that the symbols ap_cleanup_scoreboard and ap_accept_lock_mech could not be loaded. There is a proposed solution to this at. http://code.google.com/p/modwsgi/issues/detail?id=212. This requires that a header file be changed in the Apache 2 source code and that it then be compiled with these changes. I have had no luck doing this…. I will let you know when I find a solution.
Please leave a comment if you have found a way around it.
As an alternative, until i get mod_wsgi running there is a version of mod_python available from Michael Perzl site, if you have followed my previous steps then you can install it with.