Installing Apache2 on Linux (Ubuntu 2204)

  1. Connect to the server using ssh
  2. sudo -s into root shell (Recommended to sudo the commands but I am lazy)
  3. apt update
  4. apt upgrade
  5. reboot (Do a clean reboot after updating/upgrading. Same for other OSs)
  6. apt install apache2 – Install the main software
  7. ufw app list – Check the firewall setting
  8. ufw app info “Apache Full” – This will tell you more info such as ports
  9. ufw allow “Apache Full” – This will allow the firewall to open ports for Apache2

Now if you are on Cloud , such as Azure ,

  1. go to Resource Group or the VM directly
  2. Go to Network Settings
  3. Add an INBOUND rule , TCP port 80 with Source and Destination as Any.
  4. Now go to http://public-ip-address and the Default page should be up
Thanks for reading and happy learning! billy-at-python.sg

Leave a Reply 0

Your email address will not be published. Required fields are marked *