Skip to content

Instantly share code, notes, and snippets.

@koertho
Last active November 27, 2019 20:28
Show Gist options
  • Select an option

  • Save koertho/7e46056a176a509310b7968b8632fece to your computer and use it in GitHub Desktop.

Select an option

Save koertho/7e46056a176a509310b7968b8632fece to your computer and use it in GitHub Desktop.
Windows WSL Setup

WSL Setup

Windows Linux subsystem setup.

Setup MySQL

sudo apt-get install mariadb-server
sudo service mysql start
sudo mysql_secure_installation

Setup PhpMyAdmin

sudo apt install phpmyadmin
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
sudo service apache2 restart

Add mysql user for phpmyadmin

sudo mysql -u root -p
CREATE USER 'sql'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON * . * TO 'sql'@'localhost';
FLUSH PRIVILEGES;

Allow empty passwords for PhpMyAdmin

sudo nano /etc/phpmyadmin/config.inc.php

Uncomment this line: $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

Setup SSH-Key

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa

Output ssh key for github: cat ~/.ssh/id_rsa.pub

Install composer global

Follow introductions from https://getcomposer.org/download/

mv composer.phar /usr/local/bin/composer

Setup PHP

sudo apt-get install php7.2-intl

Custom dev domains

Create a new apache vhost

sudo nano /etc/apache2/sites-available/myapp.test.conf

Vhost config (Optimzed for symlinked Symfony 3.4/Contao 4.4 project folder):

<VirtualHost *:80>
	ServerName myapp.test
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/myapp/web
	
	<Directory /var/www/myapp/web>
		AllowOverride All
		Order Allow,Deny
		Allow from All
	</Directory>
	
	<Directory /var/www>
		Options FollowSymlinks
	</Directory>
	
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost>

Activate page and restart apache:

sudo a2ensite myapp.test
sudo service apache2 restart

Edit as Admin: c:\windows\system32\drivers\etc Add:

127.0.0.1 myapp.test

Access right on symlinked windows folders

/etc/wsl.conf

[automount]
enabled=true
options=metadata,uid=1000,gid=1000,umask=022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment