Posts

High Load on *nix servers

To check and reduce the load, I am pasting the commands which will provide you the outputs concerned with high load. Accordingly, you can troubleshoot the issue to reduce the load. 1.Get server uptime with uptime command: $ uptime 2. Gather information like tasks, memory, cpu and swap through Top command: $ top -cd3 Use "Shift +m" to order the memory usage from maximum to minimum. You can use "Shift +o" to choose different options also. 3. See the Load average, memory usage and CPU usage with Sar command: $ sar $ sar -q $ sar -r 4. Check top 10 memory hungry processes using following command: $ ps auxxx --sort=-rss | head -11 5. Check top 10 cpu hungry processes using following command: $ ps auxxx --sort=-%cpu | head -11 6. Check mpstat result with following: $ /usr/bin/mpstat -P ALL 7. Check iostat with iostat command. $ iostat 8. Check free RAM on the server: $ free -m 9. Use pstree to look for any suspicious processes or u...

It's about Bangalore !!!

Hi Folks, This Blog is not technical, but about my new destination, Bangalore. Earlier I have worked in three different cities Jabalpur, Kochi and Mangalore but Bangalore seem different. The first thing you will notice about this city is It's awesome weather. If you have been in Bangalore, no need to explain it to you. When I reached Bangalore in the morning and put my first step on the Road, a cold breeze of Air has welcomed me with all its warm affection towards the newcomer. I must say, It was a pleasant morning, even after a tiresome journey from Mangalore to Bangalore. I found this city as Blend of different cultures and everything is going in Harmony. There are people from every corner of India. They celebrate every festival with the same Joy and Happiness what you find in your place. Currently, the Ganesha Chaturthi festival is in celebration here and its surprise to see the same ebullience and exhilaration as in Maharastra towards Bappa(Lord Ganesha). Further, I wa...

PHP functions checker code

<?php if (function_exists('imap_open')) {     echo "IMAP functions are available.<br />\n"; } else {     echo "IMAP functions are not available.<br />\n"; } if (function_exists('dir')){     echo "dir functions are available.<br />\n"; } else {     echo "dir functions are not available.<br />\n"; } if (function_exists('readdir')) {         echo "readdir functions are available.<br />\n"; } else {     echo "readdr functions are not available.<br />\n"; } if (function_exists('opendir')) {         echo "opendir functions are available.<br />\n"; } else {     echo "opendir functions are not available.<br />\n"; } if (function_exists('eval')) {         echo "eval functions are available.<br />\n"; } else {     echo "eval functions are not available.<br />\n"; } if ...

Steps to install Perl module in cPanel

Step 1. First export the following (replace username with the actual user): export PERL_MB_OPT='--install_base /home/username/perl5' export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5' export PERL5LIB='/home/username/perl5/lib/perl5/i386-linux:/home/username/perl5/lib/perl5' export PATH="/home/username/perl5/bin:$PATH" Step 2. Then add those to the /home/username/.bashrc Step 3. Download the Module's file from the cpan website. Step 4. Untar it Step 5. Run: perl Makefile.pl && make && make install Step 6. chown installed files as necessary.

Speedup your website with Gzip on cPanel

Verify whether mod_deflate in installed or not on the server. It should be installed. $ httpd -l | grep mod_deflate If not, install it through easyapache. $ /scripts/easyapache Then add the following codes in .htaccess:  <IfModule mod_deflate.c>      <IfModule mod_setenvif.c>         BrowserMatch ^Mozilla/4 gzip-only-text/html         BrowserMatch ^Mozilla/4\.0[678] no-gzip         BrowserMatch \bMSIE !no-gzip !gzip-only-text/html        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html     </IfModule>    <IfModule mod_headers.c>        Header append Vary User-Agent env=!dont-vary    </IfModule>   <IfModule mod_filter.c>      AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xs...

Login failed error in Webmail when access from cPanel

Issue: When you access your Webmail account from cPanel, its showing Login failed error Whilst, Webmail is accessible directly through Webmail URL or with Webmail port number. Fix: The issue may occurs due to the missing directory where session files are saved. You need to create the directory "/var/cpanel/cpses/keys" on the server in order to fix the issue.

cPanel AutoFix Scripts

cPanel comes with a number of hidden autofix commands that allow for administrators to fix common problems simply by logging into WHM and going to a special URL. Two of the most useful ones I’ve seen are flushing iptables and restarting SSH in safe mode. You will not find the ‘scripts2’ directory in your server. To run your hidden cpanel commands you will have to login to the WHM. Then you may go to the URL http://serverIP:2086/scripts2/autofixer From there you can type the autofixer scripts name. You will get the autofix commands from the link: http://httpupdate.cpanel.net/autofixer/ Here are some examples: Reset the Firewall Settings   https://serverIP:2087/scripts2/doautofixer?autofix=iptablesflush Reset the SSH Settings        http://serverIP:2086/scripts2/doautofixer?autofix=safesshrestart bsdbindfix                    http://serverIP:2086/scripts2/doautofixer?autofix=bsdbindfix Autorepair...

Bug in Mailman

Error:  We're sorry, we hit a bug! Please inform the webmaster for this site of this problem. Printing of traceback and other system information has been explicitly inhibited, but the webmaster can find this information in the Mailman error logs. Reason:   One of the reason for the issue is that the folders in /usr/local/cpanel/3rdparty/mailman is not having sufficient permission. Fix: You can perform the following steps to fix the issue: Go to /usr/local/cpanel/3rdparty/mailman and check the permission of all the folders. $ ls -al /usr/local/cpanel/3rdparty/mailman Try $ chmod -R 2775 ./*  Now the permission of folders must have changed. Check if this has fixed the issue.  If not, you can try running the fixmailman script in the server at /scripts.

Incorrect disk quota on WHM/cPanel

Issue:   Disk usage zero for all the domains in 'list accounts'  Reason: Mismatch between the disk usage in backend and Cpanel Fix: Check whether /home partition has been mounted with 'usrquota' option (defaults,usrquota in /etc/fstab) # cat /etc/fstab| grep home LABEL=/home  /home    ext3    defaults,usrquota  1 2 # quotacheck -c /home # quotaon /home Also Check the option WHM >> Server Configuration >> Tweak Settings >> System --- Disable Disk Quota display caching

WordPress website slowness

Here are the following few things that you should do at your end: -->> Plugins: Before you install any plugin on your website, ask yourself “Is this plugin necessary?”. Plugins are one of the biggest causes of WordPress websites being slow. The more plugins you install without research, the more likely you will face performance issues; however the sheer number of plugins you have installed is not the reason a WordPress website can slow down. Certain plugins are known for causing websites to be slow. There are many reasons for this including bad coding, calls to external servers and persistent calls and updating of your WordPress database. Pay close attention to how much CPU plugins use too. Many plugins can bottleneck your CPU due to persistent processes. -->> Themes: A design that has been coded badly, or uses images throughout the design, will add unnecessary weight to your page. It is not uncommon for some WordPress themes to be a few megabytes in size. Such...