This is a set of configuration files and tools to quickly set up a fresh WSL-Distro.
It's created to use it on Windows 10/11 with WSL1, apache2 and PHP ^7.4.
Never use this at critical infrastructure like production-environment, etc!
It is suggested to clone this repository into your home-directory.
$ cd ~
$ git clone [email protected]:LKnulp/wslIgnite.git ./wslIgnite
$ cd wslIgnite
If you want to use the install-script call spark.sh
.
If you specified a different name of the directory or used a whole different path, please make sure to update
the spark.conf
before runing the installation.
$ sudo ./spark.sh
See
$ sudo ./spark.sh -h
to learn how to modify the installation.
Make sure to run
source ~/.bashrc
after the installation finished to enable all new configuration and aliases.
Additionally, all installed config files which may need you attention, will be opened in VS-Code.
Please make sure to check them and especially add WSL_USER
and WSL_EMAIL
whithin the wslIgnite.conf
.
Although the installation by script is recommended, if you want to perform the installation manually, you can find the steps here.
You can remove all changes, links and files created by the install by calling
$ sudo ./spark.sh -r
Don't worry, you don't have to give the uninstall the exact same parameters as used for install.
The script will complain that locations cannot be removed but it will succeed anyway.
wslIgnite/............................ Your wslIgnite-package directory, may vary on the clone-name you choose.
│
├── fuel/............................. Holds all the files for local use/ change after copying and linking.
│ │
│ ├── .bash_aliases.example......... A suggestion for useful shortcuts
│ │
│ ├── changePHP.sh.example.......... A tool to change the active PHP-version for CLI and apache2 in one command
| │
| ├── configPHP.sh.example.......... A tool to change basic setting of a PHP-version to make local-dev easier.
│ │ For CLI and apache2
| |
| ├── spark.conf.example............ Configuration for the install-script
| |
│ ├── tmux.conf.example............. A very basic tmux configuration to make live easier (mouse-support)
│ │
│ ├── vhost.sh.example.............. A tool to create or remove vhosts (directories and configuration) for apache2
│ │
│ ├── vimrc.example................. A very basic vim configuration to make it look better
│ │
| ├── wsl.conf.example.............. A basic configuration of WSL to make networking easier
│ │
│ └── wslIgnite.conf.example........ A configuration for the tool-scripts included here
│
├── ***.bash_aliases
│
├── .gitignore
│
├── ***changePHP.sh
│
├── ***configPHP.sh
│
├── README.md
│
├── ***spark.conf..................... The configuration for the install-script
│
├── spark.sh.......................... The install-script
│
├── ***tmux.conf
│
├── ***vhost.sh
│
├── ***vimrc
│
├── wsl-install.md.................... A collection of steps and tips to make WSL1 a local DEV-environment
│
├── ***wsl.conf
│
└── ***wslIgnite.cfg
Each file (*.example
) within the fuel
-directory will be copied into the root directory by the spark.sh
install script for you.
Also, all of these (potentially) copied files are added to the .gitignore
by default, to give you the ability to modify them the way you want.
All of these config-files and tool-scripts will then be made usable by creating sym-links at the preferred locations all over the WSL-distro.
Moreover it assumes that an apache2 webserver as well as VS-Code is used.
This basic config was grabbed from https://juliu.is/a-simple-tmux/
If you choose to install this, a sym-link within your $HOME-directory named .tmux.conf
will be created,
pointing to the copied .tmux.conf
within the root of this package.
This basic config was grabbed from https://www.freecodecamp.org
If you choose to install this, a sym-link within your $HOME-directory named .vimrc
will be created,
pointing to the copied .vimrc
within the root of this package.
This is just a set of bash-aliases which were found useful over the time. Feel free to extend or change them by your flavor.
If you choose to install this, a sym-link within your $HOME-directory named .bash_aliases
will be created,
pointing to the copied .bash_aliases
within the root of this package.
Among other things, aliases are included to give you quick access (VS-Code) to the different config files of this package as well as a shortcut to edit the windows hosts-file.
It also sets a new code for you PS1 promt. If you dont want this, just remove the last line in the .bash_aliases
file.
If a $HOME/.bash_aliases
-file already exists, the install-script will take care, that your current custom aliases
are prependet to those suggestet by this package. Your previous .bash_aliases
is then replaced by the sym-link.
This was created by the need of having a shortcut for this task in the meantime. Consider to use docker for instance.
If you choose to install this, a sym-link at /usr/local/bin/changePHP
will be created,
pointing to the copied changePHP.sh
within the root of this package.
This was originally grabbed from https://github.com/RoverWire/virtualhost and adapted to the needs in WSL.
If you choose to install this, a sym-link at /usr/local/bin/vhost
will be created,
pointing to the copied vhost.sh
within the root of this package.
vhost
will create or remove:
- vhost directory
- document-root directory (if specified) with phpinfo-file
- apache2 vhost configuration
- reloading apache2 (add or remove vhost from apache2)
- open Windows hosts file in VS-Code for quick editing
This file holds basic configuration for the WSL-distribution and was created using documentation. Extend or change it by your needs.
If you choose to install this option, a sym-link at /etc/wsl.conf
will be created,
pointing to the copied wsl.conf
within the root of this package.
and can cause unexpected behavior on Win10.
If you encounter any network problems related to unresolvable names by DNS, check /etc/resolv.conf
.
You may add some nameservers in the form nameserver 1.1.1.1
each in an new line.
Use wsl --shutdown
in PowerShell to terminate WSL and restart it.
Check DNS-resolve by pinging an actual Domain ping heise.de
.
This file is used to hold any configuration for the tools within this package.
Change it by your needs, expecally to make the vhost-script working if you don't have a default WSL-installation (different Linux-Distro, etc.).
But don't worry, the fact that executables are called as sym-links is covered.
So for exaple if you have the default
/usr/local/bin/vhost
=> $HOME/wslIgnite/vhost.sh
, vhost
want's the wslIgnite.conf
at $HOME/wslIginte/wslIgnite.conf
.
This tool was createt to have a shortcut for editing the most importatnt things of a fresh installed php-version for local-development.
If you choose to install this, a sym-link at /usr/local/bin/configPHP
will be created,
pointing to the copied configPHP.sh
within the root of this package.
configurePHP
will set the folowing directives at apache2/php.ini & cli/php.ini:
memory_limit
: 1024M (not for cli-ini as it is-1
)post_max_size
: 2048Mupload_max_filesize
: 2048M
$ cp $HOME/wslIgnite/fuel/wslIgnite.conf.example $HOME/wslIgnite/wslIgnite.conf
$ nano $HOME/wslIgnite/wslIgnite.conf
$ cp $HOME/wslIgnite/fuel/.bash_aliases.example $HOME/wslIgnite/.bash_aliases
$ echo $HOME/wslIgnite/.bash_aliases >> $HOME/.bash_aliases
$ echo $HOME/.bash_aliases > $HOME/wslIgnite/.bash_aliases
$ rm $HOME/.bash_aliases
$ ln -sf $HOME/wslIgnite/.bash_aliases $HOME/.bash_aliases
$ nano $HOME/wslIgnite/.bash_aliases
$ source $HOME/.bashrc
$ cp $HOME/wslIgnite/fuel/tmux.conf.example $HOME/wslIgnite/tmux.conf
$ ln -sf $HOME/wslIgnite/tmux.conf $HOME/.tmux.conf
$ cp $HOME/wslIgnite/fuel/vimrc.example $HOME/wslIgnite/vimrc
$ mkdir -p $HOME/.vim $HOME/.vim/autoload $HOME/.vim/backup $HOME/.vim/colors $HOME/.vim/plugged
$ ln -sf $HOME/wslIgnite/vimrc $HOME/.vimrc
$ cd $HOME/.vim/colors
$ curl -o molokai.vim https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim
$ cp $HOME/wslIgnite/fuel/vhost.sh.example $HOME/wslIgnite/vhost.sh
$ sudo ln -sf $HOME/wslIgnite/vhost.sh /usr/local/bin/vhost
$ cp $HOME/wslIgnite/fuel/changePHP.sh.example $HOME/wslIgnite/changePHP.sh
$ sudo ln -sf $HOME/wslIgnite/changePHP.sh /usr/local/bin/changePHP
$ cp $HOME/wslIgnite/fuel/wsl.conf.example $HOME/wslIgnite/wsl.conf
$ sudo ln -sf $HOME/wslIgnite/wsl.conf /etc/wsl.conf
$ nano $HOME/wslIgnite/wsl.conf
$ cp $HOME/wslIgnite/fuel/configPHP.sh.example $HOME/wslIgnite/configPHP.sh
$ sudo ln -sf $HOME/wslIgnite/configPHP.sh /usr/local/bin/configPHP