Installing Apache Web Server (DigitalOcean droplet)

in Steem Cameroon7 days ago (edited)

fombae-empty-cover.png

Greeting Steemit Family

I will continue from where we ended last time, so we will not be going through the step of creating a droplet. You can follow from my last post on Digital Ocean. Create a droplet( server) DigitalOcean

With that you can easily follow from there to what we will be doing today. This is a small project to demonstrate to the interns how to install and run apache2 on a droplet. As I said, I will be creating time to share the moment I will be having with my current interns.

I have created my droplet following the steps and copied my IP address. This time, we have a new IP address because I destroyed the droplet I created last time.

Screenshot 2025-03-15 112841.png

They are not specific instructions, I will be using general principles put together. So let this not be your manual, in other words, try to follow the documentation. How To Install the Apache Web Server on Ubuntu 18.04. To have strong passwords, make use of the Password Generator.

It will be a Bitvise SSH client app, but you can use any other to log into the droplet.

Screenshot 2025-03-15 114901.png

I have to log in as the default user root, which is our starting point.

Screenshot 2025-03-15 114928.png

Since it is the super user, it is not encouraged to work from the root account. So, I will be creating unprivileged users for security reasons.

adduser fombae

Now our droplet has two users, that is root and fombae. The root has all the privileges, while fombae has the sudo limit because it is an unprivileged user

Screenshot 2025-03-15 115536.png

I will switch to the user fombae, but remember my unprivileged user can't sudo. So I will have to log back in as root to give fombae the sudo privilege.

usermod -aG sudo fombae

Now I can go ahead to work as a fombae user. This project is to install Apache to the droplet, and we will be following the instructions from the documentation on Digitalocean.

There will be no need to repeat the documentation here, but I will just go ahead and share the screenshot of my process. Start by updating the package and installing the apache2 package.

sudo apt update
sudo apt install apache2 -y

Screenshot 2025-03-15 120559-1.png

Screenshot 2025-03-15 120559-1a12.png

Screenshot 2025-03-15 120559-1a13.png

Check Apache2 installation status

sudo systemctl status apache2

Screenshot 2025-03-15 120559-1a14.png

Screenshot 2025-03-15 120559-1a15.png

Let's get the IP address and check on the browser

Screenshot 2025-03-15 120559-1a16.png

At this point, we completed the installation of Apache2 on the droplet. Let me share the IP and domain.

http://64.227.110.137/

http://fombae.site/

From our server, we can manage the Apache2 services. You can check the status, stop, restart, reload, disable, and enable.

Screenshot 2025-03-15 120559-1a17.png

Screenshot 2025-03-15 120559-1a18.png

Screenshot 2025-03-15 120559-1a19.png

The explanation is in the documentation, and I don't want to repeat it here. But if you think you need more clarifications, I will let the server live. You can view and receive the default Ubuntu 18.04 Apache web page from your location.

In our next post, we will be looking at installing Mysql.



Cheers
Thanks for dropping by
@fombae

Sort:  

Thank you @fombae for you effort .

I READ your tutorial. It very good for new people.
Your steps show clear:

First you make droplet
Then you login with root
You make new user for safety
You give new user sudo power
You install Apache
You check if Apache working
You show how to control Apache

I like how you put pictures. Pictures help understand better. Also good you show IP address and domain working at end.
Some things maybe make better:

Tell why use sudo not root all time
Tell why update before install
Maybe show more about firewall rules
Show little bit what files in /var/www/html

But overall very good, to learn how to make web server from your steps. You explain hard things in simple way. Good job.

 5 days ago 

Tell why use sudo not root all time
Tell why update before install
Maybe show more about firewall rules
Show little bit what files in /var/www/html

Security measures are the reason I created the unprivileged user, which I later gave the sudo privilege. That way, I can do every administrative task without giving out the root password.

Most of the time, updating before installing will help avoid installation errors. Have the latest version of the package before installing it.

My next project will be hosting a static website.

Thanks, I hope to be sharing what I will be working on the platform.

Upvoted! Thank you for supporting witness @jswit.