recently migrated wordpress to GCP, using cloud launcher – wordpress by bitnami. That pretty easy, google other tutorials and follow it. e.g.
- https://console.cloud.google.com/launcher/details/bitnami-launchpad/wordpress
- http://www.compoundtheory.com/migrating-my-blog-to-google-cloud-platform/
Set up
here is some highlighted procedures
1. create compute engine via clound launcher
2. create cloud SQL
– db username and password
3. mysqldump old wordpress database
4. load into cloud SQL
5. change wordpress setting.
$ cd apps/wordpress/htdocs/
6. turn off mysql in bitnami image
1 2 |
sudo /opt/bitnami/ctlscript.sh stop mysql sudo mv /opt/bitnami/mysql/scripts/ctl.sh /opt/bitnami/mysql/scripts/ctl.sh.disable |
7. turn off banner
1 |
sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1 |
8. setup static IP for compute engine instance & cloud SQL
in cloud SQL, allow CE’s IP
9. change DNS, point to GCP
Issues
outgoing email
a bit weird, quite trouble to setup mailjet https://cloud.google.com/compute/docs/tutorials/sending-mail/
https://cloud.google.com/compute/docs/tutorials/sending-mail/using-mailjet
followed the instructions, yet those postfix setup, from fields is <username>@<hostname>, which MailJet will send a verification email to, and apparently it won’t be verified.
https://app.mailjet.com/account/sender
additional steps to modified the email address, so it passes the verification.
https://www.cyberciti.biz/tips/howto-postfix-masquerade-change-email-mail-address.html
Then, setup wordpress plug-in
https://docs.bitnami.com/google/apps/wordpress/#how-to-configure-outbound-email-settings
php-fpm CPU loading
unknown reason on high CPU usage. To restart php-fpm, or the HTTP server.
1 2 |
sudo /opt/bitnami/ctlscript.sh restart php-fpm sudo /opt/bitnami/ctlscript.sh restart apache |