Best Performance WordPress with Google Cloud Load Balancing, CDN and Cloud SQL

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Hi, thank you for watching this video
    In this video we'll show you how to create Best Performance WordPress with Google Cloud Load Balancing, CDN and Cloud SQL
    Stacks used:
    WordOps
    WordPress
    Google Cloud Platform
    - VPC Network
    - Compute Engine
    - Cloud SQL
    - Cloud Load Balancing
    - Cloud CDN
    - Cloud Storage
    Chapters
    0:08 Creating VPC Network with a subnet
    2:00 Creating Firewall rules for temporary access to SSH & HTTP
    3:12 Creating Cloud SQL instance (MySQL 8.0) for WordPress Database
    6:20 Creating VM instance for WordPress
    8:04 Installing WordOps
    11:32 Creating website stack (Nginx, PHP, MySQL) with WordOps
    14:00 Installing WordPress
    16:55 Creating database and user in Cloud SQL for WordPress
    19:17 Setup WordPress website
    20:24 Install and setup Nginx Helper plugin
    20:51 Install and setup WP Offload Media Lite plugin
    24:52 Update wp-config.php for WordPress behind Reverse Proxy
    26:35 Creating WordPress image
    28:18 Creating firewall rule for Load Balancing health check
    29:44 Creating WordPress Instance template
    31:04 Creating WordPress Managed Instance Group
    32:50 Creating WordPress Load Balancing
    38:05 Updating WordPress Managed Instance Group Autohealing
    42:50 WordPress Load Balancing autoscale testing
    Command used & Reference for this video:
    github.com/abd...
    #wordpress #loadbalancing #gcp #cloud

Komentáře • 27

  • @whothiswhothis
    @whothiswhothis Před 7 měsíci +1

    Thank you. It was very helpful. There's no other video like this out there.

  • @mpgcamo
    @mpgcamo Před 11 měsíci +1

    Great Video, We had a team workshop to bed down a process for our needs and your video made sure we covered all bases. Thanks again. - The only thing to remember for people who are watching is do some clean up at the end of the setup to:
    1. Remove the the HTTP (80) firewall rules from the project.
    2. Remove any configured external IPs from your VMs and Instance Groups (set to None). (Obviously leave it on your load balancer otherwise you won't get to your website).
    3. Ensure your Cloud SQL database connections are set to 'Allow Secure SSL Connection Only' after setup is complete. This will stop Google's Security Command Centre from reporting a number of vulnerabilities.

    • @gcpdaemon
      @gcpdaemon  Před 10 měsíci

      The easiest way is to create a temporary project and deploy it on that project, after that you can just delete the project, all resources inside that project will be deleted automatically

    • @mpgcamo
      @mpgcamo Před 10 měsíci

      @@gcpdaemon Sorry I meant clean up after but still use the site (ie if you are going to productionise). IPs on instances are not required when it is sitting behind a load balancer and HTTP access open in a firewall not screwed down to LBHC ranges etc. will always flag as a High Risk in your Google Security Command Centre. So just cleanup in respect to them not showing up in your compliance or security reporting.

    • @gcpdaemon
      @gcpdaemon  Před 10 měsíci

      Ah I see,
      All the backend VMs should only have internal IP, firewall rules for port 80 should only be exposed to LB health check IP ranges.
      Thanks for your suggestions

  • @RakistaRadio
    @RakistaRadio Před 5 měsíci +1

    on the instance group creation, port mapping. should i also add the https port 443?

    • @gcpdaemon
      @gcpdaemon  Před 5 měsíci +2

      It's not necessary, as Load Balancer will handle the HTTPS requests and redirected to port 80 http to the instance group
      So USERS == HTTPS ==> Load Balancer == HTTP ==> Instance Group

    • @RakistaRadio
      @RakistaRadio Před 5 měsíci

      @@gcpdaemonGot it! Thanks!

  • @jiangshuzhe
    @jiangshuzhe Před 9 měsíci +1

    Bonne vidéo!

  • @whothiswhothis
    @whothiswhothis Před 7 měsíci +1

    Is there a chance you may know how I can get the WordPress Multisite to work with this setup? I activated the multisite, but the subdomains are not working.

  • @RakistaRadio
    @RakistaRadio Před 5 měsíci

    Hi mate, thank you for this great tutorial. Subscribed!
    I got stuck at 19:20 where it shows the ngnix page not the wordpress. I've updated the IP at cloudflaire. Any ideas? Thank you in advance.

    • @gcpdaemon
      @gcpdaemon  Před 5 měsíci +1

      Did you update the cloudflare A record with Loadbalancer IP?
      Also if you visit the Loadbalancer IP directly does it still show nginx page?

    • @RakistaRadio
      @RakistaRadio Před 5 měsíci

      @@gcpdaemon i got it working by installing an origin certificate from cloudflare and use that certificate in the load balancer.
      Thank you!

  • @RakistaRadio
    @RakistaRadio Před 5 měsíci

    I got one more question. Installing plugins or themes or updating wordpress where does the new files saved? is it in the load balancers's instance groups or on the cdn? i noticed that the instance groups you created are stateless not stateful? so whenever there are new updates on wordpress and new installed plugins or themes the files will be deleted because it is stored on a stateless instance? wordpress auto updates most of it's features like plugins/themes.
    Please advise. Thanks!

    • @gcpdaemon
      @gcpdaemon  Před 5 měsíci

      You have to do it on your instance template and after that update the instance group with this updated instance template.
      This is one of the downsides of using the instance group.
      or if you want to make the WordPress update worked without updating the instance template, you have to create a NFS, put all the WordPress files in it and mount it to the instance template, so all the instance in the instance group will have this NFS mounted and all the files changes inside this NFS will reflect to all the instances and will not destroyed if the instances is being increased of decreased.

    • @RakistaRadio
      @RakistaRadio Před 5 měsíci

      ​​​@@gcpdaemon how can this be done? Do i need to create instance template regularly whenever there is an update? Instance image and instance template is the same?
      Nfs is too expemsive

    • @RakistaRadio
      @RakistaRadio Před 5 měsíci

      @@gcpdaemon can you possibly create a step-by-step list on how to update instance template when there is an update in wordpress or add plugin or themes? creating an image from the instance requires stoping the instance and stoping the instance will reset the instance without the new update / plugins.

  • @gabrielo6319
    @gabrielo6319 Před měsícem

    The instance that was created to generate the image and the group, after deleting? Or keep them both running?

    • @gcpdaemon
      @gcpdaemon  Před měsícem

      Usually I just stop the instance and use it for updating the WordPress and then use it to update the instance group.
      stopped instance only billed for Disk, make sure your not using static external/internal IP address for this instance as it's billed more expensive if the instance is stopped.

  • @weimartube
    @weimartube Před 11 měsíci +1

    Hello, thank you very much!!! I have been working for days to improve my wp, I have a question, what happens if I add more plugins, when I update the group of instances, are they deleted?... is it necessary that these plugins are installed in a bucket and this is presented as a disk? or is it better to add a filestore disk?
    If my GCP template does not have a plugin I see that it disappears when I delete the cluster machines. O...what about plungin updates?

    • @gcpdaemon
      @gcpdaemon  Před 10 měsíci +1

      In the scenario that I use in the video, all the changes to wordpress core, themes, plugins need to be rebuild into instance template or image and the update the instance group using those instance template or image
      You can also use filestore and mount to /var/www/html or whatever your WordPress directory is, so any changes to WordPress core, themes, plugins will persist on instances group updates.
      But you have to do that on the instance template as instance group adding new instance based on instance template

  • @ripesla
    @ripesla Před rokem +1

    Hello thanks for your explanation! at 19:18 minute of the video the wordpress setup doesnt appear. Can you help me what i did wrong.Regards Rick

    • @gcpdaemon
      @gcpdaemon  Před rokem +1

      Hi Ric,
      Have you open firewall rules to allow port 80?
      and please make sure you have pointing A record for your domain with the external IP of Compute Engine where the Wordpress is installed
      You can also try visiting the Wordpress installation path manually
      YOUR-DOMAIN/wp-admin/install.php

  • @fernandodaniel9099
    @fernandodaniel9099 Před rokem +1

    Hey nice tutorial. I got the following error at 19:18.
    'Error establishing a database connection'
    I am sure I followed as you explained. Any suggestions?

    • @fernandodaniel9099
      @fernandodaniel9099 Před rokem +1

      I started the process once again and it looks I messed up somthing related to the Database Instance in the previous installation. All is working as expected now.

  • @sonofbuddhaTR
    @sonofbuddhaTR Před 7 měsíci

    After doing all these, are you allowed to install new plugins?

    • @gcpdaemon
      @gcpdaemon  Před 6 měsíci +1

      If you want to install new plugins/themes, you have to do it with instance template and the update the instance group template with this new template