Giter VIP home page Giter VIP logo

subsystem's Introduction

Cheatsheet on how to setup Windows subsystem for Linux (WSL) for the local development

Linux, Node.js, npm, Git, Apache, PHP, PostgreSQL

Install subsystem

  • press win key
  • type Turn Windows Features on or of
  • tick Windows Subsystem for Linux
  • go to MS store search and install your flavor of linux
  • go to MS store search and install Windows Terminal

Install and setup Node.js and npm

replace 14 with current version

(ignore if the step above worked well) Update Node.js and npm to the latest version

  • sudo npm cache clean -f
  • sudo npm install -g n
  • sudo n latest

sudo n stable for the stabel version

Install and setup Git

  • sudo apt install git
  • git config --global user.email "[email protected]"
  • git config --global user.name "Your Name"

Install and set up Apache, PHP

  • sudo apt install apache2
  • sudo apt install php

Install PostgreSQL

latest for Debian

latest for Ubuntu

run this for either

  • sudo apt-get update
  • sudo apt install postgresql postgresql-contrib

Restart Apache and PostgreSQL

  • sudo service apache2 restart
  • sudo service postgresql restart

Set postgres password (to connect from pgAdmin etc)

  • sudo su postgres (enter your pass)
  • psql
  • \password
  • \q

Create a symlink between Windows projects folder and folder on Linux subsystem e.g.

  • sudo ln -s /mnt/c/projects /var/www/devroot

Setup vhost e.g.

<VirtualHost *:80>
        ServerName www.test.local
        ServerAdmin mac@localhost
        DocumentRoot /var/www/devroot/test

        <Directory /var/www/>
          Options Indexes FollowSymLinks
          AllowOverride All
          Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/testerror.log
        CustomLog ${APACHE_LOG_DIR}/testaccess.log combined
</VirtualHost>

Edit hosts file on Windows

  • press win key
  • type in Notepad
  • right click and open as Administrator
  • with the Notepad open the C:\Windows\System32\Drivers\etc\hosts (make sure all files are selected in the file type dropdown)
  • add a new line 127.0.0.1 www.test.local

Disable terminal's bell sound on tab-completion

  • sudo nano /etc/inputrc
  • uncomment set bell-style none

Uning default terminal colours in tmux

  • nano ~/.tmux.conf
  • paste in
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"

Posh terminal

Follow this tutorial https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx

subsystem's People

Contributors

matasgit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.