Categories
Uncategorized

Change root password for MySQL 5.5/5.6/5.7 with Command Line

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password'); flush privileges;

 

Categories
Uncategorized

Install OCS Inventory Agent on CentOS 7

  1. Install EPEL Repo on CentOS 7
    cd /tmp
    wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    yum install -y epel-release-latest-7.noarch.rpm
    yum --disablerepo="*" --enablerepo="epel" install ocsinventory-agent -y
  2. Install Basic packages for agent
    yum install perl-XML-Simple perl-Net-IP
  3. Download latest agent rpm package
    wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/ocsinventory-agent-2.6.0-3.2.el7.x86_64.rpm
  4. Install package
    yum install ocsinventory-agent-2.6.0-3.2.el7.x86_64.rpm
  5. Open the configuration file.
    vi /etc/ocsinventory/ocsinventory-agent.cfg
  6. Uncomment the following lines. Set a tag for the current server and the address of your OCS server.
    server = http://your.ocs.server/ocsinventory
    tag = your_tag
  7. Restart agent
    service ocsinventory-agent restart
  8. To force the sending of inventory execute the following
    /usr/sbin/ocsinventory-agent
  9. How to check if ocsinventory-agent is installed or not
    rpm -qa | grep ocsinventory-agent
Categories
Uncategorized

Samba: Linux Iptables Firewall Configuration – Allow Samba ports in CentOS 6

Add below rules in iptables rule file
vi /etc/sysconfig/iptables

Rules:-

-A INPUT -s 0.0.0.0/0 -m state –state NEW -p udp –dport 137 -j ACCEPT
-A INPUT -s 0.0.0.0/0 -m state –state NEW -p udp –dport 138 -j ACCEPT
-A INPUT -s 0.0.0.0/0 -m state –state NEW -p tcp –dport 139 -j ACCEPT
-A INPUT -s 0.0.0.0/0 -m state –state NEW -p tcp –dport 445 -j ACCEPT

Now restart iptables service
service iptables restart

 

Categories
Solved

[Solved] Fatal error: Uncaught CredisException: Connection to Redis 127.0.0.1:6379 failed. Last Error : (111) Connection refused

Error:- Fatal error: Uncaught CredisException: Connection to Redis 127.0.0.1:6379 failed after 2 failures.Last Error : (111) Connection refused in /home/the-d2/public_html/vendor/colinmollenhour/credis/Client.php:463 Stack trace: #0 /home/the-d2/public_html/vendor/colinmollenhour/credis/Client.php(459): Credis_Client->connect() #1 /home/the-d2/public_html/vendor/colinmollenhour/credis/Client.php(792): Credis_Client->connect() #2 /home/the-d2/public_html/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php(432): Credis_Client->__call(‘hGet’, Array) #3 /home/the-d2/public_html/vendor/magento/zendframework1/library/Zend/Cache/Core.php(306): Cm_Cache_Backend_Redis->load(’33d_GLOBAL__DIC…’, false) #4 /home/the-d2/public_html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(39): Zend_Cache_Core->load(’33d_GLOBAL__DIC…’) #5 /home/the-d2/public_html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\Cache\Frontend\Adapter\Z in /home/the-d2/public_html/vendor/colinmollenhour/credis/Client.php on line 463

Solution:- Try restarting the redis service and flush redis cache.
# service redis restart
# redis-cli flushall

Categories
Solved

[Solved] certificate verification failed for untrusted issuer /OU=GlobalSign Root CA

Error:-

Nov 11 17:09:43 server postfix/smtp[30572]: certificate verification failed for aspmx.l.google.com[74.125.200.26]:25: untrusted issuer /OU=GlobalSign Root CA – R2/O=GlobalSign/CN=GlobalSign
Nov 11 17:14:31 server postfix/smtp[3332]: certificate verification failed for in.hes.trendmicro.com[54.219.191.21]:25: untrusted issuer /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA
Nov 11 17:19:32 server postfix/smtp[5333]: certificate verification failed for mx6.mail.icloud.com[17.133.229.15]:25: untrusted issuer /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
Nov 11 17:19:35 server postfix/smtp[5333]: certificate verification failed for mx5.mail.icloud.com[17.133.229.14]:25: untrusted issuer /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA

Solution:-

You need to mention the SSL CA file path, For me it was letsencrypt SSL and i gave it the complete chain, It worked.
Added below line in /etc/postfix/main.cf and restarted postfix

smtp_tls_CAfile = /etc/letsencrypt/live/the-d2.com/fullchain.pem

service postfix restart

Categories
Solved

[Solved] Error getting authority: PolicyKit1′: timed out (g-dbus-error-quark, 20)

Error:-

Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Failed to activate service ‘org.freedesktop.PolicyKit1’: timed out (g-dbus-error-quark, 20)

Troubleshooting:-

systemctl status polkit
● polkit.service – Authorization Manager
Loaded: loaded (/usr/lib/systemd/system/polkit.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-11-16 09:02:02 EST; 1min 58s ago
Docs: man:polkit(8)
Process: 11321 ExecStart=/usr/lib/polkit-1/polkitd –no-debug (code=exited, status=1/FAILURE)
Main PID: 11321 (code=exited, status=1/FAILURE)

systemctl start polkit
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to start polkit.service: Connection timed out
See system logs and ‘systemctl status polkit.service’ for details.

Solution:-

yum reinstall polkit
OR
wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/polkit-0.112-22.el7_7.1.x86_64.rpm
yum install polkit-0.112-22.el7_7.1.x86_64.rpm
It will install two other packages as well.
—> Package mozjs17.x86_64 0:17.0.0-20.el7 will be installed
—> Package polkit-pkla-compat.x86_64 0:0.1-4.el7 will be installed
Once installed, start service.
systemctl start polkit
systemctl status polkit
● polkit.service – Authorization Manager
Loaded: loaded (/usr/lib/systemd/system/polkit.service; static; vendor preset: enabled)
Active: active (running) since Sat 2019-11-16 09:20:53 EST; 4s ago
Docs: man:polkit(8)
Main PID: 8302 (polkitd)
CGroup: /system.slice/polkit.service
└─8302 /usr/lib/polkit-1/polkitd –no-debug

Categories
Uncategorized

Bad bots list – few more in 2019

AhrefsBot/6.1;
evc-batch/2.0)”
spider/4.0
Qwantify/2.4w;
DomainSigmaCrawler/0.1;
Mappy/1.0;
SemrushBot/6~bl;
Nimbostratus-Bot/v1.3.2;
SemrushBot-SI/0.97;
coccocbot-image/1.0;
SemrushBot/1.0~bm;
SEOkicks;
houzzbot;
GrapeshotCrawler/2.0;
MegaIndex.ru/2.0;
YandexImageResizer/2.0;
coccocbot-web/1.0;
TinEye-bot/1.31;
YandexImages/3.0;
Pinterestbot/1.0;
MJ12bot/v1.4.8;
SeznamBot/3.2;
DotBot/1.1;
bingbot/2.0;
YandexBot/3.0;
BLEXBot/1.0;

Categories
Uncategorized

[Solved] Connection to Redis failed after x failures Client.php Credis_Client->connect

Issue:-

 

[[email protected] ~]# cd /home/the-d2/public_html/var/report/
[[email protected] report]# cat 118233337366
a:4:{i:0;s:44:"Connection to Redis failed after 2 failures.";i:1;s:1529:"#0 /home/the-d2/public_html/lib/Credis/Client.php(362): Credis_Client->connect()
#1 /home/the-d2/public_html/lib/Credis/Client.php(447): Credis_Client->connect()
#2 /home/the-d2/public_html/lib/Credis/Client.php(440): Credis_Client->__call('select', Array)
#3 /home/the-d2/public_html/lib/Cm/Cache/Backend/Redis.php(117): Credis_Client->select(0)
#4 /home/the-d2/public_html/lib/Zend/Cache.php(153): Cm_Cache_Backend_Redis->__construct(Array)
#5 /home/the-d2/public_html/lib/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)
#6 /home/the-d2/public_html/app/code/core/Mage/Core/Model/Cache.php(137): Zend_Cache::factory('Varien_Cache_Co...', 'Cm_Cache_Backen...', Array, Array, true, true, true)
#7 /home/the-d2/public_html/app/code/core/Mage/Core/Model/Config.php(1354): Mage_Core_Model_Cache->__construct(Array)
#8 /home/the-d2/public_html/app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/cache', Array)
#9 /home/the-d2/public_html/app/code/core/Mage/Core/Model/App.php(401): Mage::getModel('core/cache', Array)
#10 /home/the-d2/public_html/app/code/core/Mage/Core/Model/App.php(295): Mage_Core_Model_App->_initCache(Array)
#11 /home/the-d2/public_html/app/code/core/Mage/Core/Model/App.php(337): Mage_Core_Model_App->baseInit(Array)
#12 /home/the-d2/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /home/the-d2/public_html/index.php(98): Mage::run('', 'store')
#14 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}

[[email protected] report]# redis-cli flushall
Could not connect to Redis at 127.0.0.1:6379: Connection refused

[[email protected] report]# service redis status
Redirecting to /bin/systemctl status redis.service
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: failed (Result: exit-code) since Wed 2019-10-27 22:47:11 IST; 9min ago
Process: 29554 ExecStop=/usr/libexec/redis-shutdown (code=exited, status=1/FAILURE)
Process: 15882 ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd (code=killed, signal=KILL)
Main PID: 15882 (code=killed, signal=KILL)

Oct 27 22:47:11 server.the-d2.com systemd[1]: redis.service: main process exited, code=killed, status=9/KILL
Oct 27 22:47:11 server.the-d2.com redis-shutdown[29554]: Could not connect to Redis at 127.0.0.1:6379: Connection refused
Oct 27 22:47:11 server.the-d2.com systemd[1]: redis.service: control process exited, code=exited status=1
Oct 27 22:47:11 server.the-d2.com systemd[1]: Unit redis.service entered failed state.
Oct 27 22:47:11 server.the-d2.com systemd[1]: redis.service failed.

 

Solution:-  Restart redis service then check memory bottleneck cause

[[email protected] report]# service redis restart
Redirecting to /bin/systemctl restart redis.service
[[email protected] report]# service redis status
Redirecting to /bin/systemctl status redis.service
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Wed 2019-10-27 22:56:12 IST; 1s ago
Process: 29554 ExecStop=/usr/libexec/redis-shutdown (code=exited, status=1/FAILURE)
Main PID: 3416 (redis-server)
CGroup: /system.slice/redis.service
└─3416 /usr/bin/redis-server 127.0.0.1:6379

Oct 27 22:56:12 server.the-d2.com systemd[1]: Starting Redis persistent key-value database...
Oct 27 22:56:12 server.the-d2.com systemd[1]: Started Redis persistent key-value database.

 

 

Categories
Solved

[Solved] MySQL service not starting – Job for mariadb.service failed because the control process exited with error code. journalctl -xe

Issue / Error:-

[[email protected] ~]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
Job for mariadb.service failed because the control process exited with error code. See “systemctl status mariadb.service” and “journalctl -xe” for details.

MySQL error logs:-

[[email protected] ~]# cat /var/lib/mysql/server.the-d2.com.err
2019-10-20 10:12:56 1220654356911872 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-10-20 10:12:56 1220656458905792 [Note] InnoDB: Highest supported file format is Barracuda.
2019-10-20 10:12:56 1220656458905792 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-10-20 10:12:56 1220656458905792 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-10-20 10:12:56 1220656458905792 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2019-10-20 10:12:56 1220656458905792 [ERROR] InnoDB: preallocating 12582912 bytes for file ./ibtmp1 failed with error 28
2019-10-20 10:12:56 1220656458905792 [ERROR] InnoDB: Could not set the file size of ‘./ibtmp1’. Probably out of disk space
2019-10-20 10:12:56 1220656458905792 [ERROR] InnoDB: Unable to create the shared innodb_temporary
2019-10-20 10:12:56 1220656458905792 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-10-20 10:13:01 1220656458905792 [Note] InnoDB: Starting shutdown…
2019-10-20 10:13:01 1220656458905792 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2019-10-20 10:13:01 1220656458905792 [ERROR] Plugin ‘InnoDB’ init function returned error.
2019-10-20 10:13:01 1220656458905792 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2019-10-20 10:13:01 1220656458905792 [Note] Plugin ‘FEEDBACK’ is disabled.
2019-10-20 10:13:01 1220656458905792 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2019-10-20 10:13:01 1220656458905792 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-10-20 10:13:01 1220656458905792 [ERROR] Aborting

Solution:-

Disk was full, deleted some data and mysql service started without any issue.

[[email protected] ~]# df -h
Filesystem – Size – Used – Avail – Use% Mounted on
devtmpfs – – 3.9G – 0 – 3.9G – 0% /dev
tmpfs – 3.9G – 0 – 3.9G – 0% /sys/fs/cgroup
/dev/xvda1 – 99G – 99G – 78M – 100% /
tmpfs – 783M – 0 – 783M – 0% /run/user/1000

[[email protected] ~]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
[[email protected] ~]#

 

Categories
Zimbra

Change Zimbra Server’s IP via Command Line – CentOS / Ubuntu

su - zimbra

# Below command will show you the Old IP

postconf mynetworks
mynetworks = 127.0.0.0/8 192.168.0.0/24

# Also check via Zimbra LDAP configuration

zmprov getServer zimbra.the-d2.com | grep zimbraMtaMyNetworks

# Change the IP with below command (replace hostname and IP accordingly)

zmprov modifyServer zimbra.the-d2.com zimbraMtaMyNetworks '127.0.0.0/8 192.168.12.44/24'

# Now reload and restart your Zimbra services:-

su - zimbra
postfix reload
zmcontrol stop
zmcontrol start