How to install apache on CentOS

TL;DR for how to install apache on CentOS server:

[root@bluegrid-edu ~]# yum install httpd
Specification:

OS Version: CentOs 8.2 x64

Full Read

Apache Web server is handled under httpd service in the RHEL operating systems. Same with CentOS. Let’s dive right into it!

Update the operating system:

[root@bluegrid-edu ~]# yum update

Install the httpd service:

[root@bluegrid-edu ~]# yum install httpd

Start the httpd service:

[root@bluegrid-edu ~]# systemctl start httpd

Check the status of httpd service:

[root@bluegrid-edu ~]# systemctl status httpd

Enable the service in systemctl to auto-start on system boot:

[root@bluegrid-edu ~]# systemctl enable httpd

Test the http response:

[root@bluegrid-edu ~]# curl -I https://bluegrid.io
HTTP/1.1 200 OK
Date: Fri, 31 Jul 2020 16:54:25 GMT
Server: Apache/2.4.37 (centos)
Last-Modified: Fri, 31 Jul 2020 16:54:22 GMT
ETag: "0-5abbfa40a7383"
Accept-Ranges: bytes
Content-Type: text/html; charset=UTF-8

Ivan Dabić

A man with a beard and glasses, wearing an orange hoodie and a black cap with a Hard Rock Cafe logo, stands with his arms crossed against a plain white background.

Ivan Dabić

Co-founder and CEO of BlueGrid.io, with a background in cloud infrastructure, distributed systems, monitoring, and security operations. He works closely with engineering teams to build and operate reliable systems while documenting both technical and organizational aspects of modern engineering work.

Ivan is a metalhead, and big fan of cyberpunk move genre. If you are his secret Santa go with Star Wars Lego box!

Share this post

Share this link via

Or copy link