Skip to content

Instantly share code, notes, and snippets.

Forked from aslamdoctor/
Created June 17, 2020 07:09
What would you like to do?
Windows 10 - WSL LAMP Stack Setup


Install Windows Subsystem (Ubuntu)

Run this command in powershell as administrator

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Reboot PC Install Ubuntu from Microsoft Store

Open Ubuntu and run below commands:

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install lamp-server^

Add below code inside /etc/apache2/apache2.conf:

Servername localhost
AcceptFilter http none

And restart apache server

sudo service apache2 start

And try http://localhost or

Install PHPMyAdmin

sudo service mysql start
sudo mysql
SELECT user, authentication_string, plugin, host FROM mysql.user;
ALTER user 'root'@'localhost' identified with mysql_native_password by 'mypassword';
sudo apt-get install php-mbstring php-gettext phpmyadmin

Setup Apache Hosts File

cd /etc/apache2/sites-available/
sudo nano example1.local.conf

Add below code and save:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName example1.local
        ServerAlias *.example1.local

        DocumentRoot /mnt/e/example1.local

        <Directory />
                Options FollowSymLinks
                AllowOverride None

        <Directory /mnt/e/example1.local>
                Options Indexes FollowSymlinks MultiViews
                AllowOverride All
#               Order allow,deny
#               Allow from all
                Require all granted

And run below commands to enable example1.local website:

sudo a2ensite example1.local.conf
sudo service apache2 reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment