Press "Enter" to skip to content

Tag: cpanel

cPanel: Simple Script To Backup Over rSync

If you are running a reasonably recent version of cPanel (I think v11 or later), you have the ability to run WHM backups over rsync instead of just FTP. This post, if it isn’t obvious, is intended for people with root access to their cPanel server.

So how do you do this?

Simple, configure the backups as per normal in WHM to backup your secondary hard drive or a set partition on your main hard drive. Then just add a script via the shell command line as “/scripts/postcpbackup” (open PuTTY, connect to the server, login, “su” to root if necessary if you didn’t login as root, type “nano -w /scripts/postcpbackup”) and past the following script:

#!/bin/sh
rsync -vrplogDth /backup/cpbackup/* username@backupserver:/backuplocation/

Replacing “/backup/cpbackup/” with the location of your “local backups” if you changed it from the default, “username” with the username of your rSync account, “backupserver” with the hostname/IP address of the backup server and “backuplocation” of the place to store the backups. (It’s CTRL+X to exit nano by the way).

You then just need to make it executable by running “chmod a+x /scripts/postcpbackup” and you are done!

Hope it helps someone!

cPanel: cPanel 11 and WebDav

As some of you may be aware, the new version of cPanel (version 11) now supports a technology called “WebDav” (known as “Web Disks” within cPanel).

Basically this allows you to setup your cPanel web hosting account as an additional drive on your machine – making the uploading and publishing of files a lot easier.

However, server administrators will first need to enable the TCP ports 2077 and 2078 in and outbound for this to work correctly (don’t forget to restart/reload the firewall). Once that’s done, your customers should be able to login to their cPanel control panel and either select the new fancy “Getting Started” wizard or “Web Disks->Access Web Disk” to setup a link.

Using cPanel’s handy “Auto configuration” tool is useful – but you may hit the same problem I did when I downloaded the installer .vbs file to my Windows XP machine via Firefox. Attempting to open the file came up with the error “Windows Script Host access is disabled on this machine. Contact your administrator for details”. Needless to say – I am the administrator and if I’ve disabled something like that in the past, it’s probably for a very good reason!

So – how can we manually configure cPanel’s WebDav uploading tool manually if the automatic method fails?….

Techy: Dealing with .tar.gz, .gz and .zip files on a cPanel Server

Many of you with cPanel web hosting accounts would have needed to upload files to a cPanel server which were in .tar.gz, .gz or .zip files (these are compressed archives).

And I bet many of you would like to have been able to upload the archives to the server “as is” (to save decompressing them on your machine and then having to slowly upload each and every file).

But did you know there is actually a “cheat” for this?

Just upload the files to your webspace via FTP (or via the cPanel File Manager) as per usual. Then login to your cPanel control panel and select “File Manager” (if you are running on the new x3 theme with cPanel 11, it doesn’t matter if you select “File Manager” or “Legacy File Manager”). Select the archive you uploaded, and then click “Decompress” from the top menu (on the new file manager) or “Extract from Archive” from the right hand menu (on the old file manager) and there you go.

Your files are now decompressed on the server quickly and simply!

Techy: New Hosting Solutions

A few months back, my blog (and websites) were relocated to another server solution. Why? Well, I had originally upgraded from a Positive Internet shared hosting account to their “Dolphin” Dedicated Server as I was using up a few too many resources. I then switched to EV1Servers (now part of The Planet) as they were much cheaper (being US based). When they paid the “Linux License fee” to SCO Scum, I ditched them and went to The Planet. Once they started going downhill support wise, I then moved down to a VPS with UnixShell.

However, I had big plans for a site which I’ve now ditched and the VPS just wasn’t big enough – so I upgraded for nearly a year to a Dedicated Server with Softlayer. But that was posing too expensive for my needs (since I didn’t really need a Dual Processor 4Gb 2x250Gb machine for my sites!). So I’ve now switched to the UK VPS hosting outfit Memset on their VPS “Miniserver 512” package.

For that Xen powered VPS, I’m getting the Equivalent CPU of a Pentium 4 2.4 GHz processor, a minimum of 512Mb RAM, 40Gb disc space, 80Gb bandwidth allowance on a 10Mbps connection (I could have gone for an unmetered 5Mbps connection, but I prefer to keep an eye on my bandwidth usage), 2 IP addresses, Fedora cPanel/Fantastico for a total of £76.32 per month.

Support, when I’ve needed them (which has only been to request the secondary IP address which isn’t setup by default and to correct a licensing issue with Fantastico) has been quite responsive and good (although I do try and supply all relevant details – including error messages – when I do contact support teams as I know what it’s like to have too little information!). The VPS account seems to be reliable and (and this will make my other half happy) – they are also “Carbon Neutral”.

If you’re interested – then give them a call or email and say you were referred by user “beebwaa” and you’ll be granted a 10% discount off the Miniserver Virtual Machine or Fully Dedicated Server packages.

Techy: Outdated Coppermine Finder

Whilst on the subject of outdated cPanel based things, I’ve just put together a quick little script to scan a cPanel based webserver for outdated Coppermine Photo Gallery installations.

As the notes state, the script isn’t pretty, it isn’t efficient, but it works.

Comments/feedback are appreciated.
Coppermine Gallery Outdated installation checker v0.01

Set $disableandemail to 1 to disable the scripts and email the users.