Well, SSH is one thing, but what about our web access?
Well,
why don't we go through and install the Apache2 Web Server on our Ubuntu
system and then go through and allow access to HTTP, but maybe this time,
we only want to allow HTTP from a single host.
So if we want to allow access only from the AlmaLinux host to our web server,
then again, we can go through and set that rule.
So we're going to go through and do this now from our
command line to enable HTTP access,
installing the Apache2 Web Servers on Ubuntu, and allowing
access only from our AlmaLinux system.
Well, again, this is really straightforward,
let's go through and do an apt update just to make sure that we are
up to date as far as our metadata is concerned.
This is just going to ensure then that we can find the
packages that currently represent our web server,
so we can allow this to chug through.
With that done, we can then go through and clear our screen,
so Ctrl+L and then apt install ‑y and it's apache2 is the
web server package that we want in Ubuntu.
Remember, it's HTTPD when we're looking at our Red Hat‑based systems.
But this will both install our web server and start it,
so it will be up and running once it has finished the installation.
But we're not going to be able to access it,
we need to make sure that we allow then the traffic through our firewall.
So with installation complete, I can move out to my AlmaLinux system.
And if I try and curl from our Ubuntu system,
we can see that we're unable to connect to the web server.
Let's do a Ctrl+C on this.
Moving back to Ubuntu, we're going to go through and run our ufw allow http.
Now if I just put this rule in, it's allowed from anywhere.
If we only want it then from a certain host or network,
then the same as before, then ufw allow from 192.168.33.11,
that's the IP address of my AlmaLinux system,
to any port http.
If we check our status, so ufw and then status,
we can see now we've got that second rule.
It's not coming from a subnet, we can see we don't have the slash at the end,
so it's coming in just from a single IP address.
But let's go through now to that system,
obviously, you have to use the IP addresses that match your systems,
but I'm using 13 and 11.
If I try then and connect to the Ubuntu web server on the IP address 13,
we can see now that I'm getting through to the web server.
Again, it's just HTML information,
but that is fine. We're not working as a browser,
we're just looking at the very basic HTML data that is being returned.
So my rule has worked, and we now got our security defined pretty much the way that we want it.