Archive for the 'Freelance' Category
cPanel – Webmail (cpanelro) Highload
Thursday, July 30th, 2009From cPanel Forum:
CPU Process has a high load, with many cpanelro user taking the cpu time. Below is script to kill cpanelro’s process
#!/bin/sh
for ROUND in `ps aux | grep roundcube | awk -F " " '{print $10}' | awk -F ":" '{print $1}'`;
do
if [ $ROUND -ge 20 ]; then
pkill -u cpanelroundcube
echo "kill roundcube process roundcube";
fi
done
Put in crontab and run it every 15 or 30minutes. Or you can edit RoundCube file to fix a never ending loop caused when trying to log in with an invalid account
PHP with SuPHP on cPanel
Saturday, June 27th, 2009When you activated SuPHP on cPanel servers, this is the normal output should be.
The MIME types associated with PHP may have changed.
If you experience problems with PHP related settings in .htaccess files, ensure
those files use the MIME types specified above (the first value listed after AddType.)
“Nobody” prevented from sending emails
Tuesday, June 23rd, 2009Forget what I said below, if your webhosting has disabled user “nobody” to sent email, then they should enable suphp. This way, all PHP script executes as user account and not nobody. And will deliver email correctly.
==========
So your webhosting provider activated “Prevent “nobody” from sending mail” which cause your PHP script can’t sent email? You can use PHP classes called XpertMailer or PHPMailer but somehow it’s not working well on my host. Weird… The previous version XPertMailer works like charm but somehow the new one never sent my emails.
So I googling around and found Webmaster World’s Forum, and luckily the ini_set function is not disabled. So I test the script and it works flawlessly. Below is the script
(more…)
Read-only file system
Sunday, June 14th, 2009Once upon a time when I tried to create a folder using ftp client on the server, I get error "cant create directory gallery: read-only filesystem".
After googling a while I found the solution on Always Hosting Forum. And the only way to resolve it permanently is by running fsck utility on linux single mode before mounting the harddrive. Yes there is a temporarily solution by restarting the server, but when the system is about to write into failed inode it will freeze, daemons stop responding, connections rejected, etc to make sure it wont cause more broken inode will lead into data corruption.
(more…)