23

AlmaLinux 9 in WSL2 : install PHP, Apache, MariaDB, Composer, PhpMyadmin

 2 years ago
source link: https://www.dotkernel.com/php-development/almalinux-9-in-wsl2-install-php-apache-mariadb-composer-phpmyadmin/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Posted by Merlin on December 14, 2022 | No Comments

AlmaLinux 9 in WSL2 : install PHP, Apache, MariaDB, Composer, PhpMyadmin

In this article we will demonstrate how we install AlmaLinux 9 using WSL2.

First, you need to check if your machine is ready for using WSL2. Open Windows Terminal and execute the following command:

wsl -v

The output should look similar to this:

WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819

If instead of the above output, you get an error, it means that WSL is not (completely) installed on your machine. In this case, please follow the instructions found in this guide, then return to this page and continue with the next step.

Download and install AlmaLinux 9

Open Microsoft Store and search for AlmaLinux. From the results, select AlmaLinux 9 and install it. Once installed, clicking on Open will open it in Windows Terminal.

The installer will prompt you for your username, your password and password confirmation.

Setup AlmaLinux 9

While still in the AlmaLinux 9 terminal, start executing the following commands.

Install required packages:

sudo dnf install epel-release dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm -y

Update installed packages:

sudo dnf upgrade -y

Install Ansible:

sudo dnf install ansible -y

Clone our development environment setup package:

git clone https://github.com/dotkernel/development.git

Navigate to the directory with the Ansible recipes:

cd ~/development/wsl/

Using your preferred text editor, open config.yml where you must fill in the empty fields. Save and close the file.

Run Step 1 of the installer script (it will prompt you for the password you entered during the installation process):

ansible-playbook -i hosts install.yml --ask-become-pass

Restart AlmaLinux 9:

  • press Control + d
  • Open Windows Terminal
  • stop AlmaLinux 9 by executing wsl -t AlmaLinux9
  • start AlmaLinux 9 by executing wsl -d AlmaLinux9

Navigate back to the directory with the Ansible recipes:

cd ~/development/wsl/

Run Step 2 of the installer script (once again, it will prompt you for the password you entered during the installation process):

ansible-playbook -i hosts install.yml --ask-become-pass

Once finished, the installation is complete, your AlmaLinux 9 development environment is ready to use.

Test AlmaLinux 9

Check if everything works by opening in your browser:

  • http://localhost/ – Apache’s default home page
  • http://localhost/info.php – PHP info page
  • http://localhost/phpmyadmin/ – PhpMyAdmin (login with username root + the root password you configured in config.yml under mariadb -> root_password)

The complete guide with additional features is available here.

Leave a Reply Cancel Reply

Your email address will not be published. Required fields are marked *

Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Name *
Email *
Website

Save my name, email, and website in this browser for the next time I comment.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK