Posts

Showing posts from August, 2015

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/xsd text/xsl text/xml image/x-icon   </IfModule> </IfModule> Then test it: $ curl -A 'Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20100101 Firefox

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                    http://serverIP:2086/scripts2/doautofixer?autofix=auto

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