Tag Archives: tutorial

Secure FTP (SFTP) in Dreamweaver using SSH tunnelling – No shared keys

It’ a bit of a bugbear with many people that Adobe Dreamweaver CS3, CS4, and I think CS5, although supporting SFTP using password authentication, won’t work with SSH public/private keypairs. It’s far more secure to use SSH with a public/private key pair than with straightforward password authentication.

Why is SFTP important?

FTP is about as secure as SMTP email, or Telnet – i.e. every man and his dog can listen in and before you know it, your (not so) local porn pedlars have replaced your website with something sensational. It amazes me constantly that companies that install SSL certificates are happy for their web developers to connect to the web server using plain old FTP, often uploading files containing critical passwords to databases and other external systems.

Securing FTP using SSH tunneling

Read More…

Bash Script to place 404.shtml and favicon.ico in home directories

OK, so you’ve noticed how your error_log files are just full to busting with 404 errors for favicon.ico and 404.shtml? Annoying isn’t it, especially when you have a lot of activity on a server, as these files can mushroom out of control.

This script will go through each user account’s home directory, and where it doesn’t find then, it will place a copy of 404.shtml and favicon.ico for you. Read More…

Bash Script to scan folders and PHP files for bad permissions

This script will run through all Cpanel user account home directories and recursively do the following:

  • check for directories that have the write bit set for group(g) or other(o) – and reset any found to 755 permissions.
  • check for any files with the .php extension and that have any access bits at all allowed for other (o), write/execute bits set for group(g), or execute bit set for user(u) – and reset any found to 640 permissions.

It is quite easy to modify for your own purposes, but these permissions are generally a good starting point when on a server running PHP with the suPHP module (THIS WILL BREAK EVERYTHING IF YOU ARE RUNNING PHP AS DSO). Read More…

Applying RewriteCond to Multiple RewriteRule in .htaccess

Just a quick hints and tips update for today. On a number of my sites I have been using mod_rewrite to produce SEO friendly URLs. e.g. :

mysite.com/widgets/my-big-widget

instead of something like:

mysite.com/index.php?cat=4&function=show&prod=456

This is done using RewriteCond and RewriteRule statements in .htaccess. However, normally RewriteCond only applies to the RewriteRule immediately following it. This means we end up with horrible repetitive blocks of code in our .htaccess files. In this article I’ll show you how to rationalise this problem and shorten your code! Read More…

Adding multiple forwarders quickly in Cpanel/WHM

I often have to add several forwarders at a time to various accounts, and I thought I would just share this little tip for anyone who is doing things the hard way via the control panel.

The forwarders and default routing instructions are usually stored in a directory /etc/valiases

Each domain has a file, which contains it’s routing information, the format of the file is generally:

sourceaddress@thisdomain.co.uk: destination@otherdomain.co.uk
*: :fail: No such user here

The last line sorts out the default routing. The asterisk representing a wildcard address, the destination being :fail: and the failure message returned at SMTP time is “No such user here”.

You can add as many lines as you wish using the editor of your choice. Enjoy!

Color or Colour Management Problems and Firefox 3.5

I’m putting this here to help anyone else out there who uses a colour managed workflow and has found problems with Firefox 3.5. This is primarily for people using Mac OSX, but the same principles will apply to Windows users. Read More…