|
1 | | -# AlmaLinux 10 Installation |
| 1 | +# WSL 2 development environment |
2 | 2 |
|
3 | | -Before proceeding with the installation, we need to make sure that no other WSL2 distribution (aka: _distro_) is running. |
4 | | -This is important because this installation will fail if required ports are already in use by another distro. |
| 3 | +This folder contains the Ansible playbook that provisions a local Dotkernel development environment (Apache, PHP-FPM, MariaDB, phpMyAdmin, Composer, Node.js), runnable directly on Linux or inside WSL 2 on Windows. |
5 | 4 |
|
6 | | -Open `Windows Terminal`. |
7 | | - |
8 | | -## Stop other WSL2 distros |
9 | | - |
10 | | -List all installed distros: |
11 | | - |
12 | | -```shell |
13 | | -wsl -l -v |
14 | | -``` |
15 | | - |
16 | | -If there is no other distro installed, you will see the below output (an empty list): |
17 | | - |
18 | | -```text |
19 | | - NAME STATE VERSION |
20 | | -``` |
21 | | - |
22 | | -In this case, you can jump to the [installation](#install-almalinux-10) section. |
23 | | - |
24 | | -If you have other distros installed, the output could look similar to the below: |
25 | | - |
26 | | -```text |
27 | | - NAME STATE VERSION |
28 | | - AlmaLinux-8 Stopped 2 |
29 | | -* AlmaLinux-9 Running 2 |
30 | | -``` |
31 | | - |
32 | | -Make sure that the **STATE** column reads **Stopped** for all distros. |
33 | | -If any of them reads **Running**, you must stop if first by executing `wsl -t <distro-name>` after replacing `<distro-name>` with the name of the distro you want to stop. |
34 | | -Once you have stopped all distros, you can continue to the [installation](#install-almalinux-10) section. |
35 | | - |
36 | | -## Install AlmaLinux 10 |
37 | | - |
38 | | -List the available Linux distros by executing: |
39 | | - |
40 | | -```shell |
41 | | -wsl --list --online |
42 | | -``` |
43 | | - |
44 | | -Depending on the list of distros available at the moment you run the command, the output should look similar to the below: |
45 | | - |
46 | | -```text |
47 | | -The following is a list of valid distributions that can be installed. |
48 | | -Install using 'wsl.exe --install <Distro>'. |
49 | | -
|
50 | | -NAME FRIENDLY NAME |
51 | | -AlmaLinux-8 AlmaLinux OS 8 |
52 | | -AlmaLinux-9 AlmaLinux OS 9 |
53 | | -AlmaLinux-Kitten-10 AlmaLinux OS Kitten 10 |
54 | | -AlmaLinux-10 AlmaLinux OS 10 |
55 | | -Debian Debian GNU/Linux |
56 | | -FedoraLinux-42 Fedora Linux 42 |
57 | | -SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5 |
58 | | -SUSE-Linux-Enterprise-15-SP6 SUSE Linux Enterprise 15 SP6 |
59 | | -Ubuntu Ubuntu |
60 | | -Ubuntu-24.04 Ubuntu 24.04 LTS |
61 | | -archlinux Arch Linux |
62 | | -kali-linux Kali Linux Rolling |
63 | | -openSUSE-Tumbleweed openSUSE Tumbleweed |
64 | | -openSUSE-Leap-15.6 openSUSE Leap 15.6 |
65 | | -Ubuntu-18.04 Ubuntu 18.04 LTS |
66 | | -Ubuntu-20.04 Ubuntu 20.04 LTS |
67 | | -Ubuntu-22.04 Ubuntu 22.04 LTS |
68 | | -OracleLinux_7_9 Oracle Linux 7.9 |
69 | | -OracleLinux_8_7 Oracle Linux 8.7 |
70 | | -OracleLinux_9_1 Oracle Linux 9.1 |
71 | | -``` |
72 | | - |
73 | | -Note the two columns: **NAME** and **FRIENDLY NAME**. |
74 | | -To install a specific distro, use the value from the **NAME** column, in this case: `AlmaLinux-10`. |
75 | | - |
76 | | -> If you try to install a distro that is already installed, the installation process will fail: |
77 | | -
|
78 | | -```text |
79 | | -Downloading: AlmaLinux OS 10 |
80 | | -Installing: AlmaLinux OS 10 |
81 | | -A distribution with the supplied name already exists. Use --name to choose a different name. |
82 | | -Error code: Wsl/InstallDistro/Service/RegisterDistro/ERROR_ALREADY_EXISTS |
83 | | -``` |
84 | | - |
85 | | -Install the **AlmaLinux 10** distro by executing the below command: |
86 | | - |
87 | | -```shell |
88 | | -wsl --install -d AlmaLinux-10 |
89 | | -``` |
90 | | - |
91 | | -You should see the download progress—once finished, the output should look like this: |
92 | | - |
93 | | -```text |
94 | | -Downloading: AlmaLinux OS 10 |
95 | | -Installing: AlmaLinux OS 10 |
96 | | -Distribution successfully installed. It can be launched via 'wsl.exe -d AlmaLinux-10' |
97 | | -Launching AlmaLinux-10... |
98 | | -Please create a default UNIX user account. The username does not need to match your Windows username. |
99 | | -For more information visit: https://aka.ms/wslusers |
100 | | -Enter new UNIX username: |
101 | | -``` |
102 | | - |
103 | | -As per the last line, the installation process now prompts you to enter a username. |
104 | | -This is the username you will use inside **AlmaLinux 10**, and it can be any alphanumeric string (for example `dotkernel`): |
105 | | - |
106 | | -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): |
107 | | - |
108 | | -```shell |
109 | | -Enter new UNIX username: dotkernel. |
110 | | -New password: |
111 | | -``` |
112 | | - |
113 | | -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 the previous step—else, continue with retyping your password): |
114 | | - |
115 | | -Next, you are asked to retype your password: |
116 | | - |
117 | | -```text |
118 | | -Retype new password: |
119 | | -``` |
120 | | - |
121 | | -Finally, you should see the following message: |
122 | | - |
123 | | -```text |
124 | | -passwd: all authentication tokens updated successfully. |
125 | | -[<your-alma-linux-10-username>@<your-device-name> <your-windows-username>]$ |
126 | | -``` |
127 | | - |
128 | | -## Setup AlmaLinux 10 |
129 | | - |
130 | | -Install system packages: |
131 | | - |
132 | | -```shell |
133 | | -sudo dnf install epel-release dnf-utils https://rpms.remirepo.net/enterprise/remi-release-10.rpm -y |
134 | | -``` |
135 | | - |
136 | | -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). |
137 | | - |
138 | | -```text |
139 | | -We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: |
140 | | -
|
141 | | - #1) Respect the privacy of others. |
142 | | - #2) Think before you type. |
143 | | - #3) With great power comes great responsibility. |
144 | | -
|
145 | | -For security reasons, the password you type will not be visible. |
146 | | -
|
147 | | -[sudo] password for dotkernel: |
148 | | -``` |
149 | | - |
150 | | -Input your **AlmaLinux 10** password and hit `Enter`. |
151 | | - |
152 | | -Update/Upgrade system packages: |
153 | | - |
154 | | -```shell |
155 | | -sudo dnf upgrade -y |
156 | | -``` |
157 | | - |
158 | | -Now, install the latest version of **Ansible Core** and run **ansible-galaxy** to install collections: |
159 | | - |
160 | | -```shell |
161 | | -sudo dnf install ansible-core -y |
162 | | -``` |
163 | | - |
164 | | -```shell |
165 | | -ansible-galaxy collection install community.general community.mysql |
166 | | -``` |
167 | | - |
168 | | -Move inside your home directory (it is `/home/` followed by your **AlmaLinux 10** username, for example: `/home/dotkernel`): |
169 | | - |
170 | | -```shell |
171 | | -cd ~ |
172 | | -``` |
173 | | - |
174 | | -Clone the `alma-linux-10` branch of the `dotkernel/development` repository: |
175 | | - |
176 | | -```shell |
177 | | -git clone --branch alma-linux-10 --single-branch https://github.com/dotkernel/development.git |
178 | | -``` |
179 | | - |
180 | | -Move inside the directory `development/wsl`: |
181 | | - |
182 | | -```shell |
183 | | -cd development/wsl/ |
184 | | -``` |
185 | | - |
186 | | -Duplicate `config.yml.dist` as `config.yml`: |
187 | | - |
188 | | -```shell |
189 | | -cp config.yml.dist config.yml |
190 | | -``` |
191 | | - |
192 | | -Using your preferred text editor, open `config.yml` and fill in the empty fields. |
193 | | -Save and close the file. |
194 | | - |
195 | | -Install components by running the below Ansible command: |
196 | | - |
197 | | -```shell |
198 | | -ansible-playbook -i hosts install.yml --ask-become-pass |
199 | | -``` |
200 | | - |
201 | | -The installation process will ask for your **AlmaLinux 10** password, then iterate over each task in the playbook and output a short summary with the results. |
202 | | - |
203 | | -Once finished, check if everything works by opening in your browser: |
204 | | - |
205 | | -* [http://localhost/](http://localhost/): Apache's default home page |
206 | | -* [http://localhost/info.php](http://localhost/info.php): PHP info page |
207 | | -* [http://localhost/phpmyadmin/](http://localhost/phpmyadmin/): PhpMyAdmin (login with `root` + the root password you configured in `config.yml` under `mariadb` -> `root_password`) |
208 | | - |
209 | | -The installation is complete, your **AlmaLinux 10** development environment is ready to use. |
210 | | - |
211 | | -> Restart your `Windows Terminal` to find a new option in the tab selector, called **AlmaLinux-10**; clicking it will open a new tab connected to **AlmaLinux 10**. |
212 | | -
|
213 | | -## Create virtualhosts |
214 | | - |
215 | | -> By using the `*.localhost` pattern for any new virtualhost, you do not need to modify the `hosts` file in Windows, because these are routed by default. |
216 | | -
|
217 | | -Move inside the directory `development/wsl`: |
218 | | - |
219 | | -```shell |
220 | | -cd ~/development/wsl/ |
221 | | -``` |
222 | | - |
223 | | -If you don't already have a `config.yml` file, duplicate `config.yml.dist` as `config.yml`. |
224 | | - |
225 | | -Using your preferred text editor, open `config.yml` and, under the `virtualhosts` key, enter the virtualhosts that you want to create, each on its own line. |
226 | | -Already existing virtualhosts will be skipped, their contents will not be lost, no need to comment or remove them. |
227 | | -Save and close the file. |
228 | | - |
229 | | -Create the specified virtualhosts: |
230 | | - |
231 | | -```shell |
232 | | -ansible-playbook -i hosts create-virtualhost.yml --ask-become-pass |
233 | | -``` |
234 | | - |
235 | | -This process will ask for your **AlmaLinux 10** password, iterate over the list of configured `virtualhosts` and output a short summary with the results. |
236 | | -Your virtualhost should be accessible and ready to use. |
237 | | - |
238 | | -You will install your project under the `html` directory of your project, for example `/var/www/example.localhost/html`. |
239 | | - |
240 | | -> The virtualhost's document root is set to the `public` directory of the above location, for example `/var/www/example.localhost/html/public`. |
241 | | -
|
242 | | -> If you want to have the DocumentRoot directly in `html` folder, you need to modify the file `/etc/httpd/sites-available/example.localhost`. |
243 | | -
|
244 | | -### Good to know |
245 | | - |
246 | | -* To run your installed projects, you need to start **AlmaLinux 10** first. |
247 | | -* If you work with virtualhosts, your projects are created under `/var/www/`. |
248 | | -* You can still run PHP scripts under the default Apache project directory, located at `/var/www/html/`. |
249 | | -* If you encounter write permission issues, see [this guide](https://docs.dotkernel.org/development/v2/faq/#how-do-i-fix-common-permission-issues). |
250 | | -* We install PHP 8.5 by default—if you need a different version, see [this guide](https://docs.dotkernel.org/development/v2/faq/#how-do-i-switch-to-a-different-version-of-php). |
251 | | -* We install Node.js 22 by default—if you need a different version, see [this guide](https://docs.dotkernel.org/development/v2/faq/#how-do-i-switch-to-a-different-version-of-nodejs). |
| 5 | +Full, up-to-date installation instructions: <https://docs.dotkernel.org/development/v2/setup/installation/> |
0 commit comments