Jump to content

Install LAMP to wsl2 in windows 10 and configure VS Code for wsl2.


Michael

 

instructions in the video:

  1.  sudo add-apt-repository ppa:ondrej/php
  2. sudo add-apt-repository ppa:ondrej/apache2
  3. sudo apt update && sudo apt upgrade
  4. sudo apt install apache2 mysql-server curl php7.4 php7.4-xml php7.4-zip php7.4-mbstring php7.4-curl php7.4-mysql php7.4-gd php7.4-imagick
  5. nano .bashrc (go to end of file and add the follow, each on new lines):
    1. sudo service apache2 start
    2. sudo service mysql start
    3. sudo service cron start
  6. cd ~
  7. sudo a2enmod userdir
  8. sudo nano /etc/apache2/mods-available/userdir.conf (in the allowoverrid remove what is there and add ALL)
  9. sudo nano /etc/apache2/mods-available/php7.4.conf (comment out the php_admin_flag engine off by placing a # before it).
  10. sudo service apache restart
  11. cd ~/public_html
  12. code . (to install the vscode app inside wsl2 and open it to your public_html directory).

securing mysql:

  1. sudo mysql -u root -p
  2. CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
  3. GRANT ALL ON *.* TO 'myuser'@'localhost';
  4. flush privileges;
  5. quit

mysql should now be secured with a user and password. 


User Feedback

Recommended Comments

There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...