Global Redirect of all urls from one domain to another in .htaccess Often we find ourselves needing to redirect all traffic from one domain, no matter what page is hit, to a completely different domain. E.g. www.olddomain.com/whatever.html www.olddomain.com/somethingelse.php www.olddomain.com/anotherthing.htm Would all need to redirect to: www.some-other-domain.com...
Server Administration
How to fix CVE-2016-6662 on cPanel / WHM
CVE-2016-6662 - Remote Root Code Execution / Privilege Escalation (0day exploit) A new 0-day exploit has been announced for MySQL that can result in remote code execution or privilege escalation. Apparently, this exploit was announced to Oracle, the owners of MySQL more than 40 days ago and a fix has not yet been released. You can read about it in greater detail...
How to restrict zone transfers for PCI compliance in WHM – CVE-1999-0532
Recently we had to assist a client with a server that needed to become PCI compliant. One of the issues was: DNS Zone Transfer Allowed, CVE-1999-0532 and the server was running Centos 6 and WHM / cPanel. Scanning vendors fail this because "unrestricted zone transfers" violate PCI DSS and are considered automatic failing conditions. Now, there is not a control for...
SSH Command for viewing all running processes
The following is a quick command for viewing all of the current running processes in a SSH command session / window: ps -ef
How to find large files on a server via SSH
Continuing our series on handy commands to know os one that helps you find large files on your server via SSH. SSH command for finding files larger than a certain file size The command for this is quite easy, for our example we will assume you want to find all files that are larger than 1 GB in size and geta list you can use. Step one: Go into your SSH session and...
How to white list an IP address in Mod Security
Often you will have a ruleset in Mod_Security that you want to override for a specific IP address or within a certain path in a website or an application. To do this you need to locate or create your Mod_Security white list file, then add this line: SecRule REMOTE_ADDR "^192.168.1.1$" phase:1,log,allow,ctl:ruleEngine=Off,id:999999 ...where id:999999 is the ID of the...
How to increase PHP timeout values in Apache and NGNIX
There comes a time when you really need to increase the amount of time it takes before your server stops a particular PHP process from continuing. This is called PHP session "timeout". Under normal conditions you want to keep these values low so your connections are as efficient as possible. These limits are also in place to prevent poorly written scripts from...
How to exclude a sub directory from .htaccess 301 redirects
So, here's something that comes up all the time - you have a sub-directory you want to exclude from a global .htaccess redirect. Often this is due to installing another application within the document-relative paths of an existing website or web application. e.g. You want to install a copy of WordPress within an existing Drupal website. or maybe you have an...
CS-Cart upgrade settings for your server.
One of the problems that you may have while upgrading CS-Cart is that the upgrade inexplicably fails during the upgrade process. If you are lucky, you will get a error trace umped to a file or the screen. If not, it may just silently fail in the background or freeze up. This is certainly no fun. There's a number of different carts that experience this, so it is not...
How to export all databases in MYSQL via SSH command line dump
The following is a script you can use to dump all of your databases that the user, in this case "backup" has access to. You can save this as a script file and then run it using a CRON job in your control panel. Note - this command is not doing cleanup of the archives it creates so you will want to rotate the backups or other use it for specific purposes - such as...








