This guide covers the layout and day-two configuration of the CloudSOE WordPress image on both AWS and Azure. It assumes you’ve finished one of the getting-started guides (AWS, Azure).

File locations

PathPurpose
/var/www/wordpressWordPress document root
/var/www/wordpress/wp-config.phpDatabase settings and salts (generated at first boot)
/opt/wordpress/default-wordpress-credentials.txtGenerated credentials (root-readable, mode 600)
/etc/apache2/sites-enabled/Apache virtual host for HTTP and HTTPS
/etc/ssl/certs/wordpress-selfsigned.crtPer-instance TLS certificate
/etc/ssl/private/wordpress-selfsigned.keyPer-instance TLS private key

Services

Apache and MariaDB are managed by systemd and enabled at boot:

sudo systemctl status apache2 mariadb
sudo systemctl restart apache2      # after config changes

The one-time setup service wordpress-firstboot only runs until it succeeds once; after that it exits immediately thanks to its marker file (/var/lib/wordpress-firstboot.done).

Database access

The site uses a local MariaDB database:

  • Database: wordpress
  • User: wordpress
  • Password: in wp-config.php and in the credentials file

Connect from the shell with sudo mysql wordpress, or use phpMyAdmin at https://<your-ip>/phpmyadmin with the wordpress database user. If you don’t need phpMyAdmin, remove it:

sudo apt remove --purge phpmyadmin

Replacing the self-signed certificate

The image generates a self-signed certificate at first boot so HTTPS works immediately, but browsers won’t trust it. Once your domain points at the instance, switch to Let’s Encrypt:

sudo apt install certbot python3-certbot-apache
sudo certbot --apache -d example.com -d www.example.com

Certbot rewrites the Apache vhost to use the trusted certificate and installs automatic renewal. Alternatively, install a purchased certificate by replacing the certificate and key paths in the HTTPS vhost under /etc/apache2/sites-enabled/, then sudo systemctl reload apache2 — always update both files together.

Pointing a domain at your site

  1. Create an A record for your domain pointing at the instance’s public IP (on AWS, allocate an Elastic IP first so the address survives stop/start; on Azure, set the public IP to Static).
  2. Update WordPress’s own URL in Settings → General, or from the shell:
sudo mysql wordpress -e "UPDATE wp_options SET option_value='https://example.com' WHERE option_name IN ('siteurl','home');"

Uploading files over SFTP

The admin user (ubuntu on AWS, your chosen username on Azure) has write access to the WordPress files. Any SFTP client works with your SSH key:

sftp ubuntu@<public-ip>
sftp> cd /var/www/wordpress/wp-content

Keep file ownership consistent after bulk uploads:

sudo chown -R www-data:www-data /var/www/wordpress/wp-content

PHP settings

PHP runs through libapache2-mod-php. To raise upload limits or memory, drop a file into the PHP conf.d directory (the exact PHP version directory varies with the base OS):

PHPDIR=$(php -i | sed -n 's/^Scan this dir for additional .ini files => //p')
sudo tee "$PHPDIR/99-wordpress.ini" <<'EOF'
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
EOF
sudo systemctl restart apache2

Next steps

  • Tips & tricks — backups, updates, performance and troubleshooting