Develop > Server Automation Platform > Rebuild the Apache HTTP server and PHP

Rebuild the Apache HTTP server and PHP

This topic describes how to rebuild the Apache HTTP server and PHP and replace them in SA. SA includes an Apache HTTP server and PHP so this information is only needed if you need to use a different version of the Apache HTTP server or if you need to compile extra libraries or modules into PHP.

SA uses the Apache HTTP server and PHP for web Automation Platform Extensions (APX). For more information, see Automation Platform Extensions (APX).

Extending the APX HTTP environment

This section describes how you can extend the APX HTTP environment by rebuilding the Apache HTTP server and PHP.

Note You must perform these tasks after all core upgrades.

If you have a Multimaster Mesh, these tasks must be performed on each slice in all cores. For more information on slice component bundles, see the Server Automation Administer section on the HPE SSO portal.

Rebuilding PHP

  1. Perform the following tasks to rebuild PHP.

    Download the PHP source from http://www.php.net/.
  2. Put the source in a directory on the server where apxproxy is installed, typically under
    /opt/opsware/apxproxy.
  3. Enter the following commands, replacing the version number if you downloaded a different version of PHP.

    mkdir /build ; cp php-4.4.8.tar.gz /build; cd /build
    gzip -dc php-4.4.8.tar.gz | tar xvf -
    cd php-4.4.8
    ./configure --prefix=/opt/opsware/apxphp
    --with-pear=/opt/opsware/apxphp/lib/pear
    --with-config-file-path=/opt/opsware/apxphp/lib
    --with-apxs2=/opt/opsware/apxhttpd/bin/apxs <any other options you>
    make clean
    make
  4. Backup your old copy of libphp4.so:

    cp /opt/opsware/apxhttpd/modules/libphp4.so /opt/opsware/apxhttpd/modules/libphp4.so.backup
  5. Copy the new libphp4.so file to the apxhhtps directory:

    cp libs/libphp4.so /opt/opsware/apxhttpd/modules/libphp4.so
  6. Ensure that the complete reference library exists in the tool.list:

    ldd ./libs/libphp4.so

    For each entry in the output ensure that the file exists in
    /etc/opt/opsware/ogfs/tool.list.

    If an entry does not exist, add it.
  7. Backup the apxphp folder:

    mv /opt/opsware/apxphp /opt/opsware/apxphp.orig
  8. Install PHP:

    make install
  9. Reload and relink the OGFS to make sure anything you added to /etc/opt/opsware/ogfs/tools.list shows up in the OGFS:

    /opt/opsware/ogfs/tools/rewink && /opt/opsware/ogfs/
    tools/reload
  10. Restart apxproxy:

    /etc/opt/opsware/startup/apxproxy restart

Rebuilding Apache

Perform the following tasks to rebuild the Apache HTTP server.

  1. Download the source code for the Apache HTTP server from http://httpd.apache.org/.
  2. Put the source in a directory on the server that hosts the slice component bundle. For more information on slice component bundles, see the Server Automation Administer section on the HPE SSO portal.
  3. Enter the following commands, replacing the version number if you downloaded a different version of httpd.

    mkdir /build; cp httpd-2.2.8.tar.gz /build; cd /build
    gzip -dc httpd-2.2.8.tar.gz | tar xf -
    cd httpd-2.2.8
    ./configure --prefix=/opt/opsware/apxhttpd <any other options you want>.


    SA currently uses:
    --enable-mods-shared="actions alias auth_basic auth_digest authn_file authz_user cgi deflate dir dumpio env expires headers ident logio log_config mime negotiation rewrite userdir vhost_alias imagemap status"
    --disable-dav
    --with-port=8021
    --with-expat=builtin
    --without-pgsql

    (On SunOS only) Enter this command:

    perl -pi -e 's/#define HAVE_GETADDRINFO 1/#undef HAVE_GETADDRINFO/g' ./srclib/apr/include/arch/unix/apr_private.h
    make
  4. Make a backup of the apxhttp directory:

    mv /opt/opsware/apxhttpd /opt/opsware/apxhttpd.orig
  5. Install Apache:
    make install
  6. Reload and relink the new files into the OGFS:

    /opt/opsware/ogfs/tools/rewink && /opt/opsware/ogfs/tools/reload
  7. The HTTPD and the .so files in the modules directory may reference external libraries. These libraries must be visible (or winked in) to the OGFS.

    Log in to the OGFS and run LDD on /opt/opsware/apxhttpd/bin/httpd and any .so file in /opt/opsware/apxhttpd/modules and ensure that all the files listed there exist in the OGFS. If they do not, add the files to /etc/opt/opsware/ogfs/tool.list (outside the OGFS) and then re-run step 6 until all files are available to /opt/opsware/apxhttpd/bin/httpd.
  8. You must now rebuild PHP. See Rebuilding PHP.