1. Home
  2. Docs
  3. GCP Marketplace
  4. GCP WordPress LAMP Rocky 9 (PHP 8.3)

GCP WordPress LAMP Rocky 9 (PHP 8.3)

This VM is a LAMP Web Server with phpMyAdmin installed on Rokcy Linux 9.

This VM supports following versions.

  • PHP 8.3
  • Apache 2.4
  • MariaDB 10.5
  • phpMyAdmin 5.2
  • WordPress 6.8

Security considerations

  • Host firewall: Disabled. External access is restricted by Google Cloud firewall rules (http-server, https-server).
  • SELinux: Permissive to avoid blocking Apache/PHP modules.

Web Server

We prepared SSL/TLS so you can access to top page using http:// or https://.

DB Server Password

You can find the password from Compute Engine console Log.

  1. Go to the Compute Engine console -> VM instances
  1. Select your VM Instance -> Select Serial port 1 (console)

Serial port 1 (console) log

You can also SSH into your instance and find the login credential using the following command.

$ cat /home/rocky/credentials 
////////////////////credentials info////////////////////
--- WordPress
----- Setting  : Success
--- phpMyAdmin
----- Setting  : Success
--- MariaDB
----- User     : root
----- Password : ****************
----- User     : wordpress
----- Password : ****************
////////////////////////////////////////////////////////

phpMyAdmin

You can access to phpMyAdmin after creating ssh tunnel.

How to Set up SSH Tunneling (Port Forwarding)

ex.) create ssh tunnel

$ gcloud compute ssh --zone "us-west1-a" rocky@vm-instance-name --project "projectname" -- -N -L 8080:localhost:80

http://localhost:8080/phpMyAdmin/

For phpMyAdmin please refer to phpMyAdmin User Guide

Changing URL

You can change the WordPress URL by using wp-cli. You can change it by executing the following command after logging into the instance over SSH.

$ wp search-replace 'old_site_url' 'new_site_url' --path=/var/www/html/wordpress --skip-columns=guid

For example, when your instance IP was changed from xxx.xxx.xxx.xxx to yyy.yyy.yyy.yyy you can check URL as shown below: To update the URL, execute the following command:

$ wp search-replace xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy --path=/var/www/html/wordpress --skip-columns=guid
+------------------+-----------------------+--------------+------+
| Table            | Column                | Replacements | Type |
+------------------+-----------------------+--------------+------+
| wp_commentmeta   | meta_key              | 0            | SQL  |
| wp_commentmeta   | meta_value            | 0            | SQL  |
| wp_comments      | comment_author        | 0            | SQL  |
<...>
| wp_options       | option_value          | 2            | PHP  |
| wp_options       | autoload              | 0            | SQL  |
| wp_postmeta      | meta_key              | 0            | SQL  |
<...>
| wp_users         | user_url              | 1            | SQL  |
| wp_users         | user_activation_key   | 0            | SQL  |
| wp_users         | display_name          | 0            | SQL  |
+------------------+-----------------------+--------------+------+
Success: Made 8 replacements.

Reference

Tags , ,

How can we help?