November 26

Cool things on CSF config:

Set email alert from LFD to custom email:

LF_SSH_EMAIL_ALERT = "1"
LF_ALERT_TO = "user@example.org"

Check server security points in details and get report to email
csf -m user@example.com

Additional settings to make your LDF more correct and end user friendly
IGNORE_ALLOW = "1"
PT_LIMIT = "0"

November 26

How to install Imagick application on Centos 6 or Centos 7

yum install -y ImageMagick ImageMagick-devel

In case when we need to install the latest ImageMagick from the vendor site:

yum install -н openjpeg2 openjpeg-libs fftw-libs-double
Then download the latest ImageMagick from here: https://imagemagick.org/download/linux/CentOS/x86_64/

And move to the install:

rpm -Uvh ImageMagick-libs-7.0.8-53.x86_64.rpm; rpm -Uvh ImageMagick-7.0.8-53.x86_64.rpm; rpm -Uvh ImageMagick-perl-7.0.8-53.x86_64.rpm

In the case with the perl module, now we can “test” it:

perldoc Image::Magick

November 19

How to add admin user via MySQL to WP

Username: admin_username
Password: some_password_for_user
Change these credentials in the code to your own selection.

INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`,
`user_status`)
VALUES ('admin_username', MD5('some_password_for_user'), 'firstname lastname', 'email@example.com', '0');

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users),
'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');

November 16

check the Strict mode in MySql

to check it execute the query in MySQL:

SHOW VARIABLES LIKE 'sql_mode';

if enabled it will be something like this:

MariaDB [(none)]> SHOW VARIABLES LIKE 'sql_mode';
+-------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------+
| IGNORE_SPACE,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------+

if the Strict mode is disabled you will see an empty response.

if you want to disable it, just add the following like to file /etc/my.cnf inside [mysqld] section the following sql_mode=''

November 8

open domain from IP address in cPanel (disable default cPanel page)

copy the file:
cp -pv /var/cpanel/templates/apache2_4/ea4_main.default /var/cpanel/templates/apache2_4/ea4_main.local

then update the skeleton in order to show the site over IP, something like this:
<virtualhost put_main_server_ip_here:80>
ServerName put_main_server_ip_here
DocumentRoot /home/username/public_html
ServerAdmin some@email

<directory "/">
AllowOverride All
</directory>

<ifmodule suphp_module>
suPHP_UserGroup username username
</ifmodule>

</virtualhost>
on file:
nano /var/cpanel/templates/apache2_4/ea4_main.local
rebuild the config and restart Apache:
/scripts/rebuildhttpdconf
service httpd restart