Pages

Thursday, March 28, 2013

Fixing mod_rewrite and .htaccess on GoDaddy Hosting

I recently launched a new website on GoDaddy shared hosting. The website required mod_rewrite for SEO-friendly URLs. GoDaddy provides mod_rewrite but every time I tried to hit a two-deep URL, I would get a 404 error. Here's what I had:

# Mod Rewrite
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 

Increase PHP Memory Allowance Using ini_set()

On rare occasion, I need to up the memory allowed for PHP. Usually it's when I deal with large files and don't necessarily care about optimizing the file reading process but simply getting the file opened. There's an easy way to increase to amount of memory allowed to PHP right in your script:

ini_set('memory_limit','16M');

Wednesday, March 27, 2013

How to remove cPanel Clean Backups Plug-in

There is an uninstall script packaged with the clean backups installer. Optionally you can remove the following directories:

/var/cpanel/cleanbackups/
/usr/local/cpanel/whostmgr/docroot/cleanbackups/
/usr/local/cpanel/whostmgr/docroot/cleanbackups/addon_cleanbackups.cgi

How to install Clean Backups plug-in for cPanel/WHM

cPanels backup script will not remove backups for accounts that no longer exist and these backups will remain on the backup drive until removed. This plug-in gives administrators the ability to clean up their backup directory by setting how long they want to keep backups for accounts that no longer exist and removing those backups when they expire. The script can be run by hand or after automatically after the cPanel backup script finishes.

How to remove Account DNS Check

An uninstall script is included with the installation, you just run the self exacting installer with the command --noexec and then runt ./script/uninstall as follows:

#wget http://www.ndchost.com/cpanel-whm/plugins/accountdnscheck/download.php
# sh latest-accountdnscheck --noexec
# cd installd-accountdnscheck/scripts/
# sh uninstall

or run

/bin/rm -vrf /var/cpanel/accountdnscheck
/bin/rm -vrf /usr/local/cpanel/whostmgr/docroot/accountdnscheck
/bin/rm -vf /usr/local/cpanel/whostmgr/docroot/cgi/addon_acountdnscheck.cgi

How to install Account DNS Check plugin for cPanel/WHM

This plugin gives administrators the ability to easily get a list of domains on their cPanel/WHM server that do not resolve to the correct IP. This is very helpful when doing server to server transfers, or auditing a server to remove old accounts. You can run this script and easily see a list of domains that are pointing to the old server or customers who are no longer hosted on their server.

Installation Instructions