ansible-wordpress-host-init/README.md
2023-04-07 19:11:46 +02:00

65 lines
1.7 KiB
Markdown

# Ansible-WordPress-Nginx-Docker
This Ansible project automates the setup and configuration of an Ubuntu machine to host a WordPress website using Nginx, PHP, Docker, MySQL, and Redis. The Nginx vhost configuration is hardened for improved security.
## Features
The Ansible playbook in this project will:
1. Update Ubuntu packages
2. Install Nginx
3. Configure Nginx with hardened vhost settings
4. Install PHP
5. Configure PHP
6. Install WordPress
7. Install Docker
8. Deploy MySQL and Redis containers
## Prerequisites
- Ansible (version 2.9+)
- Ubuntu 18.04+ target machine
- SSH access to the target machine
## Getting Started
Clone this repository to your local machine:
```bash
git clone https://github.com/your-username/ansible-wordpress-nginx-docker.git
cd ansible-wordpress-nginx-docker
```
Update the `inventory/target.ini` file with the correct information for your target Ubuntu machine:
```ini
[main]
your-server-ip ansible_ssh_user=your-username ansible_ssh_port=port ansible_ssh_private_key_file=path/to/your/private/key
```
Run the playbook:
```bash
ansible-playbook -i inventory/target.ini setup_server.yml
```
After the playbook has run successfully, you should have a fully functional WordPress website running on your Ubuntu machine with Nginx, PHP, MySQL, and Redis, with a hardened Nginx vhost configuration.
## Variables
The following variables can be customized in the `vars/external.yml` file:
```yaml
php_version: PHPversion
vhost_name: name of the vhost
domain: thedomain.com
mysql_mem_limit: 1024 //MB
mysql_mem_reserve: 512 //MB
mysql_root_pass: evenmoresecurepwd
mysql_db: projectname
mysql_user: projectname
mysql_user_pass: verysecurepwd
redis_pass: ultimatepassword
```
Make sure to replace the default values with your own.