Overview
In this project, I created an Ansible playbook from scratch to install and configure Wordpress on LEMP(Linux, Nginx, MySQL & PHP) stack.
Key Features
- CMS and blog: Executed with the help of Wordpress.
- Secure MySQL database: With the help of phpMyAdmin and mysql_secure_installation.
- Robust & secure web server: With the help of the Nginx web server and Certbot for SSL certficate allocation.
- User directory web hosting: Set up SELinux and Firewall to allow web hosting under user's home directory.
- Domain name: Mapped a domain name to the deployment by adding an "A record" at the DNS settings provided by the domain registrar.
Technologies Used
- Ansible: For automating the process (as an IaC).
- AWS: For creating an EC2 instance with an Elastic IP attached to it.
- Wordpress: As the Content Management System (CMS) and blog platform.
- MySQL: For the database.
- Nginx: As the web server.
- SFTP: For others (say, a developer) to access/edit the contents via the secure SFTP port.
- phpMyAdmin: As additional security and as a GUI for the MySQL database, accessible via domain_name/phpmyadmin endpoint.
- Certbot: For generating the SSL certificate to bypass HTTP traffic that is not secure, to HTTPS.
Challenges and Learnings
The biggest challenge with this project was the debugging process, which took forever. But one-by-one, the errors were rectified to ensure the smooth running of the Ansible playbook.
Outcome
A secure web hosting infrastructure, implementing a full LEMP stack with enhanced security features and Wordpress integration. Successfully configured six critical system components across web server, database, and content management layers using Ansible, as a control node.