How to Set or Change Hostname in CentOS 7

Use this information when changing the hostname in centos 7.

Ways to show the hostname

# hostname
# hostname -s
# hostname -f
# cat /etc/hostname
# hostnamectl

How to change the hostname.
In order to change or set a CentOS 7 machine hostname, use the hostnamectl command as shown in the below command excerpt.

# hostnamectl set-hostname your-new-hostname

In order to apply the new hostname, a system reboot is required, issue one of the below commands in order to reboot a CentOS 7 machine.


# init 6
# systemctl reboot
# shutdown -r now

A second method to setup a CentOS 7 machine hostname is to manually edit the /etc/hostname file

# nano /etc/hostname

How To: Fix kernel panic-not syncing: VFS: unable to mount root fs on unknown block(0,0) on Azure VM

When booting an Azure VM, this error:

304.863321] —[ end Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Solution: remove old linux kernels, your /boot drive is out of space.

-boot to grub and click on “Advanced options”
-Select a previous kernel (should boot fine)
login and enter command

$ df

See if your /boot directory is 100% used
Remove old linux kernels

$ sudo apt-get autoremove

Also, there may be an issue with the storage drivers (that should be built into initramfs) needed for Hyper-V / Azure.
Other Information: https://support.microsoft.com/en-us/help/4091524/how-recovery-azure-linux-vm-from-kernel-related-boot-related-issues

No PGP for Horde Mail in Plesk

When checking mail, I noticed the PGP option was not available. It should look like this:

So, I followed this:
https://support.plesk.com/hc/en-us/articles/115002313594-How-to-install-GnuPG-PHP-extension-for-Plesk-PHP-

But still missing.

https://www.poftut.com/install-use-gpg-encrytion-linux-order-encrypt-decrypt-files-folder/

MySQL shows warning: Using unique option is deprecated and will be removed in a future release

Error when exporting a dump in plesk databases (See:https://docs.plesk.com/en-US/onyx/reseller-guide/website-management/website-databases/exporting-and-importing-database-dumps.69538/):

Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.

Cause

key_buffer and myisam-recover are deprecated in Mysql 5.5. myisam-recover option is renamed as of MySQL 5.5.3 to myisam-recover-options .
Resolution

1. Log in to Plesk server via SSH

2. Correct /etc/my.cnf or /etc/mysql/my.cnf as below:
Change pass to password
See – https://serverfault.com/questions/670648/mysqldump-complains-about-chosen-databases-regardless-of-command-line

USe path to php 7 to run a command vs OS php

When needing to run a command in a different version on php.
Wher is the path to php 7 on cpanel?


# /opt/cpanel/ea-php70/root/usr/bin/php -v
PHP 7.0.32 (cli) (built: Sep 14 2018 20:36:03) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

set the path – https://stackoverflow.com/questions/31206864/use-different-php-version-cli-executable-for-one-command