Friday, February 24, 2017

Remove Old Kernels on CentOS 7 (clean /boot partition warning WHM)

As we know kernels use to update regularly in linux server and blocking storage of old kernel files. So we use to get mail notice like this blew on when we use WHM in server.

The filesystem “/boot” mounted at “/boot” reached “warn” status because you currently use 84.36% of its available blocks.

First, check what kernel we're using, and do not attempt to remove it using following command


# uname -a

We'll get current kernel version which we must not delete like blew
3.10.0-514.6.2.el7.x86_64
Check Installed Kernels use following command we'll get list of kernel 


rpm -q kernel
kernel-3.10.0-229.el7.x86_64
kernel-3.10.0-327.28.2.el7.x86_64
kernel-3.10.0-514.6.2.el7.x86_64

Normally reason why you maybe want remove kernels is limited disk space, example on VPS servers and laptop. This is very easy task, you need yum-utils package.
yum install yum-utils
If you want to update latest kernel run following command from SSH using putty

yum update
Package-cleanup set count as how many old kernels you want left
example if there are 5 kernels and we want to keep 2 and remove other old kernels use following command
package-cleanup --oldkernels --count=2

Wednesday, February 15, 2017

Duplicate entry '1' for key 'PRIMARY'

My application is working fine in localhost but when i was export my sql file online server suddenly it is showing

Duplicate entry '1' for key 'PRIMARY'

I drop the table and again import server times but no solution though i'm sure i have a primary column with auto increment option.

So later when exporting the sql file from phpmyadmin i click "custom", scoll down and click Add DROP TABLE / TRIGGER statement. then import the sql file again and this  time it worked for me.



Thursday, January 26, 2017

Creating multiple name server

If we want to create name server under www.esteemcorporation.com to different server but esteem it self hosted another server.


Example i need to use


This 2 name server for a server IP 00.11.22.33.44


Ns1.esteemcorporation.com
Ns2.esteemcorporation.com


This 2 for 55.66.77.88.99
Ns5.esteemcorporation.com
Ns6.esteemcorporation.com


But esteemcorporation.com is hosted another server.


Now create child name server from esteemcorporation.com domain panel and assign IP



Now go to WHM/Cpanel of esteemcorporation.com and find DNS zone edit option. Add A record to ns5.esteemcorporation.com and assign IP.


Now we can use NS5.esteemcorporation.com   as a nameserver which pointed to 55.66.77.88 server.

Total Pageviews