Maintaining the function of all Google instances hosting WordPress sites

Home Frequently Asked Questions (FAQ) z- Internal IT Maintaining the function of all Google instances h....

Checking if google instances are running.

Open Cloud.google.com

Login with Username and Password listed in the Passwords Spreadsheet.

Once logged in, go to Console

You will see a drop down in the top bar next to Google Cloud Select the instance you need to check.

Once you have clicked on the one you want to check, go the left side bar, and click the Hamburger Menu at the top.

Go to Compute Engine

You will be presented with the list of the google Instances associated with the account.

If there is a Green Check to the left of the Instance, that means it is currently running.

The External IP is the address that the instance can be accessed at.

If there is something you need to do with the instance you can load up Putty to access it.

Or Click on the SSH button to the right.

If the site isn’t loading, you can check if the webserver is running, but copying the following command.

sudo /opt/bitnami/ctlscript.sh status

It should return the following if all is running normally.

If you need to restart the webserver because you have updated something run the following command:

sudo /opt/bitnami/ctlscript.sh restart

Once the command has completed refresh the browser window that you were accessing the site from.

To close this window type the following command:

exit

That will log out of the SSH window and close the connection.

If you are having issues saving new articles or media to WordPress.

The instance may be out of space.

Open an SSH window for the instance you are trying to check.

Type the following command:

df -h

The information returned will be the available space on the hard disks allocated for the instance.

The top entry /dev/sda1 is the main drive, since it is showing 67% use there is still plenty or room on it.

If you were at 100% use you would need to increase the allocated drive size.

Which is done in google instances as well.

  1. Shutdown the instance, drive changes require the instance to be powered down, make sure there isn’t anything important that isn’t saved before powering down the instance i.e. the article you were trying to save to the website.
  2. Left Click on the three vertical dots to the right of the SSH button. This brings up more actions, the one below Start/Resume is what we are looking for Stop, left click that.
  3. Once the status of the instance is showing a black circle with a white square it is powered down.                                                                                                     
  4. At this time go the left side menu of the screen and click on Disks, this will bring you to a window similar to instances but it is just the Disk image for the instance, click on the name of the instance drive.
  5. Next click on the Edit button in the top bar.
  6. The first box on the Edit window will be the Disk Size.
  7. The size is represented in GB or Gigabytes, you can replace it with a higher number that is appropriate for the expectations of needed size for the instance, i.e. usually 5 GB at a time.
  8. Once the size has been updated.
  9. Click Save at the bottom.
  10. At this point click back to the Instances window from the left side bar.
  11. Click on the three Vertical Dots to the right of the SSH Button and click Start / Resume.
  12. Wait for the instance to show a Green circle with a Check for the Status, and then click SSH to open the access terminal.
  13. Use the df -h and the lsblk commands to list the size of the file system and to find the device names for your disks.
  14. Verify the partition type: sudo parted -l
  15. If the drive is not showing the new size you will need to resize the partition for to realize the increased space.
  16. Type the command:
    sudo parted /dev/sda
  17. At the prompt type:
    resizepart
  18. At the Partition number? prompt type:
    1

     

  19. At the Warning: Partition /dev/sda1 is being used. Are you sure you want to continue? prompt type:
    Yes

     

  20. At the End? prompt, type:
    100%
  21. Read the new partition table using the command:
    sudo partprobe /dev/sda

     

  22. Extend the file system, using the command:
    sudo resize2fs /dev/sda1
    
    

     

  23. Lastly us the df -h command again to confirm the new disk size.