compile apache

Discussion in 'Server Operation' started by mr_dizzle, Dec 12, 2006.

  1. mr_dizzle

    mr_dizzle New Member

    I'm currently running CentOS 4.4 with Apache/2.0.52 installed via up2date/rpm.

    I'm having some trouble getting apr working correctly, so I was going to build apache from source using the following notes:

    wget http://www.apache.org/dist/httpd/httpd-2.0.59.tar.bz2

    tar -xjf httpd-2.0.59.tar.bz2

    rm -rf httpd-2.0.59.tar.bz2

    cd httpd-2.0.59

    ./configure --prefix=/usr/local/httpd-2.0.59 --enable-mods-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr

    make

    make install

    cd /usr/local

    ln -s httpd-2.0.59 apache2

    My questions are.....

    How will it know to use this version of apache rather than than rpm version currently installed? Do I have to remove those apache rpm's?

    Will I have have to recompile php and mysql to get them to work with the apache source build since they were installed via rpm as well?

    Do my ./configure flags look ok?

    Is there a specific order I should build? apache, then php?

    Thanks,
     
  2. drks

    drks New Member HowtoForge Supporter

    A better way to do this would be to rebuild the httpd (Apache) RPM with the new source...

    up2date --get-source httpd
    rpm -Uvh /var/spool/up2date/httpd-<version>.src.rpm
    wget http://www.apache.org/dist/httpd/httpd-2.0.59.tar.bz2
    mv httpd-2.0.59.tar.bz2 /usr/src/redhat/SOURCES
    cd /usr/src/redhat/SPECS
    vi httpd.spec (modify the Version/Release lines)
    rpmbuild -ba httpd.spec


    Once built you can upgrade httpd

    rpm -Uvh /usr/src/redhat/RPMS/i386/httpd*.rpm --test
    rpm -Uvh /usr/src/redhat/RPMS/i386/httpd*.rpm


    That would be the recommended way to go about it.... installing software from source on an RPM distro is just dirty.... and should be avoided when possible.
     

Share This Page