# WordPress on Ubuntu 24.04 [![OS](https://img.shields.io/badge/ubuntu-24.04-E95420)](#) [![Shell](https://img.shields.io/badge/shell-bash-121011)](#) [![WebServer](https://img.shields.io/badge/server-nginx-009639)](#) [![PHP](https://img.shields.io/badge/php-fpm-777BB4)](#) [![MariaDB](https://img.shields.io/badge/db-mariadb-003545)](#) [![MySQL](https://img.shields.io/badge/db-mysql-4479A1)](#) [![App](https://img.shields.io/badge/app-wordpress-21759B)](#) [![License](https://img.shields.io/badge/License-MIT-green)](./LICENSE) Automated installer for the **latest stable WordPress on Ubuntu 24.04**, configured for Nginx, PHP-FPM, and MariaDB/MySQL. This is not a 5-minute “demo stack”. This script deploys a **production-ready WordPress site**, database included, configs hardened, and Nginx validation enforced. Install → Configure → Visit `/wp-admin/install.php` → Done. --- ## Prerequisites This script expects: ✔ Nginx installed ✔ PHP-FPM installed ✔ MariaDB/MySQL running *(socket or password mode supported)* ### Optional Installers (if you need them — saves you some googling) - [Install Nginx + PHP-FPM on Ubuntu](https://git.x-files.dk/webserver/nginx-ubuntu) - [Install MariaDB on Ubuntu](https://git.x-files.dk/database/mariadb-ubuntu) - [Install MySQL on Ubuntu](https://git.x-files.dk/database/mysql-ubuntu) --- ## 1. Download ``` git clone https://git.x-files.dk/webapps/wordpress-ubuntu.git ``` ``` cd wordpress-ubuntu ``` --- ## 2. Install WordPress ``` sudo ./wordpressinstall -n -d -u -p [options] ``` ### Examples Socket authentication detected → simple command: ``` sudo ./wordpressinstall -n wp.example.com -d wpdb -u wpuser -p wpPass123 ``` Socket unavailable → add database credentials manually: ``` sudo ./wordpressinstall -n wp.example.com -d wpdb -u wpuser -p wpPass123 -m rootpwd sudo ./wordpressinstall -n wp.example.com -d wpdb -u wpuser -p wpPass123 -a admin -m adminpwd ``` --- ### Options | Flag | Meaning | |---|---| | `-m ` | MariaDB/MySQL admin or root password *(only if socket OFF)* | | `-a ` | DB admin username (defaults to `root`) | | `-h` / `--help` | Show help | --- ## What this installer does ✔ Downloads + configures latest WordPress ✔ Creates DB + DB-user if they don’t exist ✔ Generates Nginx host file automatically ✔ Detects socket vs password auth ✔ Validates Nginx (`nginx -t`) before reload ✔ Supports safe re-runs ✔ Built for production, not testing --- ## After installation Visit: ``` http:///wp-admin/install.php ``` Complete the setup wizard — database already wired. --- ## File & Config Layout | Path | Purpose | |---|---| | `/var/www/html/` | WordPress directory | | `/etc/nginx/conf.d/.conf` | Virtualhost config | | `/etc/nginx/conf.d/includes/wp-hardening.conf` | Security | | `/etc/nginx/conf.d/wp-rate-limit.conf` | Rate limit | --- ## HTTPS Support (443) Enable TLS using: https://git.x-files.dk/webserver/nginx-snippets/src/branch/main/hostfiles/wordpress.443.conf Caching snippets (disabled until uncommented): ``` # include /etc/nginx/nginx-snippets/cache-open-files.conf; # include /etc/nginx/nginx-snippets/cache-statics.conf; # include /etc/nginx/nginx-snippets/cache-js-css.conf; ``` --- ## Troubleshooting | Issue | Cause | Fix | |---|---|---| | Nginx restart fails | Config error | `nginx -t` | | DB denied | No socket auth | Use `-m` | | PHP errors | Wrong FPM version | Check `php8.3-fpm` | --- ### More Information More guides and documentation can be found on [wiki.x-files.dk](https://wiki.x-files.dk) --- ### License Licensed under the [MIT License](./LICENSE). ---