How to install Apache2 with Ubuntu WSL on Windows 10, start the apache2 server and access on localhost using your favorite web browser on Windows 10.
This post assume that you already have installed Ubuntu subsystem on Windows 10, if you have not installed yet, watch this video below.
This video will help enable Windows 10 subsystem and installed Ubuntu or Debian subsystem.
Install Apache httpd server
To install apache2 https server with WSL, launch your WSL (Ubuntu/Debian) and run the following commands.
sudo apt update
sudo apt install apache2 -y
Start the apache2 server
sudo service apache2 start
Allow Windows 10 Firewall
As soon as you run the apache2 start command, you’ll be prompted with a window asking for your permission to allow the apache httpd server to run on Windows 10.
localhost on your web browser
Launch your preferred web browser and navigate to localhost and here you have it.