понедельник, 7 сентября 2015 г.

AIX - HTTPD + MySQL + PHP - Installation of Apache HTTP Server, Mysql and PHP

Prerequisites

RPM package manager should be installed first, which is available from the Linux Affinity image repository as installp/ppc/rpm.rte.

Installing HTTPD

1: First of all we need to look through dependencies of the package, for example here we could do this:
oss4aix.org/download/rpmdb/deplists/aix71
2: Download all packages into empty folder on our AIX server.
3: Installing all rpms in the folder:
rpm -Uvh *.rpm
4: Then you could check following directories for apache httpd related files
find / -name 'httpd*'
...
/etc/rc.d/init.d/httpd
/opt/freeware/sbin/apachectl
/opt/freeware/sbin/httpd
/opt/freeware/etc/httpd/conf/
/opt/freeware/doc/httpd-2.2.21
...
5: Starting and Stopping
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-apache-startstop.html

Installing MySQL

https://www.linkedin.com/pulse/20140518134129-2919137-your-first-hour-with-mysql-on-aix Dependencies
bash-4.2-12.aix5.1.ppc.rpm
gdbm-1.10-1.aix5.1.ppc.rpm
gettext-0.10.40-8.aix5.2.ppc.rpm
info-5.1-2.aix5.1.ppc.rpm
libgcc-4.8.2-1.aix7.1.ppc.rpm
libiconv-1.14-2.aix5.1.ppc.rpm
libidn-1.31-1.aix5.1.ppc.rpm
mysql-5.1.73-1.aix5.1.ppc.rpm
mysql-libs-5.1.73-1.aix5.1.ppc.rpm
openssl-1.0.1e-2.aix5.1.ppc.rpm
perl-5.8.8-2.aix5.1.ppc.rpm
perl-DBD-MySQL-4.022-1.aix5.1.ppc.rpm
perl-DBI-1.623-1.aix5.1.ppc.rpm
zlib-1.2.3-4.aix5.2.ppc.rpm

Installing PHP

!!! You can install the lates versions of HTTPD and PHP precompiled binaries and their's dependencies avaliable in oss4aix repository and after installation of mod_php or php itself, face the error when trying to start httpd server:
httpd: Syntax error on line 528 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: 
\t0509-022 Cannot load module /opt/freeware/lib/httpd/modules/libphp5.so.
\n\t0509-026 System error: Cannot run a file that does not have a valid format.

To resolve this issue I had to reinstall httpd and some of its dependencies and use an older version, like this:
wget ftp://www.oss4aix.org/latest/aix71/db4-4.7.25-2.aix5.1.ppc.rpm
rpm -Uhv db4-4.7.25-2.aix5.1.ppc.rpm

wget http://www.oss4aix.org/download/RPMS/apache/httpd-2.2.29-2.aix5.1.ppc.rpm
rpm -Uhv httpd-2.2.29-2.aix5.1.ppc.rpm

wget ftp://www.oss4aix.org/latest/aix71/mod_php_ap22-5.5.26-1.aix5.1.ppc.rpm
rpm -Uhv mod_php_ap22-5.5.26-1.aix5.1.ppc.rpm

wget ftp://www.oss4aix.org/latest/aix71/php-common-5.5.26-1.aix5.1.ppc.rpm
rpm -Uhv php-common-5.5.26-1.aix5.1.ppc.rpm