Friday, March 14, 2003

How to upgrade Red Hat 8.0's apache RPMs to the latest Apache release



  1. rpm -i /rhs80.2/SRPMS/httpd-2.0.40-8.src.rpm
    Install the Apache source RPM. Ignore the warning. You may need to get the src.rpm file from the CD directly.
  2. cd /usr/src/redhat
    Go to the Red Hat sources directory
  3. wget http://apache.oregonstate.edu/httpd/httpd-2.0.44.tar.gz
    Get the latest version of Apache. Go to www.apache.org and follow the download link.
  4. http://httpd.apache.org/dev/verification.html
    Read this tedious set of gpg instructions about how and why you should verify the code. Ho hum.
  5. mv httpd-* SOURCES
    Move the source you just downloaded into the SOURCES directory
  6. vi SPECS/httpd.spec
    Make the following changes:

    • Version: 2.0.40 -> 2.0.44
    • Release: 8 -> jl1
    • Comment out the line that says %patch3 -p0 -b .sslink
    • Comment out the line that says %patch40 -p0 -b .cnfdir
    • Comment out the section that has the comment "fix man page paths"
    • Change all occurances of "libapr\." to "libapr-0\."
    • Change all occurances of "libaprutil\." to "libaprutil-0\."
    • Comment out the line that says %{_mandir}/man8/apachectl*.
    • Comment out the line that says %{_mandir}/man8/httpd*.
    • Find the line that reads: "--enable-deflate \". Add a line after it that reads: " --with-ldap --enable-ldap --enable-auth-ldap \". The tab before the "--enable" and the backslash after the end are very important.
    • Add a changelog entry
    • And here's the diff:

      7,8c7,8
      < Version: 2.0.40
      < Release: 8
      ---
      > Version: 2.0.44
      > Release: cli1
      90c90
      < %patch3 -p0 -b .sslink
      ---
      > #%patch3 -p0 -b .sslink
      92c92
      < %patch40 -p0 -b .cnfdir
      ---
      > #%patch40 -p0 -b .cnfdir
      127a128
      > --with-ldap --enable-ldap --enable-auth-ldap 225,232c226,233
      < sed -e "s|/usr/local/apache2/conf/httpd.conf|/etc/httpd/conf/httpd.conf|"
      < -e "s|/usr/local/apache2/conf/mime.types|/etc/mime.types|"
      < -e "s|/usr/local/apache2/conf/magic|/etc/httpd/conf/magic|"
      < -e "s|/usr/local/apache2/logs/error_log|/var/log/httpd/error_log|"
      < -e "s|/usr/local/apache2/logs/access_log|/var/log/httpd/access_log|"
      < -e "s|/usr/local/apache2/logs/httpd.pid|/var/run/httpd.pid|"
      < -e "s|/usr/local/apache2|/etc/httpd|" < docs/man/httpd.8
      < > $RPM_BUILD_ROOT%{_mandir}/man8/httpd.8
      ---
      > #sed -e "s|/usr/local/apache2/conf/httpd.conf|/etc/httpd/conf/httpd.conf|"
      > # -e "s|/usr/local/apache2/conf/mime.types|/etc/mime.types|"
      > # -e "s|/usr/local/apache2/conf/magic|/etc/httpd/conf/magic|"
      > # -e "s|/usr/local/apache2/logs/error_log|/var/log/httpd/error_log|"
      > # -e "s|/usr/local/apache2/logs/access_log|/var/log/httpd/access_log|"
      > # -e "s|/usr/local/apache2/logs/httpd.pid|/var/run/httpd.pid|"
      > # -e "s|/usr/local/apache2|/etc/httpd|" < docs/man/httpd.8
      > # > $RPM_BUILD_ROOT%{_mandir}/man8/httpd.8
      308,309c309,310
      < %{_libdir}/libapr.so.*
      < %{_libdir}/libaprutil.so.*
      ---
      > %{_libdir}/libapr-0.so.*
      > %{_libdir}/libaprutil-0.so.*
      336,337c337,338
      < %{_mandir}/man8/apachectl*
      < %{_mandir}/man8/httpd*
      ---
      > #%{_mandir}/man8/apachectl*
      > #%{_mandir}/man8/httpd*
      359,360c360,361
      < %{_libdir}/libapr.so
      < %{_libdir}/libaprutil.so
      ---
      > %{_libdir}/libapr-0.so
      > %{_libdir}/libaprutil-0.so
      369a371,373
      > * Fri Mar 14 2003 John Lombardo 2.0.44-cli-1
      > - Make it work with Apache 2.0.44 (so we get mod_auth_ldap)
      >

  7. rpmbuild -ba SPECS/httpd.spec
    Finally, you can build the bugger. This will take a few minutes, even on a fast machine. Pay attention to the last thing it says. If it worked it should tell you about your new RPMs, if not, the final few (50 or so) lines will probably tell you where it went wrong.
  8. You should now have the following new files:

    • SRPMS/httpd-2.0.44-cli1.src.rpm
    • RPMS/i386/httpd-2.0.44-cli1.i386.rpm
    • RPMS/i386/httpd-devel-2.0.44-cli1.i386.rpm
    • RPMS/i386/httpd-manual-2.0.44-cli1.i386.rpm
    • RPMS/i386/mod_ssl-2.0.44-cli1.i386.rpm


Install them and you're done. (Don't forget to uninstall the old ones first!)



<< Home

This page is powered by Blogger. Isn't yours?