Random Linux

Linux, video games and web hosting

WHM doesn’t currently have a way to clear out the modsec hit lists under ModSecurity Tools, but it is possible to clear that out by moving the existing database out of the way and running the cPanel script to create a new, empty one. These commands will achieve that:

# mv /var/cpanel/modsec/modsec.sqlite /var/cpanel/modsec/modsec.sqlite-bak
# /scripts/setup_modsec_db

After that is done, the list in WHM will no longer show any hits.

June 18th, 2017

Posted In: cPanel Hosting

Tags: , , ,

Leave a Comment

There are times when you try to update cPanel from the UI and it will fail or will hang.  When this happens, you are able to force the update from the comamnd line.   SSH into the server as root, then run the following command.

/scripts/upcp --force

This will show you what is going on will normally fix any update issues that you were having, but will also help you to troubleshoot any problem that may come up with the update.

January 21st, 2011

Posted In: cPanel Hosting, How To

Tags: ,

Leave a Comment

If you have ever used cPanel, there may have been a time that a DNS zone was missing even though your domain was already added on.  If you have root access, you are able to fix this by using the adddns script.  This is located in the /scripts directory, but only if you are using cPanel.  So to use this,  you will define the domain and the IP that it is for.

/scripts/adddns --domain=site.com --ip=123.456.7.89

That will create a dns zone for the domain site.com with the address on the server of 123.456.7.89.  You can then check /var/named/site.com.db to make sure that it created successfully.

January 18th, 2011

Posted In: cPanel Hosting, How To

Tags: ,

Leave a Comment

You are able to create a backup of a cPanel user’s account by using the pkgacct command in the /scripts directory that can be found on any server that has cPanel installed.  If you needed to create a backup of the account for a user named user1, you would need to be in a root shell, then run the following command.

/scripts/pkgacct user1

Unfortunately, cPanel backups are limited to 4GB, but using the command line, you are able to surpass that limitation and force it to back up the account by using the following:

/scripts/pkgacct user1 --skip-limit-flag

Adding on the –skip-limit flag will allow it to skip the 4GB limit and create the backup.  Then, when the script is finished and the backup has completed, it will tell you the path that it placed the backup and you can move it to whichever directory you would like.  If you are creating this for a user that does not have root access, you will want to put it in their home directory as well as chown it to the user so that they are able to download the backup as well.

January 18th, 2011

Posted In: cPanel Hosting, How To

Tags: ,

Leave a Comment

If you are hosting with cPanel and had a domain removed and would like to find out when, you can check in the cPanel access logs like this:

~]#grep cpaneluser /usr/local/cpanel/logs/access_log |grep domain|grep

dodeldomainconfirm

Also, using the same method, you can find out when a subdomain was deleted

~]#grep cpaneluser /usr/local/cpanel/logs/access_log |grep subdomain|grep

dodeldomainconfirm

Be sure to replace cpanel user with the cpanel username that owned the domain and domain or subdomain with the actual domain or subdomain that you are looking for.

January 13th, 2011

Posted In: cPanel Hosting

Tags: ,

Leave a Comment