To run a local website on ubuntu, see the previous blog where I installed Windows Subsystem for Linux. This blog shows a quick setup for Ubuntu on WSL. We will install PowerShell, SSH, Apache2, UFW, Midnight Commander and Oh my ZSH on Ubuntu.
Open a Windows Terminal as administrator, select the Ubuntu option. Accept the permission dialog to start the terminal.
PowerShell
PowerShell is a command shell that includes features such as robust command-line history, tab completion, command prediction, and an in-console help system similar to Unix man pages. In a new tab page of the browser, open the Microsoft learn page and execute the following statements in the Ubuntu prompt:
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y wget apt-transport-https software-properties-common
source /etc/os-release
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell
pwsh
SSH
Secure Shell (SSH) is a network protocol that allows secure remote access to a system. In a new tab page of the browser, open the OpenSSH page and execute the following statements in the Ubuntu prompt:
sudo apt install openssh-server
sudo systemctl enable --now ssh
sudo systemctl status ssh
Apache
My choice of web server for Ubuntu. Setup hosts for different website you want to run. In a new tab page of the browser, open the Apache page and execute the following statements in the Ubuntu prompt:
sudo apt-get install apache2
Test if you can access the default website: http://localhost
Note down the IP Address of your Ubuntu terminal.
hostname -I
You should be able to access http://<Ubuntu IP Address>
UFW
As the name suggest, this is an easy tool to setup firewall rules. In a new tab page of the browser, open the Uncomplicated Firewall page and execute the following statements in the Ubuntu prompt:
sudo apt-get install ufw
sudo ufw allow http
sudo ufw allow https
Midnight Commander
Midnight commander is a file manger that runs on Ubuntu. The Windows equivalent is Windows Commander, which use daily. In a new tab page of the browser, open the Midnight commander page and execute the following statements in the Ubuntu prompt:
sudo apt-get install mc
mc
Oh my ZSH
ZSH has many features that come in handy when developing. One of them is that the prompt is shortened to show only the last folder name, instead of showing the complete path. Another feature I like is that it integrates with git very easily. So, in a new tab page of the browser, open the Oh my ZSH page and execute the following statements in the Ubuntu prompt:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"