wordpress-in-the-cloud

Customizing Your WordPress server

This guide is provided to help you quickly get started with hosting WordPress Website on AWS or Azure Cloud.

Our Marketplace WordPress images are equipped with the most recent versions of essential components including WordPress, MariaDB, PHP, and PHPMyAdmin.

Key Product Features:

  • WordPress: The core content management system, providing a robust platform for your website.
  • PHP: A versatile scripting language that powers the backend of your WordPress site.
  • MariaDB: A reliable database management system, ensuring efficient data handling.
  • PHPMyAdmin: A user-friendly tool for managing your MariaDB databases.
  • SFTP Server: Facilitates secure file uploads and downloads to and from your server.

If you haven’t already, our images can be accessed on your favourite cloud using the links below.

In the following sections of this document, we will guide you through personalizing this image, helping you to fully leverage its capabilities for the benefit of your business.

Accessing Your Instance with PuTTY

  1. Convert Your Private Key:
    • PuTTY does not natively support the private key format (.pem) generated by Amazon EC2. You must convert your .pem file to the PuTTY-specific format .ppk.
    • Download and open PuTTYgen (PuTTYgen download link).
    • Click Load and select your .pem file.
    • Once the key is loaded, click Save private key to save it as a .ppk file.
  2. Start PuTTY(PuTTY download link):
  3. Authenticate with Your Private Key:
    • In the Category pane, expand the Connection category, then expand SSH, and select Auth.
    • Click Browse and find the .ppk file you created in step 1.
    • Select the file and click Open.
  4. (Optional) Enter a Session Name:
    • Go back to the Session category.
    • Enter a name for this connection in the Saved Sessions field and click Save. This allows you to quickly load these settings in the future.
  5. Open the Connection:
    • Click Open to initiate the SSH connection.
    • When you connect for the first time, you will see a security alert about the server’s host key not being cached. Click Yes to continue.
  6. Login:
    • When prompted, log in as the user ec2-user (AWS), or the appropriate username you set for your instance in the case of Azure.
  7. You are now able to further customize your image should the need arize.

PHPMyAdmin and MariaDB credentials

If you need access details for PHPMyAdmin, MariaDB login to your instance using the SSH Key used during setup are stored on your instance at this location

/opt/wordpress/default-wordpress-credentials.txt

Upgrading Software

To ensure that platforms remain consistently updated, we recommend that users promptly apply available updates from respective vendors. In the following sections, we will guide you through detailed steps to upgrade the various software components included in this offering.

Note: Be sure to back up your system before attempting any software updates.

WordPress

WordPress provides an automatic in-place update system that users can use to download and apply patches on their own. This is the recommended way of upgrading WordPress. Using options available in the admin area of WordPress, users can update the system when updates are available with a one-click upgrade.

OS Updates

This image is based on Amazon Linux 2. Therefore, OS-specific updates can be applied using the systems package manager

yum upgrade

MariaDB

MariaDB updates can be applied using the yum package manager

yum upgrade mariadb

PHP

PHP updates can also be applied using the system package manager.

yum upgrade php

The system is by default shipped with PHP7.4, however, the user can switch to PHP8.0. Please make sure your system has been backed up before proceeding.

We start by removing the current PHP7.4 version.

yum remove php

And enable php8.0 repository using amazon linux repo manager

amazon-linux-extras disable php7.4
amazon-linux-extras enable php8.0
yum install php8.0

Backup and Restore

The system comes with a backup script that is scheduled to run with cron. This script is designed to safeguard your WordPress website by creating regular backups of both the website files and the associated database. This script automatically generates a compressed archive containing a complete copy of your WordPress directory (typically located at /var/www/html) and a dump of your WordPress database. These backups are essential for website recovery in case of data loss, corruption, or other unforeseen events that might disrupt your site’s operation.

The script is invoked by cron automatically, but if you wish to generate a backup of the entire site, you can execute:

/opt/wordpress/backup-script.sh

When the scipt runs, a tarball containing the html folder and database backup will be stored in the folder:

/opt/backups/wordpress-backup-*.tar.gz

In summary, this backup script is a straightforward and efficient way to ensure the safety of your WordPress website. Regular use of this script, ideally scheduled as a daily or weekly task, will provide peace of mind, knowing that your website’s data is securely backed up and can be restored if needed. It is important that you move the backup files off the server to a secure location. You can achieve this by use of SFTP.

Conclusion

In conclusion, this article has guided you through a range of customization techniques and best practices for enhancing your WordPress site.

Disclaimer:

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

Do you still need help?

Look, our Tech Support Staff live and breathe Cloud Engineering. Let them handle the details, so you can focus on the big picture.

Contact Support