GSquad934.webserver
Ansible Role: Webserver (Nginx OR Apache)
This role installs and sets up a web server. Currently, it can manage either Nginx or Apache, and you can choose which one to install using a variable.
The following steps are performed:
- Install the latest version of Nginx or Apache
- Install the latest version of PHP-FPM
- Install the latest version of UFW (Uncomplicated Firewall)
- Remove the default website from the web server
- Copy secure website templates to /root/
- Open the HTTP and HTTPS ports in the firewall
- Prepare a basic structure for new users to manage websites
Requirements
There are no specific requirements for this role.
Role Variables
By default, this role installs and configures Nginx. However, you can change the variable to select Apache if you prefer.
The default variable is:
webserver: nginx
To install Apache instead of Nginx, change the value of this variable to apache.
Dependencies
This role does not require any other roles.
Example Playbook
Here’s a simple example of a playbook to use this role:
hosts: web_srv
user: root
roles:
- { role: webserver, tags: [ 'webserver' ] }
TODO
Some improvements and comments are still needed for the web servers. The list includes:
- Hide server information (global configuration)
- Configure certain modules (like mod_security or another web application firewall)
- Update this README to explain different actions (e.g., calculate HPKP)
License
MIT / BSD
Author Information
I'm Gaétan. You can follow me on Twitter
Website: ICT Pour Tous