revised 05-Sep-2023
Prerequisites: Basic Server (Ubuntu-20-04) with Webmin, FTP, Firewall and iRedmail
A fully-qualifed hostname. eg imega.example.com
Assumption with iRedMail: If the integrated approach expressed in this website is followed and a Wordpress application is desired, then iRedMail is to be installed prior to installing Wordpress - the reason being that the iRedMail will install the Nginx Webserver and MySQL/MariaSQL; their settings for iRedmail need to be preserved.
Establish a SSL Certificate: Such a certificate is now essential for establishing a website and should be done prior to installing Wordpress. See this link: SSL Certificate(s) for Websites
If not installed, do the following:
Note: Check version of PHP installed if one has opted to first install iRedmail. Check with the command: php -v
Preparation: Ensuring PHP-FPM works for local domain (eg.example.com) a critical requirement for WordPress
Step01:[Refer first to Basic Website-Part B on Nginx webserver] Remove the domain's (eg example.com) index.html and replace with the contents and filename of this index.php
Step02: Change, via Webmin ->[Nginx Webserver] the Nginx domain settings (eg. example.com)to test this PHP file. The settings should look similar with this (with your own domain, not example.com, and for reference see this text file: wordpress_nginx_example.txt
server { listen 80; server_name example.com www.example.com mail.example.com; return 301 https://example.com$request_uri; return 301 https://www.example.com$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name example.com www.example.com; root /var/www/wordpress; index index.php index.html index.htm; location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { expires max; log_not_found off; } location / { #try_files $uri $uri/ =404; try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass 127.0.0.1:9999; #fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; ... }
With Nginx restarted and if all is successful, the browser result is 'Hello world'.
Create a MySQL/MariaSQL user and database for Wordpress
Step03: With same the root MySQL/MariaSQL password used in setting up iRedmail (logon to the postmaster's mailbox (eg. postmaster@example.com) to retrieve such details), enter, via PuTTY, the following 4 commands (create in advance: at least a strong userpassword. One can also change the username [eg. wordpressuser] and database name [wordpressdb] other than those suggested below):
Step04: Install Wordpress application on the server.
Logon to the server via PuTTY (regular user eg. sammy), and enter these commands:
With the file:wp-config.php opened for editing, change these three top settings:
Remember to refresh the changes in Nginx.
Step05: Open browser to the domain and follow Wordpress instructions.
reference install-wordpress-ubuntu-20-04
Wordpress | Wordpress Backup |