How to create a test Apache Web Server using CentOS 08
My team wants to test out a webpage on my CentOS 8 server. Specifically they want to know if they can access a page over the internet. My task is to install the test web server that will serve the webpage for my team on the CentOS server. I will be utilizing the puTTY program on a windows 10 PC for this task.
I will be utilizing a large CentOS 08 Cloud Playground server on Linux Academy. For context, CentOS 08 is built on RedHat Package Management, or RPM. The following is the list of steps I will be taking to achieve this task:
- Log-in to server
- Update all packages on the server using sudo yum update -y
- Install and activate Apache Web Server using HTTP
- Enable the Apache Web Server using HTTP
- Copy the public IP of the server and share with my team to verify access is possible.
Log-in to server
Update all packages on the server using sudo yum update -y
Since we are using the sudo command, we are required to enter our password. With CentOS being a RPM-based Linux OS, we use the sudo yum update -y command. deb based operating systems may differ in the requisite command.
Be prepared for a wait if this is your first update! Also to note you do not need to include the -y for the update command if you do not wish, though I have used it. Updating is a good way to ensure that you are ironing out and updating any dependencies that you might not have in sync!
Install and Activate the Apache Web Server using HTTP
HTTPS (port 443) is used for transactional websites and in this case not necessary for what my team aims to accomplish with the server. For this reason, we will use HTTP (port 80). We will utilize the command sudo yum install httpd.
We will then double check the status of the httpd install with the command systemctl status httpd.
If inactive, we need to turn it on and activate it with the command systemcl start httpd && systemctl enable httpd.
Recheck status using systemctl status httpd.
Enable the Apache Web Server using HTTP
We then will use the command curl localhost:80.
Curl sends data to and from servers using a specified protocol. In our task we will use HTTP. This means using a certain port, and the port number to use is 80. Note: https://linuxconfig.org/redhat-8-open-and-close-ports is a fantastic resource for inquires regarding ports on CentOS or RedHat.
Copy the public IP of the server and share with my team to verify if access is possible
Now it is time to send over to the team!