Boman Avong
3 min readJun 9, 2021

--

Photo Credit: TechRepublic

Installing and Configuring Apache Server

Apache HTTP server is the most widely-used web server in the world. It provides many powerful features including dynamically loadable modules, robust media support, and extensive integration with other popular software.

Prerequisites

  • A non-root user with sudo privileges configured on Centos Server, set up by following the initial server setup guide for Centos Server.
  • Basic configured firewall on Centos Server by configuring firewalld to open up port 80 to allow Appache to serve request over HTTP.

Objectives

  1. Update all packages on the server
  2. Install an Apache HTTP Web Server
  3. Enable the Apache Web Server
  4. Grab the public IP of your server and send it to your coach to verify if we can access that test webpage over the internet!
  5. Update all packages on the server

a. $ sudo yum check-update: Checks for all available updates. The output will contain a list of all packages that are available for update.

b. $ sudo yum update: The command will update the repositories and give a list of all packages that can be updated. Accept install when prompted by typing y. Let it run till you get a “Complete!” message.

2. Install an Apache HTTP Web Server

a. $ sudo yum install httpd: This command will install Apache and all required dependencies. Let it run till you get a “Complete!” message.

a. $ sudo systemctl start httpd: This command starts the Apache server. After installation, Apache is not started automatically on CentOS. The service is disabled and the next step will be to enable the Apache Server.

3. Enable the Apache Web Server

a. $sudo systemctl enable: Configures the system to start the service at next reboot.

b. $ sudo systemctl status httpd: Run this command to verify that httpd service is running. This is verified by an active status when the service is running as shown below.

4. Grab the public IP of your server and send it to your coach to verify if we can access that test webpage over the internet!

a. Run $ hostname -I for IP address or curl localhost: Access the default Apache landing page to confirm that the software is running properly through IP address(http://IP Address)or by typing localhost in the browser.

Apache is fully installed!!

--

--