Laravel and PHP Setup from Scratch
To Install the updates you need to have a ubuntu 16.04, 18.04 or 20.04 server with a non-root sudo-enabled user account and a basic firewall. For a complete setup of php and Laravel we need to install the following:
- Apache and Installing the firewall
- Install Mysql
- Install Php
- Install Composer
Install Apache and firewall
Install Apache using Ubuntu’s package manager, apt, the commands used to install apache is:
- sudo apt update: This command will update all your existing updates that are needed to be updated
- sudo apt install apache2: This will install the apache server. You need to accept the permission by typing Y and then Enter. After completely installing apache2, you need to adjust your firewall settings to allow HTTP traffic.
- sudo ufw app list: This command will list down all your UFW profiles. Output will be like:

- sudo ufw allow in “Apache”: This command will allow traffic on port 80 for the Apache profile.
- sudo ufw status: Use this command to verify the status of your HTTP UFW profiles. Output will be like:

Read more: https://tudip.com/blog-post/laravel-and-php-setup-from-scratch/