This Ansible script allows you to automate the configuration of a LEMP web server or a LAMP web server on Debian 11 server.
These Ansible roles will automate the deployment for you:
- Install Nginx or Apache
- Install MariaDB (supported versions: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10)
- Install PHP (supported versions: 8.0, 8.1, 8.2)
- Install PhpMyAdmin
- Create your Nginx / Apache Virtual Hosts (one per domain)
- Create your MariaDB databases (one per domain)
- Preparing the skeleton of your websites
This Ansible Ansible Playbook was made by Stephen Damian
- Debian 11
- SSH root access
This example is configured for a Debian local server.
If you want to configure there for a Debian remote server, you need to configure the ansible/hosts
file.
adduser user_test
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install ansible
You need to configure your ansible/web-server.yml
file.
You must configure at least all the REQUIRED
lines.
Send the ansible
folder present in this package to the /etc
folder of your Debian server.
ansible-playbook -i /etc/ansible/hosts /etc/ansible/web-server.yml
You must change the path of PhpMyAdmin, or remove PhpMyAdmin from public access.
Don't forget to secure your server with iptables, fail2ban, etc.
You can Configure SSL for your websites (with Certbot for example).
To improve performance, you can add cache to your Nginx / Apache configuration.
To make your server able to send mails, you can use postfix.