Category Archives: Server

Google G Suite Thumbnail

Google Workspace / G Suite Setup for Your Own Domain Email

My new client just called me with an urgent voice, “My email is down. Please fix this as soon as possible.”

My client requested me to build his website, so I set up his old domain name to my hosting server for the work environment, and his email stopped working. He never mentioned about the email that was under his old domain (i.e. client@domain.com). I was in panic for a few minutes, but gladly, I was able to find out that his email is linked to G-Suite (now called Google Workspace).

Here I will show you how to change DNS setting for an email or entire emails under your own unique domain (i.e. you@yourowndomain.com). This setup can be found under your domain provider setup tab, and it’s usually called “Advanced DNS” or “Manage DNS”. Sometimes this can be called “Zone Editor” on your hosting provider setup tab, and this can be modified if your domain is linked to a hosting service.

Clear / Remove MX Record on your DNS

First, you need to see the existence of any MX Record (Mail Exchange records). If you find a single MX Record that are exist on your DNS, remove it.

Zone Editor Screen Shot 1

I removed a MX Record “Priority:0 with “mail.MYDOMAIN.com” from my cPanel. Make sure that is no MX Record on you DNS.

Add Google Workspace / G-Suite MX Record to your DNS

Add below 5 MX Record provided by Google Workspace / G Suite.

Name TTL Type Priority Destination
Blank or @ Default Value MX 1 aspmx.l.google.com
Blank or @ Default Value MX 5 alt1.aspmx.l.google.com
Blank or @ Default Value MX 5 alt2.aspmx.l.google.com
Blank or @ Default Value MX 10 alt3.aspmx.l.google.com
Blank or @ Default Value MX 10 alt4.aspmx.l.google.com

Example

Zone Editor Screen Shot 2

As soon as the records on DNS are saved, all of your emails from your own domain will be transferred through Google Workspace / G Suite and landed on your Gmail inbox.

Deceptive Site

Malware/Virus: Fix and Remove “WP-VCD” from my WordPress

My Wordfence (a security plugin for WordPress) alarmed with the “Critical Problems” flag due to the result of the malware / virus scan from my website. I had a similar incident before, and it was a nightmare for me to fix and retrieve the suspended website back to normal.

The Malware Files

  • wp-content/themes/Divi/functions.php
  • wp-core.php
  • unzipper.php
  • wp-includes/wp-vcd.php
  • wp-includes/wp-tmp.php
  • wp-includes/wp-feed.php

The hacker used “wp-” for naming the files, so it’s hard to determine if these are core WordPress files.

However, I was able to know before Google suspend my website away with the red screen, “Deceptive Site ahead”.

This malware is called, “WP-VCD”. It could create random administrator users to control my settings, and in a worse case, my whole hosting server can be infected.

The Solution

The solution was simple. I was able to just trash/remove below files straight from the file manager on my hosting server (The root directory called, “public_html”).

  • wp-core.php
  • unzipper.php
  • wp-includes/wp-vcd.php
  • wp-includes/wp-tmp.php
  • wp-includes/wp-feed.php

However, the infected “functions.php” file was a bit tricky. The malware attack was placed on the existed theme file so can’t just remove it. You would have to edit the “functions.php” file to fix 100%. But, don’t panic. I will carefully show you what to edit from the file.

Use FTP program like Filezilla, or go to the Cpanel -> File Manager -> Root Directory – “wp-content” -> themes -> (your theme) -> functions.php. Open up the file, and remove the first set of PHP snippets code like below. In my case, remove the very first line of file to the line 184 until you see the ending PHP bracket ?>.

REMOVE THE BLUE HIGHLIGHTED CODE

One side note is always back up each files before you permanently terminate in case you have to go back, and do it as soon as possible before Google red flag on your precious webpage.

cPanel: Change / Increase Maximum Upload File Size

Don’t let any large sized file holding you back from uploading!

Here is my story. I was transferring my website from a server to a server. I was exporting one database and one large compressed website file for the “Duplicator” plugin in WordPress. The database file went-in pretty quickly through the File Upload tool, but my compressed file did not as it was over 600 MB in file size.

You can change the maximum size of an uploaded file in cPanel. Go to your cPanel, find the MultiPHP INI Editor from the menu. MultiPHP INI Editor Icon

You will face a bunch of lists on the table.
Upload file size limit table Scroll to find upload_max_filesize and change the value to your desired upload file size. I put mine as 512M. Ta-Da!

Cpanel and WHM

(Resolved) Fix PHP / MultiPHP Version Upgrade Error in WHM/Cpanel

Upgrading your PHP version might be a requirement, when upgrading your WordPress to the latest version or any related plugins. My firewall tool recommended me to upgrade my WordPress, which I did, and I saw this warning message (below) with the website being down. I was proceeding PHP upgrade from version 5.6 to 7.4 using the MultiPHP Manager in Cpanel.

Warning: Use of undefined constant WP_CONTENT_DIR – assumed ‘WP_CONTENT_DIR’ (this will throw an Error in a future version of PHP) in /home/XXXXX/public_html/wp-includes/load.php on line 115

Let me get to the point straight. The error was occurred by the auto-generated PHP handler (ver 7.4) from .htaccess that was conflicting with another PHP handler (ver 5.6) that was running simultaneously in the server.

My old PHP handler looks like this:

# Use PHP56 as default
AddHandler application/x-httpd-php56 .php
<IfModule mod_suphp.c>
    suPHP_ConfigPath /opt/php56/lib
</IfModule>

My new PHP handler looks like this:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

In my case, the upgrade from the MultiPHP Manager was generating the 7.4 PHP handler in the public_html folder, and my old PHP version 5.6 handler was already existed in the folder above public_html which is above the root directory. That was the reason it was causing the error. You can’t run multiple PHP handlers for a single website.

My solution was to simply remove (or rename if you don’t want to delete the file) the .htaccess file (PHP 5.6) from one level above the root directory. Now it works like a charm!

Use Dropbox as Website Server Hosting FTP

Looking for a free FTP server? Use Dropbox as your web hosting server for free. First, you have to download and install Dropbox to your computer. Save your file you wish to host for your website in the dropbox folder. Right click and hit “Share”.


Hit “Create Link” and then “Link Settings”. Change “Team Members” to “Anyone with Link” under “Who has access” field. Save your setting, “Copy Link”, and now you are ready to provide the image or other resource url to the website.

All given Dropbox links are ended with ?dl=0. Change it to ?raw=1, and it will be live and your Dropbox will be working as a FTP server.

Example

<img src="https://www.dropbox.com/s/gjgkjqlecf6ek9c/design-custom-j316.jpg?dl=0" /> 

Change above dropbox link as below.

<img src="https://www.dropbox.com/s/gjgkjqlecf6ek9c/design-custom-j316.jpg?raw=1" />
whm

Temporarily Disable / Make a Website Offline in WHM

Did you still not get paid yet? Are you going to end it up disabling your client’s website temporarily in WHM? Take one of your or multiple website down using a feature called “Manage Account Suspension” under “Account Functions”.

Managed Suspension

Temporarily Disabling a Website in Steps

  1. Select the website you wish to disable temporarily
  2. Click “Suspend”.
  3. If you wish to unsuspend the website, go to “List Suspended Accounts” under “Account Information” and click “Unsuspend”.

Suspended Accounts