Posts Tagged ‘whm’

cPanel: Simple Script To Backup Over rSync

August 20th, 2007

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:

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

May 14th, 2007

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?….
» Read more: cPanel: cPanel 11 and WebDav

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

May 13th, 2007

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: Handy Security Tips

August 9th, 2003

If you have a new box you want to use for web hosting etc, then here are just a few of the things you can do to help make the box secure. This list is not comprehensive, nor do I take any responsibility for any harm that may come to your server if you use any of these commands. These are mainly “quick reference” commands in case I need them in a rush (for example: we’ve put a box online and need it at least “semi-secured” – we’ll spend a bit more time securing a box then just these commands, but they’re a good starting point)

Run commands as root/su:

Disable telnet
Modify /etc/xinetd.d/telnet (could also be /etc/xinetd.d/telnet and change disable=no to disable=yes

Disable code compilation
Add compiler group: /usr/sbin/groupadd compiler
Move to correct directory: cd /usr/bin
Make most common compilers part of the compiler group chgrp compiler *cc*
chgrp compiler *++*
chgrp compiler ld
chgrp compiler as

Set access on mysqlaccess chgrp root mysqlaccess
Set permissions chmod 750 *cc*
chmod 750 *++*
chmod 750 ld
chmod 750 as
chmod 755 mysqlaccess

To add users to the group, modify /etc/group and change compiler:x:123: to compiler:x:123:username1,username2 (‘123’ will be different on your installation)
» Read more: Techy: Handy Security Tips

%d bloggers like this: