{"id":23128296,"url":"https://github.com/thoth2357/enterprise-wordpress-automation","last_synced_at":"2026-05-05T18:32:50.440Z","repository":{"id":259982379,"uuid":"879735710","full_name":"thoth2357/enterprise-wordpress-automation","owner":"thoth2357","description":" Production-grade WordPress deployment automation powered by Ansible, featuring optimized Nginx configurations and PHP-FPM integration. Implements zero-touch installation with secure defaults, automated SSL/TLS via Certbot, and optional phpMyAdmin setup. ","archived":false,"fork":false,"pushed_at":"2024-10-28T22:24:31.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T18:50:28.496Z","etag":null,"topics":["ansible","automation","devops","infrastucture-as-code","mariadb","php-fpm","phpmyadmin","wordpress"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thoth2357.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-28T13:10:56.000Z","updated_at":"2024-11-20T02:05:34.000Z","dependencies_parsed_at":"2024-10-28T23:34:40.424Z","dependency_job_id":null,"html_url":"https://github.com/thoth2357/enterprise-wordpress-automation","commit_stats":null,"previous_names":["thoth2357/ansible-wordpress-nginx","thoth2357/enterprise-wordpress-automation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thoth2357/enterprise-wordpress-automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth2357%2Fenterprise-wordpress-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth2357%2Fenterprise-wordpress-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth2357%2Fenterprise-wordpress-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth2357%2Fenterprise-wordpress-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoth2357","download_url":"https://codeload.github.com/thoth2357/enterprise-wordpress-automation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoth2357%2Fenterprise-wordpress-automation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32662990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","automation","devops","infrastucture-as-code","mariadb","php-fpm","phpmyadmin","wordpress"],"created_at":"2024-12-17T09:24:11.894Z","updated_at":"2026-05-05T18:32:50.422Z","avatar_url":"https://github.com/thoth2357.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Deployment with Ansible\n\nThis repository contains Ansible playbooks for automated WordPress deployment with Nginx, PHP-FPM, and MariaDB.\n\n## Prerequisites\n\n### Target Server Requirements\n- Ubuntu/Debian-based system\n- SSH access with sudo privileges\n- MariaDB/MySQL installed and secured (see Manual Setup section)\n- Python3 and python3-pymysql installed\n\n### Local Machine Requirements\n- Ansible installed (2.9+)\n- SSH key configured for server access\n\n## Manual MariaDB Setup (Required)\n\nBefore running the playbook, set up MariaDB on the target server:\n\n```bash\n# Install MariaDB\nsudo apt update\nsudo apt install mariadb-server\n\n# Secure the installation\nsudo mysql_secure_installation\n```\n\nFollow the prompts to:\n- Set root password\n- Remove anonymous users\n- Disallow root login remotely\n- Remove test database\n- Reload privilege tables\n\nNote: Remember the root password set during this process as it will be needed in the playbook variables.\n\n\n## Directory Structure\n\n```\n.\n├── inventory.ini\n├── wordpress_install.yml\n├── templates/\n│   ├── wordpress.conf.j2\n│   ├── wp-config.php.j2\n│   └── phpadmin.conf.j2\n└── README.md\n```\n\n### Configuration Files\n#### 1. Inventory File\n```ini\n[wordpress_servers]\nstaging_server ansible_host=your_server_ip ansible_user=your_user ansible_ssh_private_key_file=path_to_key\n```\n#### 2. Variables\nEdit the variables section in wordpress_install.yml:\n\n```\nvars:\n    domain_name: your.domain.com\n    subdomain: your.subdomain.com\n    mariadb_root_password: \"your_mariadb_root_password\"\n    wp_db_name: your_database_name\n    wp_db_user: your_database_user\n    php_version: \"8.1\"\n    SSL_EMAIL: your.email@domain.com\n```\n\n## Features\n\n1. **Web Server Setup**\n   - Nginx installation and configuration\n   - PHP-FPM installation with necessary extensions\n   - Domain-specific configuration\n   - www to non-www redirection\n\n2. **WordPress Setup**\n   - Automated WordPress download and extraction\n   - Domain-specific directory structure\n   - Secure file permissions\n   - wp-config.php configuration with secure salts\n\n3. **Database Configuration**\n   - WordPress database creation\n   - Database user creation with appropriate privileges\n   - Secure password handling\n\n4. **SSL Configuration**\n   - Certbot installation\n   - Automatic SSL certificate acquisition\n   - HTTPS redirection\n\n## Usage\n\n1. Clone this repository:\n```bash\ngit clone \u003crepository-url\u003e\n```\n\n2. Update the inventory file with your server details:\n\n```1:2:inventory.ini\n[wordpress_servers]\nstaging_server ansible_host=your_server_ip ansible_user=your_user ansible_ssh_private_key_file=path_to_key\n```\n\n\n3. Update variables in wordpress_install.yml:\n\n```5:13:wordpress_install.yml\n  vars:\n    domain_name: prodwp.opscience.org\n    subdomain: phpadmin.agi.com.ng\n    mariadb_root_password: \"TRQNPta0IWM5BpDp\"\n    wp_db_name: OsiProdDB\n    wp_db_user: OsiTestUser\n    wp_db_password: \"{{ lookup('password', '/dev/null chars=ascii_letters,digits length=16') }}\"\n    php_version: \"8.1\"\n    SSL_EMAIL: email@example.com\n```\n\n\n4. Run the playbook:\n```bash\nexport OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES  # Required for macOS users\nansible-playbook -i inventory.ini wordpress_install.yml\n```\n\n## File Permissions\n\nThe playbook sets the following permissions:\n- WordPress directory: 755\n- WordPress files: 640\n- wp-config.php: 640\n- Owner/Group: www-data:www-data\n\n## Nginx Configuration\n\nThe Nginx configuration includes:\n- PHP-FPM integration\n- Static file caching\n- Security headers\n- www to non-www redirection\n- SSL configuration (when enabled)\n\nSee the template at:\n\n```1:46:wordpress.conf.j2\nserver {\n    listen 80;\n    server_name {{ domain_name }};\n    server_name {{ domain_name }};\n    root /var/www/{{ domain_name }};\n    index index.php index.html index.htm;\n\n    access_log /var/log/nginx/{{ domain_name }}.access.log;\n    error_log /var/log/nginx/{{ domain_name }}.error.log;\n\n    location / {\n        try_files $uri $uri/ /index.php?$args;\n    }\n    }\n    location ~ \\.php$ {\n        include snippets/fastcgi-php.conf;\n        fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock;\n    }\n        include fastcgi_params;\n    location ~ /\\.ht {\n        deny all;\n    }\n            deny all;\n    location = /favicon.ico {\n        log_not_found off;\n        access_log off;\n    }\n        access_log off;\n    location = /robots.txt {\n        allow all;\n        log_not_found off;\n        access_log off;\n    }\n        access_log off;\n    location ~* \\.(js|css|png|jpg|jpeg|gif|ico)$ {\n        expires max;\n        log_not_found off;\n    }\n}\n    }\nserver {\n    listen 80;\n    server_name www.{{ domain_name }};\n    return 301 http://{{ domain_name }}$request_uri;\n}\n\n```\n\n\n## Troubleshooting\n\n1. **MariaDB Connection Issues**\n   - Verify MariaDB is running: `systemctl status mariadb`\n   - Check root password is correct\n   - Ensure socket file exists: `/var/run/mysqld/mysqld.sock`\n\n2. **PHP-FPM Issues**\n   - Verify PHP-FPM is running: `systemctl status php8.1-fpm`\n   - Check socket file: `/var/run/php/php8.1-fpm.sock`\n   - Review logs: `/var/log/php8.1-fpm.log`\n\n3. **Nginx Issues**\n   - Check configuration: `nginx -t`\n   - Review logs: `/var/log/nginx/error.log`\n   - Verify permissions on web root\n\n## Security Considerations\n\n- Database passwords are handled securely\n- File permissions are set restrictively\n- SSL certificates are automatically configured\n- wp-config.php is protected\n- `.htaccess` files are blocked in Nginx\n\n## Maintenance\n\n- SSL certificates will auto-renew via Certbot\n- Keep PHP and Nginx updated via system updates\n- Regularly backup WordPress files and database\n- Monitor logs in `/var/log/nginx/` and `/var/log/php/`\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a new Pull Request\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth2357%2Fenterprise-wordpress-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoth2357%2Fenterprise-wordpress-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoth2357%2Fenterprise-wordpress-automation/lists"}