Something Different In Linux

Home » Archive by category 'cpanel'

daily mysql databases backup on cpanel server

Posted by Rishikesh Vispute Categories: cpanel, mysql, Uncategorized

Question: How to back up MySQL databases using cron jobs on cpanel server ? Ans: You can take the mysql backup of all databases for last 10 days and keep on the server.  You need to add the cron to create the daily mysql backup of all the databases. The backup is stored in the folder  [ Read More ]

Question: How to install R1 soft cdp agent on the Linux server? Ans : You can install the Latest R1 soft cdp agent on Linux server by using following steps 1) Create the yum repository for the r1soft vi /etc/yum.repos.d/r1soft.repo [r1soft] name=R1Soft Repository Server baseurl=$basearch/ enabled=1 gpgcheck=0 2) Install the cdp agent by using following  [ Read More ]

Question : How to terminate old suspended accounts on cpanel server ? Ans:  You can terminate the 90 days old suspended accounts by using the following script. 1) vi /root/ ================== for i in `find /var/cpanel/suspended/ -mtime +90 | cut -d’/’ -f5 | sed ‘1 d’` do y | /scripts/killacct $i –killdns n; done; ==================  [ Read More ]

scan FTP uploaded files on cpanel servers

Posted by Rishikesh Vispute Categories: cpanel, security

This Howto will help you virus can all uploaded via FTP to make sure all files are virus free: First lets install clamAV , it has been now been included in Cpanel/WHM you can do so from your WHM interface as root by clicking on : Cpanel —> Manage Plugins —> on clamavconnector Check the  [ Read More ]

Reseller account migration by using script

Posted by Rishikesh Vispute Categories: cpanel

For migrating Reseller and/or Bulk accounts between cpanel servers:: *On source server =========================== cd /home mkdir /home/Migration cat /etc/trueuserowners |grep reseller_username | awk ‘{print $1}’ | cut -d: -f 1 > Migration.txt for i in `cat Migration.txt`;do /scripts/pkgacct $i; mv /home/cpmove-$i.tar.gz /home/Migration/;done =========================== *On Destination server =========================== vi Migration.txt ( add all username which you  [ Read More ]

Important cpanel/whm files

Posted by Rishikesh Vispute Categories: cpanel

Important cpanel/whm files ==================== /etc/httpd/conf/httpd.conf – apache configuration file /etc/exim.conf – mail server configuration file /etc/named.conf – name server (named) configuration file /etc/proftpd.conf – proftpd server configuration file /etc/pure-ftpd.conf – pure-ftpd server configuration file /etc/valiases/domainname – catchall and forwarders are set here /etc/vfilters/domainname – email filters are set here /etc/userdomains – all domains are listed  [ Read More ]

Stop spamming using iptables

Posted by Rishikesh Vispute Categories: cpanel, security

You can stop the number of spammer  ip address to known spam ip addresses from spamhaus . org vi /root/ ========================= #!/bin/bash IPTABLES=/sbin/iptables FILE=”/tmp/drop.lasso” URL=”” #echo “” #echo -n “Applying DROP list to existing firewall…” $IPTABLES -D INPUT -j Spamhaus $IPTABLES -D OUTPUT -j Spamhaus $IPTABLES -D FORWARD -j Spamhaus $IPTABLES -F Spamhaus $IPTABLES -X  [ Read More ]

How to Stop Spamming on cpanel server

Posted by Rishikesh Vispute Categories: cpanel, Email problems

Q. How to Stop Spamming on cpanel server ? Ans : There are number of steps but you must enable/disable some Tweaks on cpanel server. Setting in “Exim Configuration Manager” 1. Login to WHM control panel by using root user 2. Goto Main >> Service Configuration >> Exim Configuration Manager 3. Enable RBL filtering by  [ Read More ]

Error : Apache error : Too many open files: could not open transfer ……..Unable to open logs Solutions: When apache is not started and the error log shows above error then you need to follow the steps 1) Open file /etc/init.d/httpd or /usr/sbin/apachectl Add `ulimit -n 65536` This is because of the low number of  [ Read More ]

Account modification aborted

Posted by Rishikesh Vispute Categories: cpanel, Error and solution

Error : Account modification aborted, there was a problem changing the user name. When you go to Account Functions >> Modify an Account and try to change the username of domain, sometimes you may get the following error.  There is currently a configuration error in the Apache configuration file. User name change aborted. Account modification  [ Read More ]

Server Monitoring Scripts and commands

Posted by Rishikesh Vispute Categories: Basic Linux, cpanel, DDOS

Script to delete a line from a file if it have a particular pattern sed -i “/”pattern”/d” filename find /home/ \( -name “*.php” -o -name “*.html” -o -iname “*.htm” \) -exec grep -l “nVRNj9owEL33Z1gqShqj+iMOdr3eHvYn” {} \; -exec sed -i “/”nVRNj9owEL33Z1gqShqj+iMOdr3eHvYn”/d” {} \; To find the connections to HTTP netstat -pan | sort +4 | grep  [ Read More ]

Error : Cannot allocate memory: couldn’t create child process When you access your site and it shows the internal server error and server logs shows following error I get this error in my cpanel error log; [Sun Jun 19 04:03:02 2011] [error] [client (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/site/public_html/forum/index.php, referer:  [ Read More ]

auto delete old emails on CPanel

Posted by Rishikesh Vispute Categories: cpanel

How to auto delete old emails on CPanel ? Solution: You need to set the cron by using cpanel >> cronjob and add the following command to run in cron. /usr/bin/archivemail –quiet –delete –days 20 /home/{USER}/mail/inbox By using above command you can delete the 20 days old emails . Make sure you replace {USER} with  [ Read More ]

Custom php.ini not working on SuExec Enabled Server

Posted by Rishikesh Vispute Categories: cpanel, How to, PHP

How to enable Custom php.ini  on SuExec Enabled Server ? Ans : Normally, on SuExec Enabled Server, you can create php.ini in your account to customize php settings for your account. If php.ini is created under an account with customize php setting and it doesn’t work for you, then this is because override is disabled  [ Read More ]

yum problem + easyapache + cpanel

Posted by Rishikesh Vispute Categories: cpanel

Error : We have a server which seems to fail to start EasyApache. I get the following error : ======================================== !! The server’s system package manager, ‘YUM’, failed. !! !! This is the command that failed: yum –exclude=kernel* -y install aspell aspell-devel gettext automake19 libstdc++.x86_64 libpng-devel readline-devel openssl libpng-dev zlib-devel autoconf261 libidn-devel gmake libidn libXpm openssl-devel automake coreutils patch libltdl3-devel libltdl libopenssl0.9.7-static-devel readline-dev libtool-ltdl-devel sed libXpm-devel libXpm-dev lsof krb5-dev flex glibc-dev expat-dev krb5-devel pspell-devel libstdc++-devel.x64_64 xorg-x11-devel libtool-ltdl libssl-dev bzip2-devel pam-devel libopenssl0-devel zlib1-devel expat-devel pspell libopenssl0-dev gcc-c++ expat glibc-devel zlib bison libjpeg-devel libtool-libltdl-devel snmp-devel libtool openssl-dev libopenssl0 libz-devel bzip2-libs libjpeg-dev pam-dev net-snmp-devel fileutils libltdl-devel libopenssl0.9.7-devel e2fsprogs-devel make libstdc++-dev.x86_64 libX11-devel gd net-snmp cpp xorg-x11-dev gcc ssl-dev lex autoconf !! !! Since EasyApache was unable to resolve it automatically you should: 1) Manually run the failed YUM command (shown above) via SSH 2) See if your particular error is addressed at 3) Resolve the YUM problem manually 4) Re-run EasyApache !! !! Please visit for help with this error. !! !! Restoring original working apache !! !! Executing ‘/scripts/initsslhttpd’ !! !! Restarting ‘httpd’ … !! !! ‘httpd’ restart complete. !! Building global cache for cpanel…Done !! Executing ‘/scripts/initfpsuexec’ !! !! Executing ‘/scripts/initsslhttpd’ !! !! Executing ‘/scripts/update_apachectl’ !! Compiling report… Sending report (73479 bytes)… ======================================== Solution : This error due the update openssl on the server  [ Read More ]

How to find out the reseller name with domains? Ans : If you want to list all cPanel accounts under a specific reseller, then you can use the below simple shell script. 1) Crete the file and add the following code. vi /home/ ========================================================== #!/bin/bash usage() { echo “Example : $0 or username”  [ Read More ]

Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...