How to install Apache 2.4 in CentOS 6

Share this post to your friends !
  • 2
    Shares

SystemMen - In this article, I will show you how to install Apache 2.4 in CentOS 6.10.

By default, CentOS 6.10 (Final) only supports Apache 2.2.15-69.el6.centos. If you want to use the newer version of Apache, you need to do some things.

Install necessary repositories

First, we will when EPEL, this is the repository that we will use very often.

[root@centos6 ~]# yum update -y && yum install epel-release -y

Next, if you find the Apache 2.4 installation package on the CentOS repository as in this link, you will find it belongs to the CentOS SCLo RH x86_64 repository.

To install this repository, type the command below.

[root@centos6 ~]# yum install centos-release-scl-rh -y

Install and use Apache 2.4

After we have added the required repositories, we now type the command below to install Apache 2.4.

Install Apache 2.4 in CentOS 6.10

[root@centos6 ~]# yum --enablerepo=centos-sclo-rh install httpd24 -y

After installation is complete, if you type the command httpd -V as usual, you will get the following error.

[root@centos6 ~]# httpd -V
bash: httpd: command not found
how-to-install-apache-2-4-in-centos-6 How to install Apache 2.4 in CentOS 6
Install Apache 2.4 in CentOS 6.10.

You need to load the environment of scl to be able to use its command line. Type the command below.

[root@centos6 ~]# scl enable httpd24 bash

Now, try typing the httpd -V command again. The Apache version at the time of this article is 2.4.34.

[root@centos6 ~]# httpd -V
Server version: Apache/2.4.34 (Red Hat)
Server built:   Nov 16 2018 12:58:22
Server's Module Magic Number: 20120211:79
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"

Use Apache 2.4 after installation complete

If you list the init.d directory, you will find the httpd24-httpd file, which is the service file of Apache 2.4.

[root@centos6 ~]# ls /etc/init.d/
cgconfig   halt                  iptables    netfs    restorecond  udev-post
cgred      httpd24-htcacheclean  killall     network  sandbox
functions  httpd24-httpd         netconsole  rdisc    single

First, we need to enable the auto start service after the server reboots.

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

Next, you start Apache service up.

[root@centos6 ~]# service httpd24-httpd start
Starting httpd: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
                                                           [  OK  ]

And finally, check the service is working or not.

[root@centos6 ~]# service httpd24-httpd status
httpd (pid  618) is running...

Conclusion

For this article, I’m sure you can successfully install Apache 2.4. As for using it, you need to read more documents on the Apache website, I cannot present it all in one article.

If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.


Share this post to your friends !
  • 2
    Shares
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.