This tutorial will show you how to set up an Apache Web server in a matter of minutes.
Apache is the most widely used web server software. Developed and maintained by Apache Software Foundation, Apache is an open source software available for free. As a Web server, Apache is responsible for accepting directory (HTTP) requests from Internet users and sending them their desired information in the form of files and Web pages.
Here are the items you will need:
CentOS8 Server - Some online training programs, such as A Cloud Guru, offer a “playground” for you to set up a server for free.
Command Line Interface (CLI) - where are going to use a few commands to set up Apache on our server as well as a few additional steps to make it ready to be viewed on the internet.
An AWS account with sudo privileges - It is best practice to not use the Root account to make changes to your server.
Here is what you have to do:
- Update all the packages on the server.
- Install an Apache HTTP Web Server.
- Enable the Apache Web Server.
- Opening Port 80 on the firewall.
- Grab the Public IP Address of the server and paste it on any web browser to see the Apache Test Page.
- Customize your Web Browser to see your own message.
1. Update all the packages on the server
Update all the packages to the latest version to ensure that the server is up to date. Installation requires sudo for elevated permissions and y for no user interaction, on the command line.
Enter the command: sudo yum -y update
2. Install an Apache HTTP Web Server
Again use sudo for elevated permissions and y for no user interaction during installation.
This step may also take a few minutes as it pulls all files needed to install Apache on your CentOS8 server. Once completed, you will be greeted with a “Complete!” message.
3. Enable the Apache Web Server
Enabling Apache will allow it to start on boot.
The system is now up and usable.
To verify the status of Apache on your server, use the following command:
You want to ensure that the active status says “active (running)” in this message.
4. Opening Port 80 on the firewall
we need to open port 80 to accept HTTP connection.
now add the services — HTTP/HTTPS permanently to the configuration
To check whether or not HTTP/HTTPS services are added permanently
After adding the services, you will need to reload the firewall so that the changes can take effect.
5. Grab the Public IP Address of the server and paste it on any web browser to see the Apache Test Page
First we need to obtain our public IP address of the server
The above command gave you the Public IP Address as “54.177.1.119”. Paste this in any web browser. Use http://your server IP
(http://54.177.1.119)
Extra Point
6. Customize to see your own message on your Web browser instead of seeing the standard Apache Web page.
As sudo, cd to /var/www/html/. Create an index.html file with your customized message
and save it.
Now paste the same command in any web browser. Use http://yourserver IP
Congratulations! You can see your own customized message on the Web Browser.
Top comments (0)