Skip to content

Commit 91f7f49

Browse files
authored
Merge pull request #59 from dotkernel/issue-58
Issue #58: Implement one distro per branch structure
2 parents e0263e0 + 004b16f commit 91f7f49

File tree

43 files changed

+503
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+503
-700
lines changed

README.md

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,60 @@
1-
# Development environment
1+
# WSL2 development environment
22

3-
This is a collection of Ansible scripts allowing the creation and maintenance of your WSL2 development environment.
3+
This is a collection of Ansible scripts helping with the creation and maintenance of your WSL2 development environment.
44

5-
## Prerequisites
5+
If you're not already using it, we recommend you to install [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701?hl=en-US&gl=US).
6+
It is a modern tool that incorporates the power of multiple already known command-line applications like `Windows PowerShell`, `Linux shell`, and more...
67

7-
If you're not already using it, we recommend you to install [Windows Terminal](https://www.microsoft.com/en-US/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab).
8+
## Check if WLS2 is already available
89

9-
It's a modern tool that incorporates the power of multiple already known command-line applications like `Windows PowerShell`, `Linux shell`, and more...
10+
Open `Windows Terminal` and execute the following command:
1011

11-
## Setup
12+
```shell
13+
wsl -v
14+
```
1215

13-
Go to the [WSL2](wsl/README.md) setup page.
16+
The output should look similar to this:
17+
18+
```text
19+
WSL version: 2.2.4.0
20+
Kernel version: 5.15.153.1-2
21+
WSLg version: 1.0.61
22+
MSRDC version: 1.2.5326
23+
Direct3D version: 1.611.1-81528511
24+
DXCore version: 10.0.26091.1-240325-1447.ge-release
25+
Windows version: 10.0.22631.3737
26+
```
27+
28+
If the output starts with `WSL version: 2.x.x.x`, you are ready to use **WSL2** and can proceed to [install AlmaLinux9](wsl/README.md).
29+
30+
## Install WSL2
31+
32+
Before proceeding with the installation, please consult Microsoft's [documentation](https://learn.microsoft.com/en-us/windows/wsl/install#prerequisites) regarding the minimum requirements for running WSL2.
33+
34+
Once you identified that your machine can run WSL2, open the `Run` prompt by pressing `Win` + `r`, type `OptionalFeatures` in the dialog and press `Enter`.
35+
This will open a window where you can turn Windows features on/off.
36+
Make sure that the below features are activated (checked):
37+
38+
* `Hyper-V` (including its sub-features)
39+
* `Virtual Machine Platform`
40+
* `Windows Subsystem for Linux`
41+
42+
> If any of the above features are missing, then first you need to install them manually using [this guide](https://docs.microsoft.com/en-us/windows/wsl/install-manual) and then continue with the below steps.
43+
44+
Click `Ok` and restart your computer.
45+
46+
Open Microsoft Store, search for `Windows Subsystem for Linux` and install it.
47+
48+
Make sure that version **2** of WSL is set as default by executing the below command in Windows Terminal:
49+
50+
```shell
51+
wsl --set-default-version 2
52+
```
53+
54+
To test, run again the following command:
55+
56+
```shell
57+
wsl -v
58+
```
59+
60+
This time the output should display `WSL version: 2.x.x.x`, which means that your system is ready for using **WSL2** and you can proceed to [install AlmaLinux9](wsl/README.md).

docs/book/v1/faq.md renamed to docs/book/AlmaLinux9/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The aliases are the following:
1616
* `php81`: switch to PHP 8.1
1717
* `php82`: switch to PHP 8.2
1818
* `php83`: switch to PHP 8.3
19-
* `php83`: switch to PHP 8.4
19+
* `php84`: switch to PHP 8.4
2020

2121
After switching to a different PHP version, test with the following command:
2222

File renamed without changes.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Install AlmaLinux9
2+
3+
Open `Windows Terminal`.
4+
5+
List the available Linux distributions (aka: _distros_) by executing:
6+
7+
```shell
8+
wsl --list --online
9+
```
10+
11+
Depending on the list of distros available at the moment you run the command, the output should look similar to the below:
12+
13+
```text
14+
The following is a list of valid distributions that can be installed.
15+
Install using 'wsl.exe --install <Distro>'.
16+
17+
NAME FRIENDLY NAME
18+
AlmaLinux-8 AlmaLinux OS 8
19+
AlmaLinux-9 AlmaLinux OS 9
20+
AlmaLinux-Kitten-10 AlmaLinux OS Kitten 10
21+
AlmaLinux-10 AlmaLinux OS 10
22+
Debian Debian GNU/Linux
23+
FedoraLinux-42 Fedora Linux 42
24+
SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5
25+
SUSE-Linux-Enterprise-15-SP6 SUSE Linux Enterprise 15 SP6
26+
Ubuntu Ubuntu
27+
Ubuntu-24.04 Ubuntu 24.04 LTS
28+
archlinux Arch Linux
29+
kali-linux Kali Linux Rolling
30+
openSUSE-Tumbleweed openSUSE Tumbleweed
31+
openSUSE-Leap-15.6 openSUSE Leap 15.6
32+
Ubuntu-18.04 Ubuntu 18.04 LTS
33+
Ubuntu-20.04 Ubuntu 20.04 LTS
34+
Ubuntu-22.04 Ubuntu 22.04 LTS
35+
OracleLinux_7_9 Oracle Linux 7.9
36+
OracleLinux_8_7 Oracle Linux 8.7
37+
OracleLinux_9_1 Oracle Linux 9.1
38+
```
39+
40+
Note the two columns: **NAME** and **FRIENDLY NAME**.
41+
To install a specific distro, use the value from the **NAME** column, in this case: `AlmaLinux-9`.
42+
Install the AlmaLinux9 distro by executing the below command:
43+
44+
```shell
45+
wsl --install -d AlmaLinux-9
46+
```
47+
48+
You should see the download progress - once finished, the output should look like this:
49+
50+
```text
51+
Downloading: AlmaLinux OS 9
52+
Installing: AlmaLinux OS 9
53+
Distribution successfully installed. It can be launched via 'wsl.exe -d AlmaLinux-9'
54+
Launching AlmaLinux-9...
55+
Please create a default UNIX user account. The username does not need to match your Windows username.
56+
For more information visit: https://aka.ms/wslusers
57+
Enter new UNIX username:
58+
```
59+
60+
As per the last line, the installation process now prompts you to enter a username.
61+
This is the username you will use inside AlmaLinux9, and it can be any alphanumeric string (for example `dotkernel`):
62+
63+
Next, you are prompted to change the password associated with your chosen username (you will not see what you are typing, that's a security measure in Linux regarding passwords):
64+
65+
```shell
66+
Enter new UNIX username: dotkernel.
67+
Changing password for user dotkernel.
68+
New password:
69+
```
70+
71+
Depending on the strength of your password, you might get a `BAD PASSWORD: <some-reason>` message (if you want to choose a different password, hit `Enter` and you are taken back to previous step - else, continue with retyping your password):
72+
73+
Next, you are asked to retype your password:
74+
75+
```text
76+
Retype new password:
77+
```
78+
79+
Finally, you should see the following message:
80+
81+
```text
82+
passwd: all authentication tokens updated successfully.
83+
[<your-almalinux9-username>@<your-device-name> <your-windows-username>]$
84+
```
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Setup AlmaLinux9
2+
3+
Install system packages:
4+
5+
```shell
6+
sudo dnf install epel-release dnf-utils https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y
7+
```
8+
9+
You should see the below message, shown the first time you execute a command which requires elevated permissions (hence the `sudo` modifier at the beginning of the command).
10+
11+
```text
12+
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:
13+
14+
#1) Respect the privacy of others.
15+
#2) Think before you type.
16+
#3) With great power comes great responsibility.
17+
18+
[sudo] password for dotkernel:
19+
```
20+
21+
Input your AlmaLinux9 password and hit `Enter`.
22+
23+
Update/Upgrade system packages:
24+
25+
```shell
26+
sudo dnf upgrade -y
27+
```
28+
29+
Now, install the latest version of **Ansible**:
30+
31+
```shell
32+
sudo dnf install ansible -y
33+
```
34+
35+
Move inside your home directory (it is `/home/` followed by your AlmaLinux9 username, for example: `/home/dotkernel`):
36+
37+
```shell
38+
cd ~
39+
```
40+
41+
Clone the `almalinux9` branch of the `dotkernel/development` repository:
42+
43+
```shell
44+
git clone --branch almalinux9 --single-branch https://github.com/dotkernel/development.git
45+
```
46+
47+
Move inside the directory `development/wsl`:
48+
49+
```shell
50+
cd development/wsl/
51+
```
52+
53+
Duplicate `config.yml.dist` as `config.yml`:
54+
55+
```shell
56+
cp config.yml.dist config.yml
57+
```
58+
59+
Using your preferred text editor, open `config.yml` and fill in the empty fields.
60+
Save and close the file.
61+
62+
Install components by running the below Ansible command:
63+
64+
```shell
65+
ansible-playbook -i hosts install.yml --ask-become-pass
66+
```
67+
68+
The installation process will ask for your AlmaLinux9 password, then iterate over each task in the playbook and output a short summary with the results.
69+
70+
Once finished, check if everything works by opening in your browser:
71+
72+
* [http://localhost/](http://localhost/): Apache's default home page
73+
* [http://localhost/info.php](http://localhost/info.php): PHP info page
74+
* [http://localhost/phpmyadmin/](http://localhost/phpmyadmin/): PhpMyAdmin (login with `root` + the root password you configured in `config.yml` under `mariadb` -> `root_password`)
75+
76+
The installation is complete, your AlmaLinux9 development environment is ready to use.
77+
78+
> Restart your `Windows Terminal` to find a new option in the tab selector, called **AlmaLinux-9** - clicking it will open a new tab connected to **AlmaLinux9**.
79+
80+
## Running AlmaLinux9
81+
82+
Open `Windows Terminal`.
83+
84+
Start AlmaLinux9 by executing:
85+
86+
```shell
87+
wsl -d AlmaLinux9
88+
```
89+
90+
OR
91+
92+
Locate the app selector dropdown in `Windows Terminal`'s title bar and click `AlmaLinux-9`.
93+
This will open a new tab connected to AlmaLinux9.
94+
95+
### Note
96+
97+
> To run your applications using WSL2, you always need to be connected to your AlmaLinux9 distribution.
98+
> For this, all you need to do is to keep open an instance of Windows Terminal that is connected to it.

docs/book/v1/setup/system-requirements.md renamed to docs/book/AlmaLinux9/setup/system-requirements.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# System Requirements
1+
# System requirements
22

3-
First, you need to check if your system is ready for using **WSL2**. Open `Windows Terminal` and execute the following command:
3+
If you're not already using it, we recommend you to install [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701?hl=en-US&gl=US).
4+
It is a modern tool that incorporates the power of multiple already known command-line applications like `Windows PowerShell`, `Linux shell`, and more...
5+
6+
## Check if WLS2 is already available
7+
8+
Open `Windows Terminal` and execute the following command:
49

510
```shell
611
wsl -v
@@ -18,17 +23,15 @@ DXCore version: 10.0.26091.1-240325-1447.ge-release
1823
Windows version: 10.0.22631.3737
1924
```
2025

21-
If the output starts with `WSL version: 2.x`, you are ready to use **WSL2** and can continue with [the installation](installation.md).
26+
If the output starts with `WSL version: 2.x.x.x`, you are ready to use **WSL2** and can proceed to [install AlmaLinux9](installation.md).
2227

23-
Else, you need to install **WSL2** and its components as shown below.
28+
## Install WSL2
2429

25-
Before proceeding with the installation, please consult Microsoft's [documentation](https://learn.microsoft.com/en-us/windows/wsl/install#prerequisites) regarding the minimum requirements for running **WSL2**.
26-
27-
Once you know that your system can run **WSL2**, open the `Run` prompt by pressing `Win`+`r` and type in the dialog `OptionalFeatures`, then press `Enter`.
30+
Before proceeding with the installation, please consult Microsoft's [documentation](https://learn.microsoft.com/en-us/windows/wsl/install#prerequisites) regarding the minimum requirements for running WSL2.
2831

32+
Once you identified that your machine can run WSL2, open the `Run` prompt by pressing `Win` + `r`, type `OptionalFeatures` in the dialog and press `Enter`.
2933
This will open a window where you can turn Windows features on/off.
30-
31-
Make sure the next features are activated (checked):
34+
Make sure that the below features are activated (checked):
3235

3336
* `Hyper-V` (including its sub-features)
3437
* `Virtual Machine Platform`
@@ -40,7 +43,7 @@ Click `Ok` and restart your computer.
4043

4144
Open Microsoft Store, search for `Windows Subsystem for Linux` and install it.
4245

43-
Make sure **WSL2** is set as default by executing the below command in `Windows Terminal`:
46+
Make sure that version **2** of WSL is set as default by executing the below command in Windows Terminal:
4447

4548
```shell
4649
wsl --set-default-version 2
@@ -52,4 +55,4 @@ To test, run again the following command:
5255
wsl -v
5356
```
5457

55-
This time the output should display `WSL version: 2.x`, which means that your system is ready for using **WSL2** and you can continue with the [installation](installation.md).
58+
This time the output should display `WSL version: 2.x.x.x`, which means that your system is ready for using **WSL2** and you can proceed to [install AlmaLinux9](installation.md).

docs/book/v1/virtualhosts/create-virtualhost.md renamed to docs/book/AlmaLinux9/virtualhosts/create-virtualhost.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ You will install your project under the `html` directory of your project, for ex
3535
* To run your installed projects, you need to start AlmaLinux9 first.
3636
* If you work with virtualhosts, your projects are created under `/var/www/`.
3737
* You can still run PHP scripts under the default Apache project directory, located at `/var/www/html/`.
38-
* If you encounter write permission issues, see [this guide](../faq.md#how-do-i-fix-common-permission-issues).
39-
* This tool installs PHP 8.3 by default. If you need a different version, see [this guide](../faq.md#how-do-i-switch-to-a-different-version-of-php).
40-
* This tool installs Node.js 22 by default. If you need a different version, see [this guide](../faq.md#how-do-i-switch-to-a-different-version-of-nodejs).
38+
* If you encounter write permission issues, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-fix-common-permission-issues).
39+
* We install PHP 8.3 by default - if you need a different version, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-switch-to-a-different-version-of-php).
40+
* We install Node.js 22 by default - if you need a different version, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-switch-to-a-different-version-of-nodejs).
File renamed without changes.

docs/book/v1/setup/installation.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)