Welcome to Centmin Mod Community
Become a Member

Wordpress google cloud stoarge -fuse

Discussion in 'Blogs & CMS usage' started by ahmed, Jul 2, 2020.

  1. ahmed

    ahmed Active Member

    404
    49
    28
    Feb 21, 2017
    Ratings:
    +63
    Local Time:
    4:09 AM
    Hi

    I get this guide

    Google Storage and Wordpress. How to configure and store your uploads? | Robert Węglarek


    of course changed the command to match the variables such as centos and Wordpress dir

    but this step, I doubt it...I made everything but after reboot I was not able to ssh
    (restored a backup)

    Code (Text):
    # Go to the local Wordpress directory which contains uploads directory
    cd /var/www/html/wp-content/
    sudo chmod a+w uploads
    gcsfuse --dir-mode "777" -o allow_other gcp-blog uploads
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:09 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Probably best to test on a test VPS with test wordpress install so you can figure it out without messing up your live wordpress site.

    how did you install gcsfuse for centos ?

    list all the steps you did ? as that guide is for ubuntu/debian via apt install so not for centos and not for centmin mod
     
  3. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:09 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    FYI just be aware of Google Cloud Storage bandwidth costs outside of GCP network Cloud Storage pricing  |  Google Cloud which are between US$120-230/TB depending on egress destination. So if you have monthly 10TB of egress outgoing bandwidth outside GCP to your server to USA would be 10x120 = US$1,200 or to Australia would be 10x190 = US$1,900 for the month.
     
  4. ahmed

    ahmed Active Member

    404
    49
    28
    Feb 21, 2017
    Ratings:
    +63
    Local Time:
    4:09 AM
    Thanks for the tip, I will do that

    actually am using it as a bucket to CloudFront CDN instead of hosting files on the VPS
     
  5. ahmed

    ahmed Active Member

    404
    49
    28
    Feb 21, 2017
    Ratings:
    +63
    Local Time:
    4:09 AM
    Code (Text):
    [LIST=1]
    [*]Configure the gcsfuse repo:
    
    sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null <<EOF
    [gcsfuse]
    name=gcsfuse (packages.cloud.google.com)
    baseurl=https://packages.cloud.google.com/yum/repos/gcsfuse-el7-x86_64
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
          https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
    EOF
    
    
    [*]Make the system aware of the new repo:
    
    sudo yum update
    
    Be sure to answer "yes" to any questions about adding the GPG signing key.
    
    
    [*]Install gcsfuse:
    
    sudo yum install gcsfuse
    [/LIST]
    
     
  6. ahmed

    ahmed Active Member

    404
    49
    28
    Feb 21, 2017
    Ratings:
    +63
    Local Time:
    4:09 AM
    so for the last step in the guide

    Code:
    There’s 1 more thing to be done. If you restarted your instance the mount would be gone. This is because gcsfuse doesn’t mount automatically.
    
    Run  sudo nano /etc/fstab and put this in the end of the file:
    
    gcp-blog /var/www/html/wp-content/uploads gcsfuse rw,allow_other,dir_mode=777
    1
    gcp-blog /var/www/html/wp-content/uploads gcsfuse rw,allow_other,dir_mode=777
    “gcp-blog” as before, is your bucket name. This will basically do the same as we did before (runs “gcsfuse” command) but at the system startup.
    Shall I Do it on centmin using

    Beginners Guide to Automounting File Systems in CentOS / RHEL – The Geek Diary

    or

    CentOS / RHEL 7 : How to create custom script to run automatically during boot – The Geek Diary


    Best,
     
  7. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:09 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    /etc/fstab is the standard way in all linux OSes to auto mount a mount point that survives server reboots :)