I want to upgrade Apache from 2.2.15 to 2.4.4 in CentOS. Do I need to download update files to a folder and update Apache? Is this even possible?
CentOS 6.x does not provide 2.4.x, only 2.2.x versions of Apache. CentOS like the Red Hat OS it derives from, RHEL are geared towards stability and so tend to lag behind what's cutting edge. So you'll need to either:
- compile it yourself
- find source RPMs and rebuild/recompile them
- find a repository that already has it pre-built in RPM form
- find pre-built binaries not in an RPM (often installed to
Rolling it yourself
There are numerous tutorials online for compiling Apache 2.4.x from scratch yourself on CentOS 6.x, here's one such: Install Apache 2.4.4 on CentOS 6.4, that shows how.
You can also try downloading the
.tar.gz file directly, it includes a RPM
.spec file so you can rebuild it like so:
$ rpmbuild -ts httpd-2.4.x.tar.bz2
I wouldn't expect to get too far with that approach however, since you'll likely need several other packages which are a bit tricky to come by on CentOS 6.x, without rebuilding them too.
Finding a repo
I would likely encourage you to not try and build it yourself unless you're really curious how to do it. I've done it and it's doable but can take some time and can be a bit frustrating at times. Rather I'd encourage you to simply use the Remi Collet Repository that has it already built for EL6 (That's RHEL 6 & CentOS 6).
Remi's site provides software collections, and you'll want to use the httpd24 one. All that's needed is to install the
.repo file from that URL and do a
yum update. This will bring your stack up from 2.2 to 2.4.
NOTE: The software collections (SC's) provided by Remi Collet's site are somewhere between options #3 & #4. I say this because they're distributed as RPMs but the software is installed into the directory
/opt. So you'll be able to migrate your sites to 2.4, rather then just jumping directly to it, which IMO is a good thing. However you'll have to reconfigure things in order to make use of the installed version of Apache 2.4!
The easiest way is to install the SCL version, as described here: