Apache PHP Mysql AIX

Open Source with AIX

AIX has a large range of Open Source tools, and applications already ported and packaged ready for you to install. This makes it far easier and quick to get Open Source tools and applications working and useful on AIX. All the big popular Open Source stuff is available. My favourites that are in the first URL below are:

  • Apache – web server the one that runs the web
  • emacs – editor and so much more
  • ethereal – network monitoring by packets, protocol, contents
  • Ganglia – cluster performance monitoring and graphing
  • GNC GCC – compiler collection particularly C and C++
  • gimp – image manipulation
  • Gnome – desktop
  • KDE – desktop
  • gzip – file compression utility
  • MySQL – the database
  • PHP – scripting, good for web servers
  • rdist – file distribution
  • Samba – Windows filesystem and printing and much more
  • rxvt – colour xterm
  • squid – proxy server
  • vim – improved vi editor for colourised syntax highlighing
  • VNC – Virtual Network Computing X windows on any machine (even Windows!!)
  • wget – checking and copying websites

Well, your list might be different but there are hundreds of them available. You can, of course, download the original source code and compile it yourself but this means you will need the compilers (most use the GNC compilers), some programing skills and time to read up on the options and build process. then you need to perform some testing to prove it is all working. Hint: I always compile with the latest GNU compilers to avoid problems.

Where to get Open Source with AIX

The below websites have proved to be the most useful websites. If you know a good place to look for more then just one of two packages then please added here.

Source Details URL
IBM AIX Toolbox for Linux Applications –
Open Source packages available for installation on AIX 5L –
There are about 385 packages.
BULL Bull Open Software archive for AIX http://www.bullfreeware.com/
BULL Bull Gnome web site http://gnome.bullfreeware.com/new_index.html
IBM IBM Developerworks in general http://www.ibm.com/developerworks/downloads/
IBM IBM AlphaWorks http://www.alphaworks.ibm.com/
pWare Open Source Software for AIX http://pware.hvcc.edu/
perzl.org Open Source software repository for AIX –
more than 100 most recent packages available now

Google.com and Sourceforge are also excellent at finding additional applications and binaries for AIX.

More AIX Toolbox for Linux Applications

This should be called Open Source Applications rather than Linux Applications but the name stuck! This should the first place you look for Open Source for AIX and there is a long list. These open source packages have been prepared for installation on AIX 5L using the RPM Package Manager. These packages, also known as RPMs, are “officially” available on an as-is basis for beta-level use. Please read the statement at the top URL below for details. From personal experience these RPMs are robust and better tested than any “home grown” version. Although they are not always at the latest level.

Useful Links URL
Homepage http://www.ibm.com/servers/aix/products/aixos/linux/
Homepage on Source Forge http://sourceforge.net/projects/aixtoolbox
Licensing http://www.ibm.com/servers/aix/products/aixos/linux/altlic.html
Downloads http://www.ibm.com/servers/aix/products/aixos/linux/download.html

Support and Help for AIX Toolbox for Linux Applications

  • Although this project is not supported, a public mailing list is available to give users an opportunity to ask questions or provide feedback on the AIX Toolbox for Linux Applications. The list can be accessed from SourceForge.net at http://sourceforge.net/projects/aixtoolbox

There is also a AIX Toolbox for Linux Applications Redbook (IBM’s technical manuals written by subject matter experts) at Linux Applications on pSeries 

Does AIX come with compilers for compiling Open Source?

The answer is No – the AIX compilers are available under the name of VisualAge or XL compilers from IBM but at extra costs.
You have a number of options:

  1. Purchase the compiler from IBM or IBM Business Partners (BP)
  2. You can, however, download the the IBM compilers from the IBM website for evaluation purposes – unfortunately, these are well hidden on the website and even move about, so there is no point giving you a direct URL for a download link!! Goto http:www.ibm.com then take the link to “Products”, then take the link for “Software by category”, then the link for “Traditional Programming Languages” Once you find what you want (and don’t forget there many be more than one, for example C & C++ compiler and the VisualAge C compiler) take the “Trials and Betas” option on the far left and … well good luck. Typically, you need to download 50MB to 250 MB and have to agreed to an evaluation copy, so don’t leave this until the last minute.
  3. There are also third party vendors selling excellent compilers.
  4. Use the GNU compiler collection (GCC) that you can download for free – see the below Open Source link below for the AIX Toolkit.

Note however, that from one day of testing and about 2 year ago – so your milage might vary from mine – I found that the IBM compilers are different

  1. They generate more efficient code roughly 20% to 30% faster – I guess the IBMers really do know the POWER CPUs very well.
  2. They are a little fussy and complain about ambiguous statements in your code (probably says more about my code!)

For many Open Source tools and applications, the GNU compilers are assumed and should compile first time on AIX with the same compiler. If you don’t need the last word in performance then it can be simpler to use the GNU compilers and tool chain. If, however, performance is important then the extra cost and work of using the IBM compilers is worth the effort.

Precompiled Downloads of the GNU Compiler Collection (GCC)

GCC/G++ Bundles for AIX 5.2 and 5.3 from pWare – http://pware.hvcc.edu

  • This bundle  as gzip tarball of BFF files is the 4.2.3 version of C/C++/ObjC/Java/Fortran compilers for AIX 5.2 and has no other fileset requirements (Built with gcc 4.2.3).
  • This bundle  as gzip tarball of BFF files is the 4.2.4 version of C/C++/ObjC/Java/Fortran compilers for AIX 5.2 and has no other fileset requirements (Built with gcc 4.2.3).
  • This bundle  as gzip tarball of BFF files is the 4.2.3 version of C/C++/ObjC/Java/Fortran compilers for AIX 5.3 and has no other fileset requirements (Built with gcc 4.2.3).
  • This bundle  as gzip tarball of BFF files is the 4.2.4 version of C/C++/ObjC/Java/Fortran compilers for AIX 5.3 and has no other fileset requirements (Built with gcc 4.2.3).

AIX RPM install images from Michael Perzl – http://www.perzl.org/aix

The Apache web server and AIX

Apache has to be the prime example of Open Source success – it basically runs the WWW and it also runs very well on AIX. Fully marks to all the developers of this winning project. Further information can be found at the Apache home website at http://www.apache.org/

But where to get Apache for AIX from:

  • If you want Apache 1.3 this is available from the AIX Toolbox for Linux Applications (see above) or Bull website
  • It is also available from IBM and packaged with extra features for performance. It is then called HTTPServer and this is the basis for IBM Websphere. You can download this fromhttp://www.ibm.com/software/webservers/httpservers/ for free. this version has the IBM Fast Response Cache Accelerator (FRCA) – where the AIX kernel responds to simple cached requests without the context switch to the Apache process.
  • If you want Apache 2.0 then you have a limited choice
    • you can download the IBM HTTPServer version from http://www.ibm.com/software/webservers/httpservers/ where the v2.0 and v6.0 version appear to both have Apache 2.0.47 – the difference is not clear. I guess version 6 might include the FRCA but its not clear.
  • If you want the latest stable release or particular features compiled in or make use of particular Apache modules then you have to recompile Apache for AIX yourself (see below) or use the AMP bundle provided at the pWare site.

Precompiled Downloads of Apache

AIX RPM install images from Michael Perzl – http://www.perzl.org/aix

AMP (Apache/MySQL/PHP) Bundle available from pWare – http://pware.hvcc.edu

    • The link is not valid. The bundle is not available.
  • This bundle  as a BFF tarball is Apache 2.2.8, MySQL 5.0.51b and PHP 5.2.6 hardened with the Suhosin patch and extension. All of these were compiled on AIX 5.2 with the GCC 4.2.3 compiler also available from the pWare site. This bundle is intended to run on AIX 5.2
  • This bundle  as a BFF tarball is Apache 2.2.10, MySQL 5.0.67 and PHP 5.2.6 hardened with the Suhosin patch and extension. All of these were compiled on AIX 5.3 with the GCC 4.2.3 compiler also available from the pWare site. This bundle is intended to run on AIX 5.3 & 6.1.
  • Notes:
    1. These bundles provide BDB, Oracle, MySQL and MSSQL access through PHP as well as XML, LDAP, FTP, FreeType, PDO and ODBC support.
    2. You no longer need to install bos.compat.termcap for the PHP fileset to install.
    3. Once installed you will need to configure the httpd.conf file(s) for use at your site. All software installs to /opt/pware and is managed by installp. The directory structure should be fairly intuitive.

Compiling Apache2+ on AIX using the GNU GCC compiler – By Example for Apache 2.2.2 and 2.2.4

This was performed on AIX 5.3 ML 03 – a simple default AIX install with no extras and no IBM compilers installed. It is also assumed the machine is on your network. It was quiet simple and straight forward using the latest GNU compiler and Apache source code but I did had problems using older compiler versions. Below are my notes on how to do this, step by step and where to download the tools and source code. I hope this will save you time.

  1. Make sure you have a few hundred MB of free space in following places
    • /usr this is where by default Apache will be installed
    • the directory you will use for compiling Apache
    • and some space in /tmp never does any harm!
  2. Download the following:
  3. Install libm.a from the AIX CDROMs – this is the maths library
    • As the root user
    • Insert the AIX 5.3 installation CDROM 1 into the CD and use “smitty installp” to load this package.
    • I assume you can do this without further help.
  4. Install the compiler and library – as the root user
    rpm -Uvh gcc-4*.rpm
    rpm -Uvh libgcc-4*rpm
  5. Uncompress the Apache Web Server source and untar the files in to a directory read for compiling
    gunzip httpd-2*tar.gz
    tar xvf httpd-2*.tar
    • You should now find a sub-directory with the name of httpd plus the version number. In my case it was “httpd-2.2.2”
    • cd to this directory
    • If you downloaded the httpd-2.2.2.tar.bz2 file, use bunzip2 to uncompress the file – not obvious unless you know!
  6. Prepare for the complication using the configure script, by typing the command (as a regular AIX user):
    ./configure -C --enable-so --prefix /usr/local/apache2
    • Here we request:
      • the checks are cached (-C) to save time,
      • dynamic library support (for example used by PHP which is a .so extension) and
      • the install directly will be /usr/local/apache2
    • Some people prefer to install into /opt/feeeware/apache2 but let us stick to the defaults to make it simpler. You can always try something different later on once you know it all works.
    • ./configure –help – will show you the hundreds of options.
    • Configure can take a long time – like 15 minutes (go for a cup of tea)
    • For Apache 2.2.4 add a further option as below:
      ./configure -C --enable-so --prefix /usr/local/apache2 --with-included-apr
    • Note that if you are compiling in an AIX 6.1 environment and intend to build PHP then you should omit

      because you will get errors when attempting to start Apache. Apache will report missing symbols when loading the library libphp5.so. See point 10.

  7. Compile Apache2 by typing (as a regular AIX user):
    • Note that you can use either AIX make or GNU make.
  8. Install Apache2 – all the important stuff will be in /usr/local/apache2. Type as the root user:
    make install
  9. If it all goes wrong, you can run “make clean” to start again from point 6.
  10. One method of solving the problems associated with included-apr is to download the APR and APR-utils from the Apache website and configure and make both packages. You can then rerun the Apache configure command as follows (for example):
    ./configure -C --enable-so --prefix=/usr/local/apache2 \
    --with-apr=/opt/freeware \
    --with-apr-util=/opt/freeware \

Configuring Apache2+ on AIX – By Example

Assuming you have just compiled and installed Apache2+ as in the above section, this is what I do to configure Apache:

  1. You will need to configure Apache before you start it
    vi /usr/local/apache2/conf/httpd.conf
    • Find the line that looks like this
      DocumentRoot "/usr/local/apache2/htdocs"
    • This is the top level directory for your web pages – you need to know this or you can’t add pages!!
  2. Test the Apache2 configuration
    /usr/local/apache2/bin/apachectl -t
    • I had an error “httpd: bad group name daemon”.
      • To fix this I changed /usr/local/apache2/conf/httpd.conf and the line “User daemon” to “User nobody” and the line “Group daemon” to “Group nobody”. This uses the standard UNIX/AIX user called “nobody”. An alternative would be to create a UNIX user and UNIX group both called daemon.
  3. Start Apache2
    /usr/local/apache2/bin/apachectl -k start
    • Other useful commands are “stop” and “restart”
  4. You can now test the webserver as the default web files directory has a simple web page pre-installed. If necessary, copy these web pages to your new web files directory. Point your browser at http:/<your-machine> and you should be informed that it is working.
    • Below we assume you will use default /usr/local/apache2/htdocs for some quick testing and will set up the alternative filesystem later on but don’t forget.

Configuring Apache2+ on AIX – For Production Use

Note: the default web pages directory is /usr/local/apache2/htdocs. This is not a good idea as you risk filling up the /usr filesystem. this is what I recommend as a minimum of changes to the default Apache configuration:

  • It is normal to place the webpages and the log (error and access) files are in seperate filesystems for
    • Simpler security,
    • Making sure that / or /usr do not get 100% full
    • Generally easier space management and backups
  • The same applies for Apache log and Apache error files
  • In the configuration file you would then have to find and change at least the following lines
    DocumentRoot "/usr/local/apache2/htdocs"
    <Directory "/usr/local/apache2/htdocs">
    CustomLog logs/access_log common
    ErrorLog logs/error_log
  • You should switch of any Apache features that you know you do not need to improve security.

Below we assume you will use default /usr/local/apache2/htdocs for some quick testing and will set up the alternative filesystem later on but don’t forget.

MySQL: Open Source Database

MySQL is a widely-used database. It can be used in conjunction with Apache and PHP (see below) to provide web access to databases. For more information, see thehttp://www.mysql.com

Compiling MySQL on AIX using the GNU GCC and GCC++ Compilers – By Example

The compile requires the mysql file as well as the gcc, gccplusplus compilers and associated libraries. I compiled on AIX 5.3 ML5, and stored in in the default /usr/local directory.

  1. Log in as root
  2. Make sure you have sufficient free space in /opt and /tmp (60MB+)
    **I recommend you create a /usr/local filesystem (700MB for Apache + Mysql + PHP). A separate filesystem prevents logs from filling /usr.
  3. Download and Install the following
    • Prerequisite Tools – http://www.ibm.com/servers/aix/products/aixos/linux/download.html
      • gcc-4.0.0-1.aix5.3.ppc.rpm
      • libgcc-4.0.0-1.aix5.3.ppc.rpm
      • gcc-cplusplus-4.0.0-1.aix5.3.ppc.rpm
      • libstdcplusplus-4.0.0-1.aix5.3.ppc.rpm
      • libstdcplusplus-devel-4.0.0-1.aix5.3.ppc.rpm
      • Install using rpm -Uvh rpmname
    • MySQL
      • Download: http://dev.mysql.com/downloads/mysql/5.0.html
        • Download the 32 bit version if you plan to use PHP. I was unable to compile PHP5 with the 64 bit MySQL libraries.
        • The file I downloaded was mysql-standard-5.0.27-aix5.2-powerpc.tar.gz. Your file may be newer.
        • For this example, we’ll assume you download the file to /usr/local
      • Caution: Use “compatible” versions of Apache, PHP and MySQL. Don’t mix old with new versions. They are not compatible. I used Apache2.2, PHP5 and MySQL5. (For example, PHP4 from the AIX Linux Toolbox is not compatible with the current versions of Apache and MySQL.)
  4. Create MySQL UserID and Group
    • mkuser mysql
    • mkgroup -A mysql
  5. Uncompress the MySQL File and Link the Directory to /usr/local/mysql
    • cd /usr/local
    • gunzip mysql-standard-5.0.27-aix5.2-powerpc.tar.gz
    • tar xf mysql-standard-5.0.27-aix5.2-powerpc.tar
    • This creates the directory mysql-standard-5.0.27-aix5.2-powerpc
  6. Link Directory to /usr/local/mysql
    • ln -s mysql-standard-5.0.27-aix5.2-powerpc /usr/local/mysql
  7. Configure MySQL
    • cd /usr/local/mysql
    • scripts/mysql_install_db –user=mysql
    • chown -R root.mysql .
    • chown -R mysql.mysql data
    • chgrp -R mysql .   (redundant:  chown -R root.mysql .)
    • nohup bin/mysqld_safe –user=mysql &
  8. Validate MySQL Installation by Logging into Database
    • mysql -u root
    • >use mysql;
    • >show tables;
    • >exit;
  9. Add MySQL Start-Up Script to /etc/rc.d
    • cp /usr/local/mysql/support-files/mysql.server to /etc/rc.d/init.d
    • chmod a+x /etc/rc.d/init.d/mysql.server
    • Add a link in rc2.d:  cd /etc/rc.d/rc2.d; ln -s /etc/rc.d/init.d/mysql.server S10mysql.server K10mysql.server

PHP: Hypertext Preprocessor and AIX – 5.1.4 and 5.2.1

Many websites use the excellent PHP extension package to add web features and dynamic content. PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP stands for PHP: Hypertext Preprocessor. Further details of this most excellent project go to the PHP home website at http://www.php.net.

You can down load the PHP version 4.0 from the AIX Toolbox for Linux Applications website. This assumes your downloaded web server was compiled to support PHP and shared objects and I found that many do not support it – which is really annoying!! But if you need the SSL and XML optional features and want the latest PHP version (at the time of writing this is 5.1.4) then you will have to compile it yourself. Below are the datails on how to do this.

Compiling PHP on AIX using the GNU GCC compiler – By Example

This was performed on AIX 5.3 ML 03 – a simple default AIX install with no extras and no IBM compilers installed. It is also assumed the machine is on your network. It is straight forward using the GNU compiler and PHP source code. This “by example” assumes you have just completed the compiling of Apache2+ (see above sections) and so have the GNU C 4.0 compiler available.

  1. Make sure you have a few tens MB of free space in the following directories:
    • /usr the default place for (or where ever you want to install PHP),
    • /opt where many of the pre-requisite libraries are installed and
    • in the directory you use for the compile,
    • some space in /tmp never hurts too.
  2. Download the following:
    • From PHP 5.1 source code
      • From http://www.php.net/downloads.php
      • For me the file was called php-5.1.4.tar.gz but you might fine a later version still. I have since compiled 5.2.1. Version 5.3.1 is currently available.
    • XML Support – this should be 2.6.21 or later depending on which version of PHP you are building. The AIX Toolbox for Linux Application site is back level
  1. #* General tools – all from http://www.ibm.com/servers/aix/products/aixos/linux/download.html
      1. LEX flex-2.5
      2. XML support expat-1.95.7
      3. Compression library zlib-1.2.2
      4. Compression develoment zlib-devel-1.2.2
      5. Compression library bz2-1.0.2-3
      6. jpeg support libjpeg-6b-6
      7. jpeg support development libjpeg-devel-6b-6
      8. png support libpng-1.2.1-6
      9. png development libpng-devel-1.2.1-6
      10. Pixmap xpm-3.4k
      11. Pixmap development xpm-devel-3.4k
      12. Freetype2 fonts freetype2-2.1.7-2
      13. Freetype2 fonts development freetype2-devel-2.1.7-2
    • Install all the RPM files – if they are in one directory use: rpm -Uvh *.rpm
    • For PHP 5.2.1, I found I also needed the GNU C++ compiler – all from http://www.ibm.com/servers/aix/products/aixos/linux/download.html
      1. gcc-cplusplus-4.0.0-1.aix5.3.ppc.rpm
      2. libstdcplusplus-4.0.0-1.aix5.3.ppc.rpm
      3. libstdcplusplus-devel-4.0.0-1.aix5.3.ppc.rpm
    • Assuming you have all the above in place, you can start on PHP itself
  2. Not quite. If you are building PHP 5.3.1 (and possibly earlier versions) in an AIX 6.1 environment then there are a few more steps.
    • Download and install the gnu make RPM from the AIX Linux Toolbox. By default, make will be installed in /opt/freeware/bin. You will need this to build PHP.
    • Download the source code for libxml2 as mentioned above. I used 2.6.30. Earlier versions do not seem to support shared libraries and I was not able to build later versions (2.7.X). Building the libraries required several tricks.
      • I needed to edit the configure script to recognise AIX 6.1
        cp configure configure.dist
        cat configure.dist | sed -e "s/aix5\*/aix5* |  aix6*/" > configure
        ./configure --prefix=/opt/freeware \
        --without-threads \
        make install
      • Note that this seemed to work better using AIX make instead of GNU make.
  3. Uncompress the PHP source code file and untar the files
    gunzip php*tar.gz
    tar xvf php*.tar
    • You should now find a sub-directory with the name of php plus the version number. For example “php-5.1.4” or “php-5.3.1”.
    • cd to this directory
    • If you downloaded the php-5.1.4.tar.bz2 file, use bunzip2 to uncompress the file – not obvious unless you know!
  4. If you are compiling PHP 5.3.1 on AIX 6.1 the configure script does not recognise AIX6. Edit configure
    cp configure configure.dist
    cat configure.dist | sed -e "s/aix5\*/aix5* |  aix6*/" > configure
  5. Prepare for the compilation using the configure script, by typing the following two commands (the first picks up the new utilities you installed above, the second seems long winded but refers to the directories to find the newly install libraries):
    export PATH=/opt/freeware/bin:$PATH
    # all the following lines of text are on one line (split here as the web server gets confused!)
    ./configure --prefix=/usr/local
    --enable-shared --disable-static
    • Here we detail the Apache dynamic library support (apxs) file, shared libraries and various options needs for most new webservers, zlib and bz2 for compression, jpeg and png for images, XML support.
    • Note that in PHP 5.3.1, the options –with-png and –with-xml are deprecated and you get a non-fatal warning. The workaround is to use –with-png-dir= and –with-xml-dir= pointing to the appropriate directories.
    • Note that when compiling 5.3.1 on AIX 6.1 running configure with the options above will fail because shared libraries are reported as not supported! The solution that I used was to add the option
    • Some people prefer to install into /opt/feeeware/apache2 – the AIX normal place for open source applications. In this example, we will use the default directory of /usr/local/apache2 to make it simple. You can always recompile later, once you know the compile will work.
    • ./configure –help – will show you the dozens of options.
    • Configure can take a long time – like 10 minutes (go for a cup of tea).
    • Comment on the last line i.e. the MySQL option
      • If you only want Apache and PHP then you don’t need this last line – simply remove it.
      • If you want PHP to be able to connect to a MySQL database and have the MySQL installed and at /usr/local/mysql – then leave it in.
  6. If you are compiling PHP 5.3.1 on AIX 6.1 and run make at this point then it will fail with a message about duplicate symbols. This problem seems to be known in the PHP bug database. My solution to to this was to edit the file
    ./main/php_config.h and change
  7. Compile PHP
    • There will be compiler warnings about pointers type mismatches. As these were warning, I ignored them.
    • Make sure that you use GNU make. Otherwise your compilations may fail with an error message:
      Generating phar.php
      /bin/sh[14]: -d:  not found
    • If the compile fails with a vague “out of memory” error message, try increasing ulimit.
  8. Install PHP with the following two commands
    cp .libs/libphp5.so /usr/local/apache2/modules
    cp php.ini-recommended /usr/local/apache2/conf/php.ini

Configuring PHP with Apache2 on AIX – By Example

Assuming you have just installed Apache2+ (and it is working OK) and have just installed PHP as in the above section then this is what you need to configure PHP to work.

  1. Stop Apache2 with: /usr/local/apache2/bin/apachectl -k stop
    • Do not forget this – if you add the PHP configuration options before stoping Apache you will not be able to stop it cleanly and will have to kill it!
  2. You will need to configure PHP into Apache2 before you use it
    • Apache2 currectly does not understand that PHP is an option and what to do with .php files
    • In the /usr/local/apache2/conf/httpd.conf file, add the following at the end (or you can add them after similar lines in the file to keep it neat). These will let Apache know about 1) the PHP library, 2) that it should pass web server files ending with .php to PHP for processing and generating dynamic HTML and 3) that is the URL does not contain a file name (only a directory) and it finds a index.php file then it should by default open that file just like it does for index.html files.
      LoadModule php5_module modules/libphp5.so
      AddType application/x-httpd-php .php
      DirectoryIndex index.php
    • Advanced Apache Administrators may have other approaches and config file setups but the above will get you started.
    • Edit the /usr/local/apache2/conf/php.ini file and change the line
      ;date.timezone =
    • to
      date.timezone = "Europe/London"
    • or what ever time zone you are in. This helps applications that get confused when working out the Timezone in other ways.
  3. Restart Apache2 with: /usr/local/apache2/bin/apachectl -k start
  4. Now test PHP with Apache2
    • Create a file in the web server files directory (default /usr/local/apache2/htdocs) called testing.php as the following two lines:
      <h1> PHP testing </h1>
      <?PHP phpinfo() ?>
    • Make this file readable by everyone with: chmod 755 testing.php
    • Make it owned by nobody with: chown nobody:nobody testing.php
    • Now use you browser to access the file with a URL of http:<you-machine>/testing.php
      • You should see a lot of PHP information – this is everything that is available to the PHP script writers and can be useful in debuging some problems.

Once compiled moving Apache2+PHP to an new/production machine

This is relatively simple but hopefully these notes will save you time. First, backup the Apache2.2 and PHP files that by default are in the /usr/local/apache2 directory (assuming space for this in /tmp, its about 45MB):

cd /usr/local/apache2
tar cvf /tmp/apache2.tar

Second, copy or FTP this to the new machine here we assume the file is in /tmp and install them with

mkdir -p /usr/local/apache2
cd /usr/local/apache2
tar xvf /tmp/apache2.tar .

Third, you need only the supporting run time libraries and it is best not to copy these but to install them from the original RPM files (as we did for compiling but you only need a subset of the libraries). The list of RPM is below and where to get them:

  • XML Library Support – this has to be the one that you used when building PHP. If you used the source code Method on the source machine then you will need to copy the source code to the destination machine and rebuilt and reinstall. (Alternatively, if you know how to create RPM packages, you could do this on the source machine and copy the package to the destination).
    1. File libxml2 2.6.2X (find and use the rpm link)
  • General Libraries – all from http://www.ibm.com/servers/aix/products/aixos/linux/download.html
    1. jpeg support libjpeg-6b-6
    2. png support libpng-1.2.1-6
    3. Pixmap xpm-3.4k
    4. Freetype2 fonts freetype2-2.1.7-2
    5. libgcc 4.0 make it the library for AIX 5.3

Now, you should find your apache web server ready to test and run

/usr/local/apache2/bin/apachectl -t
/usr/local/apache2/bin/apachectl -k start

Samba on AIX

Samba has been working quite well on AIX for quite some time, and allows AIX to integrate into a Windows Domain (with ADS).
It can be a complete domain member server, and authentication can be performed by the DC’s in a windows AD domain or other kerberos/ldap servers.

The possibilities are almost endless, and the documentation for samba on Unix is quite plentiful.

The Samba website has a number of resources that can be used.
The Official Samba-3 HOWTO and Reference Guide is particularly recommended.

Install Pre-Compiled AIX binaries

You can find pre-compiled binaries for AIX on the official Samba site.
At the time of writing the current stable release of samba for AIX is 3.0.24
You will also need the “base” files for Samba. These certain “support” binaries and libraries that are either not included in AIX, or are at different levels than the ones included with AIX. These mostly consist of LDAP and Kerberos binaries and libraries that samba uses for Microsoft Windows Active Directory integration.
The current samba base files can be found here.
Both of these install into /opt/pware so not to affect other (OS or application) files on the system. These are the particular ones that the version of Samba has been compiled against.

The README file contains all basic information required on how to install this on AIX.

Configuring Samba to be src controlled.

To use SRC (System Resource Controller) to stop and start samba you need to run something like this:

/usr/bin/mkssys -s nmbd -p /opt/pware/samba/3.0.24/sbin/nmbd -a '-F -s /opt/pware/samba/3.0.24/lib/smb.conf' -u 0 -S -n 15 -f 9 -R -G samba
/usr/bin/mkssys -s smbd -p /opt/pware/samba/3.0.24/sbin/smbd -a '-F -s /opt/pware/samba/3.0.24/lib/smb.conf' -u 0 -S -n 15 -f 9 -R -G samba

Take notice that by using the “-F” switch with samba you tell it to not daemonize, and let startsrc/stopsrc control it fully.
When this is done you should be able to start/stop Samba with:

startsrc -g samba
stopsrc -g samba

Building a Linux-hosted AIX crosscompiler

While precompiled gcc packages for AIX are available, you might not be allowed to install a development environment on a system due to various policies. But you may still want to compile some tools which you would like to run on your AIX box, for example for debugging or research purposes. In that case, an AIX crosscompiler running on an i686 or x86_64 based Linux system comes in handy to build your binaries there and just copy them over to the AIX box for execution.

While GCC supports powerpc-ibm-aix5.3.0.0 as a target, building such a cross-compiler isn’t as easy and straightforward as it sounds in the first place. Nevertheless, it can be done.

AIX is not GNU/Linux

Every toolchain is specific with regards to:

  • the CPU (the instruction set, to be precise) for which code gets compiled
  • the kernel on which the code is supposed to run
  • the C library used

When people speak or write about cross-compilers, they very often mean compilers where only the CPU is different between host and target. This happens a lot with embedded systems. When developing code for an embedded Linux system this usually isn’t an Intel compatible PC platform, but quite frequently some ARM, MIPS or whatever CPU with an incompatible instruction set. But the target platform still runs a Linux kernel and uses a GNU C library.

When cross-compiling for a RISC based AIX machine on a PC based Linux box, in comparison, you are dealing with all: A different CPU instruction set, a different kernel and a different C library. This increases complexity quite a bit and renders some readily available HOWTOs on the web which assume that “different CPU instruction set but still GNU/Linux” pattern next to useless, unfortunately.

Please also note that there is no port of the GNU C library to AIX available. Even with GCC, you will need to use the AIX platform C library. Not that it might not be possible to port the GNU C library to AIX, but it just hasn’t been done. (Feel free!) This also implied that whatever software you intend to build for AIX using your cross-toolchain will have to be portable enough to work on AIX or should explicitly support AIX as a target platform. Fortunately, a lot of the common OSS does.

You need the AIX headers and libs on your Linux box

Building your cross-toolchain: Step by Step Howto

The GCC build process will need the cross-binutils in order to build itself. Your existing binutils will not work. (Though I haven’t understood yet why, maybe someone can fill that in.)

Therefore you should optain, build and install binutils into a separate directory tree. In the next step, your GCC configure script will pick them up from there and use them.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: