W3Schools Learner's Blog

W3Schools Programming knowledge summary website

div

12/15/2017

How to Install The Latest Apache Server (as httpd 2.4.29) on Centos 7

How to install the latest Apache Server (as httpd 2.4.29) on Centos 7? it's very simple!
Apache is the best PHP server, and the Apache server under httpd 2.4.15 has security vulnerabilities, so it is necessary to install the latest version of the Apache server.

Introduction
Apache is the best PHP server, and the Apache server under httpd 2.4.15 has security vulnerabilities, so it is necessary to install the latest version of the Apache server. 

In this tutorial I am going to describe simple steps to install the latest Apache (The latest version of the Apache server is httpd 2.4.29) version on your Centos 7 system.

step1: Check out the Apache version in default repository
  1. yum info httpd
If you have default installation, you will most likely see similar output.
  1. [root@VM_219_180_centos ~]# yum info httpd
  2. Loaded plugins: fastestmirror, langpacks
  3. Loading mirror speeds from cached hostfile
  4. Available Packages
  5. Name        : httpd
  6. Arch        : x86_64
  7. Version     : 2.4.6
  8. Release     : 67.el7.centos.6
  9. Size        : 2.7 M
  10. Repo        : updates/7/x86_64
  11. Summary     : Apache HTTP Server
  12. URL         : 
  13. http://httpd.apache.org/
  14. License     : ASL 2.0
  15. Description : The Apache HTTP Server is a powerful, efficient, and extensible

  16.             : web server.
As you can see from the output above, there is only 2.4.6 Apache version available in default repos.
Then, Run the following two commands to view the change log (which can be ignored)
  1. sudo yum install yum-changelog
  2. yum changelog httpd

step2: Set up CodeIT repositories,CodeIT provides the latest version of web server, such as apche and nginx server. Before setting up CodeIT, you need to start EPEL, which is a package that CodeIT must depend on.
  1. sudo yum install -y epel-release
Enable the CodeIT repository, copy all.
  1. cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" 
  2. $(rpm -q --whatprovides redhat-release)`.repo
Then verify the Apache package version again and you should see something like that.
  1. [root@VM_219_180_centos yum.repos.d]# yum info httpd
  2. Loaded plugins: changelog, fastestmirror, langpacks
  3. Repository epel is listed more than once in the configuration
  4. CodeIT                                                                                                                                                                                                   | 2.9 kB  00:00:00     
  5. CodeIT/x86_64/primary_db                                                                                                                                                                                 |  69 kB  00:00:05     
  6. Loading mirror speeds from cached hostfile
  7. Available Packages
  8. Name        : httpd
  9. Arch        : x86_64
  10. Version     : 2.4.29
  11. Release     : 2.codeit
  12. Size        : 1.3 M
  13. Repo        : CodeIT/x86_64
  14. Summary     : Apache HTTP Server
  15. URL         : 
  16. https://httpd.apache.org/
  17. License     : ASL 2.0
  18. Description : The Apache HTTP Server is a powerful, efficient, and extensible
  19.             : web server.
step3: Install the Apache httpd web-server
  1. yum install httpd
Start / restart / stop the Apache httpd2.4.29 server with the following command 
  1. systemctl start httpd
  2. systemctl restart httpd
  3. systemctl stop httpd
If the httpd server is installed and started successfully, we can use http://ip to access the web page.

thanks!

No comments:

Post a Comment

Note: only a member of this blog may post a comment.