19

I need Apache 2.4 in CentOS because with Apache 2.2 mod_proxy_wstunnel is not possible. I have tried this, but unfortunately its for RHEL. After installing, I can't execute the Apache 2.4.

Can anyone show me how to install a complete working Apache 2.4 in CentOS, please?

EDIT:

# yum list installed | grep httpd
Failed to set locale, defaulting to C
httpd.x86_64                         2.2.15-30.el6.centos       @updates        
httpd-tools.x86_64                   2.2.15-30.el6.centos       @updates        
httpd24.x86_64                       1-6.el6                    @epel-httpd24   
httpd24-apr.x86_64                   1.4.8-2.el6                @epel-httpd24   
httpd24-apr-util.x86_64              1.5.2-5.el6                @epel-httpd24   
httpd24-httpd.x86_64                 2.4.6-5.el6                @epel-httpd24   
httpd24-httpd-tools.x86_64           2.4.6-5.el6                @epel-httpd24   
httpd24-mod_ssl.x86_64               1:2.4.6-5.el6              @epel-httpd24   
httpd24-runtime.x86_64               1-6.el6                    @epel-httpd24   
  • 1
  • Thank you. See my answer please, they way i requested, cause the original link is still confusing for someone to get started. – user11085 Jun 24 '14 at 9:10
  • you'll need to run yum install httpd24-httpd how do you install this to replace the Apache 2.2.15 that comes with the distro so I can install the update and use httpd instead of httpd24-httpd with the service start and stop commands? – user92788 Nov 25 '14 at 18:26
  • 1
    The easiest way is to install the SCL version, as described here: unix.stackexchange.com/questions/412122/… – CpnCrunch Apr 10 '18 at 20:45
23

Apache 2.4 on CentOS:

Step 1:

cd /etc/yum.repos.d/
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo

Step 2:

yum install httpd24.x86_64

Step 3:

$ /opt/rh/httpd24/root/usr/sbin/httpd -version
Server version: Apache/2.4.6 (Red Hat)
Server built:   Sep 25 2013 05:25:46

NOTE: config files are in: /opt/rh/httpd24/root/etc/httpd

$ ls
conf  conf.d  conf.modules.d  logs  modules  run

EDIT: in case you want to switch off Apache 2.2

$ chkconfig httpd off
$ chkconfig --list | grep httpd
httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
httpd24-httpd   0:off   1:off   2:off   3:off   4:off   5:off   6:off

EDIT 2: http://wiki.apache.org/httpd/PHP-FPM

yum install php-fpm
/etc/init.d/php-fpm start
  • 6
    You should be able to start the service with # service httpd24-httpd start. Before that you must either stop the original httpd service (apache 2.2) or configure your apache 2.4 to listen on an alternative port (not port 80). – garethTheRed Jun 24 '14 at 9:32
  • 1
    Using that repo I'm getting this error: repos.fedorapeople.org/repos/jkaluza/httpd24/epel-6/x86_64/…: [Errno 14] problem making ssl connection – poisa Jan 16 '15 at 16:51
  • 3
    The repo for me is quite useless. It still contains Apache/2.4.6 from 2013. That's quite disappointing that apache can't maintain its own repository... – szymond Jul 7 '15 at 7:07
  • 1
    Being an older version of apache isn't a problem. The 2.2.15 apache in Centos 6 is from 2010 after all. What is more of a problem is that it isn't updated with bugfixes and security fixes. – CpnCrunch Jul 21 '16 at 23:27
  • 1
    Here is the best answer: unix.stackexchange.com/questions/412122/… – CpnCrunch Apr 10 '18 at 20:46