Websites | Photography | Video Editing | 3D Animations

From the Blog

Jul
17
Posted by Paul Costan at 8:15 am

The other day I need to migrate files over to my new NAS, to do this I had to SSH in to the box and run a SCP command to copy over files. But at the sametime I wanted to keep their timestamp. To do this you need to run the following command

First ssh into your box and go the fold where you want to copy files to then run this command:

$ scp -r [username]@[ip-address]:[path-of-files] .

if you would like to keep timestamp run this command. notice I added ‘p’ after the ‘-r’.

$ scp -rp [username]@[ip-address]:[path-of-files] .

‘-r’ is recursive ‘p’ is for preserve (file details).

There are a few ways to optimise your hosted WordPress sites, for example using ‘Quick Cache’ or ‘Mimify’ plugins and many more which will help increase your site performance.

But how about your images? Your WordPress site images can slow down your site if you have lots stored on hosted server. Well I have come up with an quick and easy solution using Dropbox as your CDN. Serving your ‘uploads’ folder from Dropbox ‘Public’ folder. This way helping reduce your upload bandwidth BIG time!

20110702-235933.jpg

This is how:

1. Install Dropbox app on your web server, it does not matter which setup you have Linux, windows etc. But you will get the idea what we’re doing here.

2. Next Cut or Move ‘uploads’ folder (/wp-content/uploads) to your Dropbox ‘Public’ folder (/Public/website-name/uploads)

3.Here is the clever bit… Create a ‘symlink’ from your (/Public/website-name/uploads) to your WordPress (/wp-content/uploads)

Linux command line Example:

$ cd /var/www/html/your-wordpress-folder/wp-content/

$ ln -s /Dropbox/Public/website-name/uploads uploads

For Windows you will need to install ‘Link Shell Extension‘. Once installed, creating a symlink is pretty straight forward.

4. Next go to your Dropbox account online and navigate to your ‘Public’ folder and highlight any file. On the right hand side there is a small downward arrow. Click on it and select ‘copy public Link’

20110616-202033.jpg

5. Now login in to your WordPress admin and go to ‘Settings’ > ‘Media’ and scroll down to ‘Uploads Files’.

20110616-204358.jpg

Now paste your dropbox public link to ‘Full URL path to files’ box field, with the right path… for example:

‘http://dl.dropbox.com/u/9721300/website-name/uploads’

6. And finally hit save and you’re done. You may need to clear your site cache and eventually all image paths should point Dropbox CDN. From now on creating a new post, all images will sync and served from Dropbox.

Enjoy! I hope this has helped speed up your site.