cPanel Apache Tuning
One of the first things I do is run /scripts/easyapache and rebuild my PHP / Apache configuration.
I usually select Apache 2.2 and PHP 5.2.9. At the time of writing I stay away from the 5.3 versions as they aren't supported by programs and programmers enough yet.
Although this guide was originally inspired from a cPanel install, its Apache specific and doesn't require cPanel.
Installing memcached on CentOS/cPanel
memcached a (distributed) memory object caching system vital if your running a HA Linux* setup or a web farm. Or even if you need fast as **** caching for an application.
Consider it extra memory for your server, so you can cache more, for example large arrays, SQL queries and other stuff!
* Actually I've discovered there are memcached extensions for Java, C & .NET. Wow, it just grew up!
[Snippet] Tuning / Tweaking MySQL
There are a couple of good scripts out there that will help you to tune your mysql usage for better perfomance. I’ve used both of these, and they are very intuative. Personally, I prefer the latter, however, I still use both for tweaking.
tuning-primer
OK, so not the most original blog post ever, but useful all the same.
“This script takes information from “SHOW STATUS LIKE…” and “SHOW VARIABLES LIKE…”
to produce sane recomendations for tuning server variables.”
PCI Compliance – Disable SSLv2 and Weak Ciphers
Section 4.1 of the the Payment Card Industry Data Security Standard (PCI-DSS) v1.2, merchants handling credit card data are required to “use strong cryptography and security protocols such as SSL/TLS or IPSEC to safeguard sensitive cardholder data during transmission over open, public networks.”
Apache redirects based on IP Address/Subnet
Ever needed to redirect a source IP address or source subnet in apache?
Why? Redirect annoying spam bots, users or other individuals away from your blog for example.
Slam the following code into your .htaccess file or VirtualHost Directive.
Mini WHMCS SagePay Terminal Mod
We have a few customers that phone and pay WHMCS generated invoices over the phone - we now use the SagePay Virtual Terminal.
So I added a link on the Client Summary page with a direct link. Simple and silly I know, but kinda useful.
MySQL Root Password on cPanel
Wheres the MySQL root password in cPanel installs? Easy, look in /root/.my.cnf
MySQL: Can’t get hostname for your address
Can''t remotely login to your shiney, new MySQL server due “Can’t get hostname for your address” or "Can't get hostname for your address". Another random MySQL error message.
Simply put, if you look in the logs, MySQL cannot lookup your IP/hostname. Its that simple.
Is your DNS broke? Or just on a Local Area Network with no DNS anyway?
Just add skip-name-resolve option to the [mysqld] section of your my.cnf/my.ini
[Snippet] Create a large file in Linux
Need to create a large file? For disk speed tests? Or space tests?
- dd if=/dev/zero of=your.big.file bs=1MB count=500
This will create a 500Mb file in your current directory called your.big.file
- 500+0 records in
- 500+0 records out
- 500000000 bytes (500 MB) copied, 4.08855 seconds, 122 MB/s



