Change MySql root password on centos

To change the root password, we need to still start mySQL with –skip-grant-tables options and update the user table

1. Stop mysql:
systemctl stop mysqld

2. Set the mySQL environment option
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"

3. Start mysql usig the options you just set
systemctl start mysqld

4. Login as root
mysql -u root

5. Update the root user password with these mysql commands
mysql->UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')
    ->WHERE User = 'root' AND Host = 'localhost';
mysql-> FLUSH PRIVILEGES;
mysql-> quit

*** Edit ***
For 5.7.6 and later, you should use
   mysql->ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Or you'll get a warning

6. Stop mysql
systemctl stop mysqld

7. Unset the mySQL envitroment option so it starts normally next time
systemctl unset-environment MYSQLD_OPTS

8. Start mysql normally:
systemctl start mysqld

Try to login using your new password:
7. mysql -u root -p

Redirecting to HTTPS from HTTP

If we have added an SSL certificate to your domain, we can force all visits to your site to use HTTPS to ensure your traffic is secure. This post shows examples on how to do this.

The following forces any http request to be rewritten using https. For example, the following code forces a request to http://example.com to load https://example.com. It also forces directly linked resources (images, css, etc.) to use https:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

Hope this help you to redirect from http to https

Updating/Upgrading Magento 2 using Command Line

In this post we are discussing about how we can update/upgrade Magento 2 using command line

First of all you need the ssh access and login with the username and password and move to the root directory in which Magento 2 is installed

Then you need to run this commands one by one

composer require magento/product-community-edition 2.2.3 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

Here 2.2.3 is the latest version of Magento 2, you can change this to what ever versions and can be found here

After all these commands executed ,check your Magento version with the following command:

php bin/magento --version

Change WordPress Permissions via SSH

Login to your server via SSH and enter the following commands to change your WordPress directory and file permissions.

Directory Permissions

Set permissions on all directories to 755.

find . -type d -print -exec chmod 755 {} \;

File Permissions

Set permissions on all files to 644.

find . -type f -print -exec chmod 644 {} \;