Ubuntu Install Apache

Run the command below to install Apache web server in Ubuntu 20.04.

sudo apt update
sudo apt upgrade -y
sudo apt install apache2 -y

Once installation completed, it is best to change the owner of the apache web server root folder to www-data.

cd /var
sudo chown -R www-data: /var/www
sudo chmod -R 775 /var/www

Assuming you are using the default user “ubuntu”, you will need to add yourself into “www-data” group. You’ll need to logout and login again to get the updated permission.