So i ran NPM in my centos server. But accidentally i upgraded NPM from old version to the latest version (i forgot what command that i ran).
(more…)
Category: Server
-
NPM Error in WHM, Saved by Installing NVM
-
cPanel Can Not Add MySQL User to Database
Recently i could not add MySQL user to MySQL Database in cPanel. There was no error message displayed on screen. The operation just failed.
Then i tried to use cPanel MySQL Database Wizard to create a new database, new user, and add that new user to the new database. Then i saw the error message in my browser.
(more…) -
Does CSF Firewall Make Your WHM / Server Slow ?
There are various reasons why CSF firewall may make your WHM / server slow.
Here are some personal tips from me. -
Find String in Files in Linux
To find some string within files in Linux, you can use this command
grep -rnw '/your/path/' -e "find this string"-r means recursive
-n means line number
-w means match the whole word 🙂 -
Use DKIM Key With WHM, cPanel, Cloudflare
DKIM is one of useful thing to make email which is sent by your domain to be avoided marked as spam.
When you use cloudflare for that domain, there is some change that you need to do on the DKIM key.
For example on your WHM (Edit DNS Zone) or cPanel (Email > Authentication), you will get DKIM key with format like this :
"v=DKIM1; k=rsa; p=XXXX" YYY\; -
How to Append Date and Time to Log File in Linux
If we want to get detailed log report, we can store multiple log files with date and time information on the file name 🙂
We can do this command in Linux :
your_command_here > /path_1/path_2/your_log_$(date +"%Y-%m-%d_%H-%M-%S").txt -
How to Delete Files in Directory in Linux
If you want to delete files within a directory in Linux, you can use this simple command
rm -f /your/directory/*If you want to delete files and directories recursively within a directory in Linux, you can use this command instead 🙂
rm -rf /your/directory/* -
Empty a File Using Linux Command
Today i received an e-mail notification from cpanel that a partition in my server is almost full.
First i checked largest directories / files using this command :du -h --max-depth=1 /some/pathThen i noticed that they were some log files which took space in my partition 🙂
(more…) -
How to Remove Directory and Subdirectories Recursively in Linux
Sometimes there is occasion where deleting files from Cpanel takes a very long time to finish.
For example because there are too many files under a directory.
In this situation we can use SSH to delete a directory and all files and subdirectories under that directory.We can use the command below.
But be careful, do not enter wrong path.
You may delete the wrong directory. 🙂rm -rf /your/directory/ -
Regularly Runs MySQL FLUSH QUERY CACHE
In some situation, like suggested in some mysql optimization script, you may want to regularly run “FLUSH QUERY CACHE”.
First, open your terminal and try to run this command :
mysql -e 'FLUSH QUERY CACHE'
If there is no error, you can add that command in your cron job, such as this command to run it every 10 minutes :
*/10 * * * * mysql -e 'FLUSH QUERY CACHE'