AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Thu September 26, 2019 09:09 AM

    Originally posted by: ejk


    Hi,

    For sometime, when updating httpd using yum, the /opt/freeware/etc/httpd/conf/httpd.conf is replaced, to add insult to injury, with a broken one.

    root@nimbler:/ # oslevel -s
    7200-03-03-1914
    root@nimbler:/ # lslpp -l rpm.rte
      Fileset                      Level  State      Description
      ----------------------------------------------------------------------------
    Path: /usr/lib/objrepos
      rpm.rte                   4.13.0.3  COMMITTED  RPM Package Manager
    
    Path: /etc/objrepos
      rpm.rte                   4.13.0.3  COMMITTED  RPM Package Manager
    root@nimbler:/ # ls -l /opt/freeware/etc/httpd/conf/httpd.conf
    -rw-r--r--    1 root     system        21680 Oct 09 2018  /opt/freeware/etc/httpd/conf/httpd.conf
    root@nimbler:/ # yum upgrade
    Setting up Upgrade Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package ca-certificates.ppc 0:2017.07.17-1 will be updated
    ---> Package ca-certificates.ppc 0:2019.01.10-2 will be an update
    --> Processing Dependency: p11-kit-tools >= 0.23.16-1 for package: ca-certificates-2019.01.10-2.ppc
    ---> Package curl.ppc 0:7.64.0-1 will be updated
    ---> Package curl.ppc 0:7.65.1-1 will be an update
    --> Processing Dependency: krb5-libs >= 1.16.1-2 for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libgssapi_krb5.a(libgssapi_krb5.so) for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libcom_err.a(libcom_err.so) for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libkrb5.a(libkrb5.so) for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libk5crypto.so for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libk5crypto.a(libk5crypto.so) for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libkrb5.so for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libcom_err.so for package: curl-7.65.1-1.ppc
    --> Processing Dependency: libgssapi_krb5.so for package: curl-7.65.1-1.ppc
    ---> Package httpd.ppc 0:2.4.39-1 will be updated
    ---> Package httpd.ppc 0:2.4.39-2 will be an update
    ---> Package libpng.ppc 0:1.6.27-2 will be updated
    ---> Package libpng.ppc 0:1.6.27-3 will be an update
    ---> Package mod_ssl.ppc 0:2.4.39-1 will be updated
    ---> Package mod_ssl.ppc 0:2.4.39-2 will be an update
    ---> Package openldap.ppc 0:2.4.46-1 will be updated
    ---> Package openldap.ppc 0:2.4.46-2 will be an update
    ---> Package readline.ppc 0:8.0-1 will be updated
    ---> Package readline.ppc 0:8.0-2 will be an update
    ---> Package rrdtool.ppc 0:1.7.0-4 will be updated
    ---> Package rrdtool.ppc 0:1.7.0-5 will be an update
    ---> Package rrdtool-perl.ppc 0:1.7.0-4 will be updated
    ---> Package rrdtool-perl.ppc 0:1.7.0-5 will be an update
    --> Running transaction check
    ---> Package krb5-libs.ppc 0:1.16.1-2 will be installed
    ---> Package p11-kit-tools.ppc 0:0.23.16-1 will be installed
    --> Processing Dependency: p11-kit = 0.23.16 for package: p11-kit-tools-0.23.16-1.ppc
    --> Processing Dependency: libp11-kit.a(libp11-kit.so.0) for package: p11-kit-tools-0.23.16-1.ppc
    --> Running transaction check
    ---> Package p11-kit.ppc 0:0.23.16-1 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================
     Package                Arch       Version             Repository          Size
    ================================================================================
    Updating:
     ca-certificates        ppc        2019.01.10-2        AIX_Toolbox        924 k
     curl                   ppc        7.65.1-1            AIX_Toolbox        1.4 M
     httpd                  ppc        2.4.39-2            AIX_Toolbox        4.1 M
     libpng                 ppc        1.6.27-3            AIX_Toolbox        473 k
     mod_ssl                ppc        2.4.39-2            AIX_Toolbox        285 k
     openldap               ppc        2.4.46-2            AIX_Toolbox        4.1 M
     readline               ppc        8.0-2               AIX_Toolbox        2.4 M
     rrdtool                ppc        1.7.0-5             AIX_Toolbox        2.1 M
     rrdtool-perl           ppc        1.7.0-5             AIX_Toolbox         37 k
    Installing for dependencies:
     krb5-libs              ppc        1.16.1-2            AIX_Toolbox         11 M
     p11-kit                ppc        0.23.16-1           AIX_Toolbox        2.1 M
     p11-kit-tools          ppc        0.23.16-1           AIX_Toolbox         38 k
    
    Transaction Summary
    ================================================================================
    Install       3 Packages
    Upgrade       9 Packages
    
    Total download size: 29 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/12): ca-certificates-2019.01.10-2.aix6.1.ppc.rpm         | 924 kB  00:00
    (2/12): curl-7.65.1-1.aix6.1.ppc.rpm                        | 1.4 MB  00:00
    (3/12): httpd-2.4.39-2.aix6.1.ppc.rpm                       | 4.1 MB  00:01
    (4/12): krb5-libs-1.16.1-2.aix6.1.ppc.rpm                   |  11 MB  00:04
    (5/12): libpng-1.6.27-3.aix6.1.ppc.rpm                      | 473 kB  00:00
    (6/12): mod_ssl-2.4.39-2.aix6.1.ppc.rpm                     | 285 kB  00:00
    (7/12): openldap-2.4.46-2.aix6.1.ppc.rpm                    | 4.1 MB  00:01
    (8/12): p11-kit-0.23.16-1.aix6.1.ppc.rpm                    | 2.1 MB  00:00
    (9/12): p11-kit-tools-0.23.16-1.aix6.1.ppc.rpm              |  38 kB  00:00
    (10/12): readline-8.0-2.aix6.1.ppc.rpm                      | 2.4 MB  00:01
    (11/12): rrdtool-1.7.0-5.aix6.1.ppc.rpm                     | 2.1 MB  00:00
    (12/12): rrdtool-perl-1.7.0-5.aix6.1.ppc.rpm                |  37 kB  00:00
    --------------------------------------------------------------------------------
    Total                                           2.0 MB/s |  29 MB     00:14
    Running Transaction Check
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Updating   : openldap-2.4.46-2.ppc                                       1/21
    3004-686 Group "ldap" does not exist.
      Updating   : httpd-2.4.39-2.ppc                                          2/21
    warning: /opt/freeware/etc/httpd/conf/httpd.conf created as /opt/freeware/etc/httpd/conf/httpd.conf.rpmnew
    warning: /opt/freeware/etc/httpd/conf/httpd.conf_64 created as /opt/freeware/etc/httpd/conf/httpd.conf_64.rpmnew
    This version of httpd has 32bit and 64bit support
    To start 64bit httpd use : /opt/freeware/sbin/apachectl_64 start
      Installing : p11-kit-0.23.16-1.ppc                                       3/21
      Installing : p11-kit-tools-0.23.16-1.ppc                                 4/21
      Updating   : ca-certificates-2019.01.10-2.ppc                            5/21
      Installing : krb5-libs-1.16.1-2.ppc                                      6/21
      Updating   : libpng-1.6.27-3.ppc                                         7/21
      Updating   : rrdtool-1.7.0-5.ppc                                         8/21
      Updating   : rrdtool-perl-1.7.0-5.ppc                                    9/21
      Updating   : curl-7.65.1-1.ppc                                          10/21
      Updating   : mod_ssl-2.4.39-2.ppc                                       11/21
    Please restart your web server using: '/opt/freeware/sbin/apachectl restart'
      Updating   : readline-8.0-2.ppc                                         12/21
      Cleanup    : curl-7.64.0-1.ppc                                          13/21
      Cleanup    : rrdtool-perl-1.7.0-4.ppc                                   14/21
      Cleanup    : rrdtool-1.7.0-4.ppc                                        15/21
      Cleanup    : mod_ssl-2.4.39-1.ppc                                       16/21
    Please restart your web server using: '/opt/freeware/sbin/apachectl restart'
      Cleanup    : httpd-2.4.39-1.ppc                                         17/21
      Cleanup    : openldap-2.4.46-1.ppc                                      18/21
      Cleanup    : libpng-1.6.27-2.ppc                                        19/21
      Cleanup    : ca-certificates-2017.07.17-1.ppc                           20/21
      Cleanup    : readline-8.0-1.ppc                                         21/21
    
    Dependency Installed:
      krb5-libs.ppc 0:1.16.1-2                  p11-kit.ppc 0:0.23.16-1
      p11-kit-tools.ppc 0:0.23.16-1
    
    Updated:
      ca-certificates.ppc 0:2019.01.10-2           curl.ppc 0:7.65.1-1
      httpd.ppc 0:2.4.39-2                         libpng.ppc 0:1.6.27-3
      mod_ssl.ppc 0:2.4.39-2                       openldap.ppc 0:2.4.46-2
      readline.ppc 0:8.0-2                         rrdtool.ppc 0:1.7.0-5
      rrdtool-perl.ppc 0:1.7.0-5
    
    Complete!
    root@nimbler:/ # /opt/freeware/sbin/apachectl restart
    AH00534: httpd: Configuration error: No MPM loaded.
    root@nimbler:/ # ls -l /opt/freeware/etc/httpd/conf/httpd.conf
    -rw-r--r--    1 root     system        21681 Sep 26 15:46 /opt/freeware/etc/httpd/conf/httpd.conf
    root@nimbler:/ # istat /opt/freeware/etc/httpd/conf/httpd.conf
    Inode 110409 on device 10/9     File
    Protection: rw-r--r--
    Owner: 0(root)          Group: 0(system)
    Link count:   1         Length 21681 bytes
    
    Last updated:   Thu Sep 26 15:46:23 WET 2019
    Last modified:  Thu Sep 26 15:46:23 WET 2019
    Last accessed:  Thu Sep 26 15:46:54 WET 2019
    
    root@nimbler:/ # cd /opt/freeware/etc/httpd/conf
    root@nimbler:/opt/freeware/etc/httpd/conf # diff -u httpd.conf.2018-10-09 httpd.conf
    --- httpd.conf.2018-10-09       2018-10-09 13:46:28.000000000 +0300
    +++ httpd.conf  2019-09-26 15:46:23.000000000 +0300
    @@ -149,7 +149,7 @@
      LoadModule lbmethod_bytraffic_module /opt/freeware/lib/httpd/modules/mod_lbmethod_bytraffic.so
      LoadModule lbmethod_bybusyness_module /opt/freeware/lib/httpd/modules/mod_lbmethod_bybusyness.so
      LoadModule lbmethod_heartbeat_module /opt/freeware/lib/httpd/modules/mod_lbmethod_heartbeat.so
    - LoadModule mpm_worker_module /opt/freeware/lib/httpd/modules/mod_mpm_worker.so
    + #LoadModule mpm_worker_module /opt/freeware/lib/httpd/modules/mod_mpm_worker.so
      LoadModule unixd_module /opt/freeware/lib/httpd/modules/mod_unixd.so
      #LoadModule heartbeat_module /opt/freeware/lib/httpd/modules/mod_heartbeat.so
      #LoadModule heartmonitor_module /opt/freeware/lib/httpd/modules/mod_heartmonitor.so
    root@nimbler:/opt/freeware/etc/httpd/conf # cp -pi httpd.conf.2018-10-09 httpd.conf
    root@nimbler:/opt/freeware/etc/httpd/conf # /opt/freeware/sbin/apachectl restart
    root@nimbler:/opt/freeware/etc/httpd/conf # echo $?
    0
    root@nimbler:/opt/freeware/etc/httpd/conf #
    


  • 2.  Re: Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Tue October 01, 2019 02:50 AM

    Originally posted by: ReshmaVKumar


    The post installation script of apache modifies httpd.conf file.

    It disables mpm_worker and enables mpm_prefork module so that atleast one MPM is loaded. 

    mpm_prefork is the default mpm used.

     

     



  • 3.  Re: Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Tue October 01, 2019 06:15 AM

    Originally posted by: ejk


    IMHO if the config file has been modified after it has been installed, it should not be modified when package is updated.

    In my case the Apache will not start after the update because "No MPM loaded".

    root@nimbler:/ # /opt/freeware/sbin/apachectl restart
    AH00534: httpd: Configuration error: No MPM loaded.
    root@nimbler:/ #
    

     

     



  • 4.  Re: Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Tue October 01, 2019 08:41 AM

    Originally posted by: AyappanP


    That's right. The conf should not be modified. 

    I remember sometime back , there seems to be some confusion regarding which mpm module should be loaded. The post-installation script is introduced to "fix" that. 

    Now that script is causing this problem. We will remove this script in the next releases so that this won't be a problem going forward.

     



  • 5.  RE: Re: Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Tue July 13, 2021 07:58 AM
    FWIW, both issues still exist, the httpd.conf files are overwritten when updating httpd, in my case I used, yum and the conf file from the rpm package causes "No MPM loaded" error when restaring httpd.

    # yum update
    ...
    ---> Package httpd.ppc 0:2.4.46-1 will be updated
    ---> Package httpd.ppc 0:2.4.46-2 will be an update
    ...
    ---> Package mod_ssl.ppc 0:2.4.46-1 will be updated
    ---> Package mod_ssl.ppc 0:2.4.46-2 will be an update
    ...
    # /etc/rc.d/init.d/httpd restart
    Stopping Apache httpd daemon... AH00534: httpd: Configuration error: No MPM loaded.
    done.
    Sleeping for 5 seconds for graceful httpd shutdown ...
    Starting Apache httpd... AH00534: httpd: Configuration error: No MPM loaded.
    done.
    # ps -ef|grep -i httpd
    #

    After restoring httpd.conf from backups:

    # /etc/rc.d/init.d/httpd restart
    Stopping Apache httpd daemon... done.
    Sleeping for 5 seconds for graceful httpd shutdown ...
    Starting Apache httpd... done.
    # ps -ef|grep -i httpd
    apache 11075882 15270352 0 14:34:29 - 0:00 /opt/freeware/sbin/httpd -k start
    apache 11141606 15270352 0 14:34:29 - 0:00 /opt/freeware/sbin/httpd -k start
    apache 11927828 15270352 0 14:34:29 - 0:00 /opt/freeware/sbin/httpd -k start
    root 15270352 1 0 14:34:29 - 0:00 /opt/freeware/sbin/httpd -k start
    apache 22610228 15270352 0 14:34:29 - 0:00 /opt/freeware/sbin/httpd -k start
    #

    ------------------------------
    Esa Kärkkäinen
    ------------------------------



  • 6.  RE: Re: Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Wed July 21, 2021 12:50 AM
    Below is the post-install script of httpd rpm.

    echo "This version of httpd has 32bit and 64bit support"
    echo "To start 64bit httpd use : /opt/freeware/sbin/apachectl_64 start"
    if [ -f /opt/freeware/etc/httpd/conf/httpd.conf ];then
    /usr/bin/cat /opt/freeware/etc/httpd/conf/httpd.conf | \
    /usr/bin/sed -e "s|#LoadModule mpm_prefork_module /opt/freeware/lib/httpd/modules/mod_mpm_prefork.so|LoadModule mpm_prefork_module /opt/freeware/lib/httpd/modules/mod_mpm_prefork.so|" \
    > /opt/freeware/etc/httpd/conf/tmp_httpd.conf
    /usr/bin/mv -f /opt/freeware/etc/httpd/conf/tmp_httpd.conf /opt/freeware/etc/httpd/conf/httpd.conf
    /usr/bin/cat /opt/freeware/etc/httpd/conf/httpd.conf | \
    /usr/bin/sed -e "s|LoadModule mpm_worker_module /opt/freeware/lib/httpd/modules/mod_mpm_worker.so|#LoadModule mpm_worker_module /opt/freeware/lib/httpd/modules/mod_mpm_worker.so|" \
    > /opt/freeware/etc/httpd/conf/tmp_httpd.conf
    /usr/bin/mv -f /opt/freeware/etc/httpd/conf/tmp_httpd.conf /opt/freeware/etc/httpd/conf/httpd.conf

    As we can see, it is enabling mpm_prefork module and disabling mpm_worker module. Httpd requires one mpm module enabled. 
    I guess the script here disables both the modules in your httpd conf file .
    Please share your httpd.conf file.

    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: Re: Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Wed July 21, 2021 01:53 AM
      |   view attached
    Hello,

    Please find differenced between the httpd.conf file from RPM package e.g. file named httpd.conf.dist and the httpd.conf file.
    The httpd.conf has been uploaded to this message as well.

    karkkesa@nimbler:/opt/freeware/etc/httpd/conf % diff -u httpd.conf.dist httpd.conf
    --- httpd.conf.dist 2021-07-13 14:28:25.627869500 +0300
    +++ httpd.conf 2021-01-07 13:47:27.000000000 +0200
    @@ -149,7 +149,7 @@
    LoadModule lbmethod_bytraffic_module /opt/freeware/lib/httpd/modules/mod_lbmethod_bytraffic.so
    LoadModule lbmethod_bybusyness_module /opt/freeware/lib/httpd/modules/mod_lbmethod_bybusyness.so
    LoadModule lbmethod_heartbeat_module /opt/freeware/lib/httpd/modules/mod_lbmethod_heartbeat.so
    -#LoadModule mpm_worker_module /opt/freeware/lib/httpd/modules/mod_mpm_worker.so
    +LoadModule mpm_worker_module /opt/freeware/lib/httpd/modules/mod_mpm_worker.so
    LoadModule unixd_module /opt/freeware/lib/httpd/modules/mod_unixd.so
    #LoadModule heartbeat_module /opt/freeware/lib/httpd/modules/mod_heartbeat.so
    #LoadModule heartmonitor_module /opt/freeware/lib/httpd/modules/mod_heartmonitor.so
    karkkesa@nimbler:/opt/freeware/etc/httpd/conf %

    Best regards,

    Esa


    ------------------------------
    Esa Kärkkäinen
    ------------------------------

    Attachment(s)

    conf
    httpd.conf   21 KB 1 version


  • 8.  RE: Re: Running "yum update" overwrites httpd.conf, if there is a newer version of httpd RPM package available

    Posted Wed July 21, 2021 03:17 AM
    Your httpd conf file has mpm_worker_module enabled and there is no line regarding mpm_prefork. 
    So the script end up disabling mpm_worker_module. But there has to be one mpm module enabled, either mpm_worker or mpm_prefork.
    We will try to improve the script to avoid these kind of issues in the future.

    Please note that php won't work with mpm_worker_module . So we disable it and enable mpm_prefork_module in the conf file.

    ------------------------------
    Ayappan P
    ------------------------------