By using the
*.localhostpattern for any new virtualhost, you do not need to modify thehostsfile in Windows, because these are routed by default.
Move inside the directory development/wsl:
cd ~/development/wsl/
If you don't already have a config.yml file, duplicate config.yml.dist as config.yml.
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.
Already existing virtualhosts will be skipped, their contents will not be lost, no need to comment or remove them.
Save and close the file.
Create the specified virtualhosts:
ansible-playbook -i hosts create-virtualhost.yml --ask-become-pass
This process will ask for your AlmaLinux 10 password, iterate over the list of configured virtualhosts and output a short summary with the results.
Your virtualhost should be accessible and ready to use.
You will install your project under the html directory of your project, for example /var/www/example.localhost/html.
The virtualhost's document root is set to the
publicdirectory of the above location, for example/var/www/example.localhost/html/public.If you want to have the DocumentRoot directly in
htmlfolder, you need to modify the file/etc/httpd/sites-available/example.localhost.
/var/www/./var/www/html/.