How To Update Apache 2.4 Web Server (HTTPD) on VestaCP CentOS 7

DigitalOcean Referral Badge
Start your VPS now with FREE $100 credit.

As an open source and completely free control panel, VestaCP comes with a variety of web server options including Apache, Nginx + PHP-FPM, and Apache + Nginx as reverse proxy. Unfortunately, if we run VestaCP on CentOS 7+ we will get an obsolete Apache 2.4.6 web server installed on our server.

So we need to update it to the latest stable version of Apache 2.4 web server. Of course, this is useful to avoid vulnerabilities that have been found on obsolete versions of the previous Apache 2.4 web server.

Well, in order to update the Apache 2.4 web server to the latest stable version on VestaCP CentOS 7, we need to add the EPEL7 and CodeIT repositories.

1.) Install EPEL7 Repository

$ sudo yum install -y epel-release

2.) And then please add CodeIT Repository as well.

$ cd /etc/yum.repos.d && wget`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo

3.) Now, update your Apache web server to the latest stable version of Apache 2.4+:

$ yum install httpd

4.) Start Apache web server

$ systemctl start httpd

5.) Check your Apache (HTTPD) version

$ httpd -v

6.) However, if you get an error when starting the Apache 2.4 web server for the first time, you can remove 10-proxy_h2.conf file under the /etc/httpd/conf.modules.d/ directory or simply comment the following line.

#LoadModule proxy_http2_module modules/

7.) To enable HTTP/2 mode, please add “Protocols h2 h2c http/1.1” at the last line of the /etc/httpd/conf/httpd.conf file.

IncludeOptional conf.d/*.conf
Protocols h2 h2c http/1.1

8.) OK ALL DONE… Now Restart and Enable HTTPD server

$ systemctl start httpd
$ systemctl enable httpd

Leave a Comment