CentOS 6
Sponsored Link

Install Apache httpd 2.42016/08/30

 
The version of Apache httpd in CentOS 6 repository is 2.2 but Install 2.4 with RPM package if you need.
[1] It's possible to install from CentOS SCLo Software Collections.
It's OK to install it even if 2.2 is already installed because 2.4 is located on another PATH.
# install from SCLo

[root@www ~]#
yum --enablerepo=centos-sclo-rh -y install httpd24
[2] Packages from Software Collections are installed uder the /opt directory.
To use it, Load environment variables like follows.
# load environment variables

[root@www ~]#
scl enable httpd24 bash
[root@www ~]#
httpd -V

Server version: Apache/2.4.18 (Red Hat)
Server built:   Jul 19 2016 22:15:59
Server's Module Magic Number: 20120211:52
Server loaded:  APR 1.5.1, APR-UTIL 1.5.4
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/opt/rh/httpd24/root/etc/httpd"
 -D SUEXEC_BIN="/opt/rh/httpd24/root/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/opt/rh/httpd24/root/var/run/httpd/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

[root@www ~]#
which httpd

/opt/rh/httpd24/root/usr/sbin/httpd
[3] The operations of starting or stopping httpd are like follows. It's possible to use 2.2 and 2.4 together, but then it needs to change default 80 port to another port on either one.
# stop 2.2

[root@www ~]#
/etc/rc.d/init.d/httpd stop

Stopping httpd: [ OK ]
# start 2.4

[root@www ~]#
/etc/rc.d/init.d/httpd24-httpd start

Starting httpd: [ OK ]
# set auto-start

[root@www ~]#
chkconfig httpd24-httpd on

Matched Content