Implement WordPress automatic Updates using wp-config file

Before editing, creating a complete backup.

After backup, Navigate to the home directory and makes changes in wp-config.php file.

cd /var/www/domain.com
nano wp-config.php

Add the following…

/** Enable Auto Updates */
define('WP_AUTO_UPDATE_CORE', true);
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );

what is the use of /etc/udev/rules.d/70-persistent-net.rules file in linux? is anyother way to change interface name in linux other than 70-persistent-net.rules?

This file associates your NIC’s MAC address with an interface name that will be given to the NIC at startup. There are certainly ways to change the name at runtime but if you reboot, it’s gonna be the contents of that file that count.

Additionally, you can use it for renaming the interfaces

MariaDB [(none)]> show table status from admin_geek01;
+-----------------------------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| Name                        | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length  | Index_length | Data_free | Auto_increment | Create_time         | Update_time         | Check_time          | Collation       | Checksum | Create_options | Comment |
+-----------------------------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| 2qGr3sjm_commentmeta        | MyISAM |      10 | Dynamic    |    0 |              0 |        2704 |  281474976710655 |         9216 |      2704 |           1073 | 2015-12-10 13:59:26 | 2015-12-30 22:51:44 | 2016-01-29 23:01:12 | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_comments           | MyISAM |      10 | Dynamic    |    0 |              0 |        8888 |  281474976710655 |         7168 |      8888 |            530 | 2015-12-10 13:59:26 | 2015-12-30 22:51:44 | 2016-01-29 12:35:32 | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_links              | MyISAM |      10 | Dynamic    |    0 |              0 |           0 |  281474976710655 |         1024 |         0 |              1 | 2015-12-10 13:59:26 | 2015-12-10 13:59:26 | 2015-12-10 13:59:26 | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_options            | InnoDB |      10 | Compact    |  167 |           6671 |     1114112 |                0 |        16384 |   6291456 |          18191 | 2015-12-10 13:59:26 | NULL                | NULL                | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_postmeta           | MyISAM |      10 | Dynamic    | 1758 |            106 |      187856 |  281474976710655 |       116736 |         0 |           7564 | 2015-12-10 13:59:26 | 2016-02-19 11:42:42 | 2016-02-07 11:40:30 | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_posts              | InnoDB |      10 | Compact    | 3547 |           1926 |     6832128 |                0 |       442368 |   6291456 |           2966 | 2015-12-10 13:59:26 | NULL                | NULL                | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_stb_styles         | MyISAM |      10 | Dynamic    |    7 |            845 |        5920 |  281474976710655 |         8192 |         0 |           NULL | 2015-12-10 13:59:26 | 2015-12-10 13:59:26 | NULL                | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_term_relationships | MyISAM |      10 | Fixed      |  899 |             21 |       18900 | 5910974510923775 |        46080 |        21 |           NULL | 2015-12-10 13:59:26 | 2016-02-19 11:36:09 | 2016-02-07 11:40:30 | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_term_taxonomy      | MyISAM |      10 | Dynamic    |  105 |             39 |        4148 |  281474976710655 |         9216 |         0 |            108 | 2015-12-10 13:59:26 | 2016-02-19 11:36:09 | 2016-02-07 11:40:29 | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_termmeta           | InnoDB |      10 | Compact    |    0 |              0 |       16384 |                0 |        32768 |   6291456 |              1 | 2015-12-10 13:59:26 | NULL                | NULL                | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_terms              | MyISAM |      10 | Dynamic    |  105 |             30 |        3176 |  281474976710655 |        13312 |         0 |            108 | 2015-12-10 13:59:26 | 2015-12-10 13:59:26 | 2015-12-10 13:59:26 | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_usermeta           | InnoDB |      10 | Compact    |   37 |            442 |       16384 |                0 |        32768 |   6291456 |             41 | 2015-12-10 13:59:26 | NULL                | NULL                | utf8_general_ci |     NULL |                |         |
| 2qGr3sjm_users              | MyISAM |      10 | Dynamic    |    1 |            120 |         120 |  281474976710655 |         4096 |         0 |              2 | 2015-12-10 13:59:26 | 2015-12-10 13:59:26 | 2015-12-10 13:59:26 | utf8_general_ci |     NULL |                |         |
+-----------------------------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------------+----------+----------------+---------+

Check services that are enabled on CentOS 7

# systemctl list-unit-files

Or for a specific service

# systemctl status mysqld

Disabling a service on boot in CentOS 7
To disable, it’s simply a matter of running systemctl disable on the desired service.


# systemctl disable mysqld

Check which services failed to start on boot on CentOS 7
As a bonus, systemctl allows you to list all services that failed to start on boot, even though they were configured to start on boot.


# systemctl --failed

There are a few reasons to install a cron job to create full database dumps versus copying the /var/lib/mysql data. The MySQL service may have a lock on the database file(s) when it attempts to replicate the data file, causing it to fail; if the backup on the data files does succeed, the InnoDB log files may not match with the ibdata increasing the chance of full corruption or lost data; MyISAM data and table structures can face similar issues.

Plesk

Create a location for the dumps. This will be the folder the dumps are exported to by the script.

# mkdir -pv /usr/local/db/dumps

Create a script that cron can execute. Create /usr/local/bin/dbdump with these contents:

nano /usr/local/bin/dbdump

Put this in the file (for Plesk)

#!/bin/bash
for db in $(mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e 'show databases' -s --skip-column-names); do echo -n "dumping $db..."; mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` $db > "/usr/local/db/dumps/$db.sql"; echo "[done]"; done

Make it executable:

# chmod +x /usr/local/bin/dbdump

For non plesk:

# nano /usr/local/bin/dbdump

Put this in the file

for db in $(mysql -uroot -pPASSWORD -e 'show databases' -s --skip-column-names); do echo -n "dumping $db..."; mysqldump -uroot -pPASSWORD $db > "/usr/local/db/dumps/$db.sql"; echo "[done]"; done

Make it executable:

# chmod +x /usr/local/bin/dbdump

Create /etc/cron.d/dbdump with these contents:

# nano /etc/cron.d/dbdump
# Cronjob to dump databases nightly
05     0      *       *       *       root       /usr/local/bin/dbdump >/dev/null 2>&1

Link to install zabbix server on centOS 6- http://www.unixmen.com/install-zabbix-monitoring-tool-centos-6-5/

Zabbix Documentation – https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages/rhel_centos

Install on CentOS 7 – http://www.unixmen.com/how-to-install-zabbix-server-on-centos-7/

Install Epel

# yum install epel-release

Configure the ZabbixZone package repository and GPG key using command:

# rpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX
# rpm -Uv  http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-release-2.4-1.el7.noarch.rpm

Install the agent

# yum install zabbix-agent

Modify Zabbix Agent Configuration
Open zabbix_agentd.conf and make below necessary changes (Add your Zabbix Server IP and add Zabbix Agent hostname) and save + Exit.

# sudo nano /etc/zabbix/zabbix_agentd.conf
Server=192.168.1.106
ServerActive=192.168.1.106
Hostname=server.geekdecoder.com

Set to on

# chkconfig zabbix-agent on

Restart Zabbix Agent

# service zabbix-agent restart
or
# /etc/init.d/zabbix-agent restart

# For Systemd Systeme #
# systemctl restart zabbix-agent.service
or
# systemctl restart zabbix-agent
or
# /bin/systemctl restart zabbix-agent.service

Add firewall rule in CentOS 7:

# firewall-cmd --permanent --zone=public --add-port=10050/tcp
success
# firewall-cmd --reload
success

The ‘neighbor table overflow’ is a VERY common linux issue on large networks. Some network trigger this with default linux settings (because the previous network regime put so many IP address subnets on a single vlan , it creates large ARP tables – which is not normal / default settings). It is not an indication of anything wrong. It is a trigger of linux default.

Here is how to adjust:
If you see this….

__ratelimit: 20 callbacks suppressed
Neighbour table overflow.

For busy networks increase the kernel’s internal ARP cache size. The following kernel variables are used:


net.ipv4.neigh.default.gc_thresh1
net.ipv4.neigh.default.gc_thresh2
net.ipv4.neigh.default.gc_thresh3
To see current values, type:

Run this…


# sysctl net.ipv4.neigh.default.gc_thresh1
net.ipv4.neigh.default.gc_thresh1 = 128

# sysctl net.ipv4.neigh.default.gc_thresh2
net.ipv4.neigh.default.gc_thresh2 = 512

# sysctl net.ipv4.neigh.default.gc_thresh3
net.ipv4.neigh.default.gc_thresh3 = 1024

You need to make sure that the arp table to become bigger than the above defaults. The above limitations are good for small network or a single server. This will also affect your DNS traffic.

How Do I Fix “Neighbour Table Overflow” Error?


# vi /etc/sysctl.conf

Append the following:

## works best with <= 500 client computers ## # Force gc to clean-up quickly net.ipv4.neigh.default.gc_interval = 3600 # Set ARP cache entry timeout net.ipv4.neigh.default.gc_stale_time = 3600 # Setup DNS threshold for arp net.ipv4.neigh.default.gc_thresh3 = 4096 net.ipv4.neigh.default.gc_thresh2 = 2048 net.ipv4.neigh.default.gc_thresh1 = 1024 [/bash] To load new changes type the following command:[bash] # sysctl -p [/bash]

Install MySQL / MariaDB
Installing MariaDB is as simple as running just one command:


# yum -y install mariadb-server mariadb

And then start MySQL, now MariaDB:


# systemctl start mariadb

Be sure that MySQL/MariaDB starts at boot:


# systemctl enable mariadb

To check the status of MySQL/MariaDB:


# systemctl status mariadb

To top MySQL/MariaDB:


# systemctl stop mariadb

Check the installation with the command client:


# mysql