Set Up A Firewall On Ubuntu
A firewall is software that helps protect web servers from unauthorized access by very carefully defining the specific types of access that are permitted. Ubuntu comes with Uncomplicated Fire Wall (UFW) already installed, but it’s often not active by default. This post describes how to enable and configure a firewall for an Ubuntu web server.
Set Up UFW
ssh -i ~/.ssh/supernifty supernifty@143.198.116.106 RETURN
Check the UFW status:
sudo ufw status RETURN
Activate UFW if it’s inactive:
sudo ufw enable RETURN
If UFW was inactive when you first checked the status, check it again now that it’s active to get a report on how it’s been configured. If ‘Apache Full’ does not appear in the ‘To’ column, you’ll want to make some adjustments to the config:
sudo ufw status RETURN
Enable ‘Apache Full’ which will cover both http and https.
sudo ufw allow ‘Apache Full’ RETURN
OpenSSH is likely already in the ‘To’ column, but if it isn’t, add it.
sudo ufw allow ‘OpenSSH’ RETURN
If both ‘Apache’ and ‘Apache Full’ are in the ‘To’ column, you can remove ‘Apache’ if you want to – it’s redundant. But it won’t hurt anything to leave them both there.
sudo ufw delete allow ‘Apache’ RETURN
One last check of the status to make sure everything’s ticked and tied.
sudo ufw status RETURN
With the UFW firewall in place, it’s time to install MySQL database server software.