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 https://repo.codeit.guru/codeit.el`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/mod_proxy_http2.so
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
We are a bunch of people who are still continue to learn Linux servers. Only high passion keeps pushing us to learn everything.