tips

Setting up Git on WebFaction

I recently setup some web hosting with WebFaction for a client. While developing the website locally I have been using git as my version control system, because I’m hip and trendy.

Since my development machine is a laptop (and often behind a NAT router), it would be easier for me to push to the server rather than pulling them since the server’s details will remain constant while mine are likely to change frequently. While merely setting up git on WebFaction is simple, there are a couple of gotchas if you wish to be able to push to the server.

While I have tried to make each step as clear as possible, I realise that I’m not very good at making clear instructions. This is not a git tutorial either so it may perhaps be a bit confusing to those with no prior experience of using it.

(more…)

Posted in git, hosting, tips 9 Comments »

Auto-Update Wordpress With SFTP

Installing a Wordpress plugin with SFTP

Installing a Wordpress plugin with SFTP

Like me, you may use SFTP instead of FTP to upload files to your server. Like me, you may also use Wordpress to blog about things. Like me, you may have been a bit disappointed to see that you couldn’t auto-update Wordpress or install plugins through the dashboard as it appeared to only support FTP and FTPS. If none of this made any sense then you might want to check out What is SFTP and why use it? below.

Yet don’t be disheartened O reader for it is a little known fact that Wordpress does allow one to use SFTP! To do this you need to have the appropriate SSH extension for PHP. Luckily Kevin van Zonneveld has written a lovely guide on how one does this. He does note that a new version of libssh2 has been released and I can confirm that it works so when you reach that section you might want to use the following steps instead:

wget http://surfnet.dl.sourceforge.net/sourceforge/libssh2/libssh2-1.0.tar.gz
tar -zxvf libssh2-1.0.tar.gz
cd libssh2-1.0/

After you install libssh, remember to install the PECL module:

pecl install -f ssh2

and modify your php.ini (usually in /etc/php5/apache2/) to include the following beneath Dynamic Extensions

extension=ssh2.so

You’ll probably need to restart Apache afterwards:

/etc/init.d/apache2 restart

Now when you visit the auto-update page you will have a third option to use SSH, as shown in the image above and your Wordpress SFTP days have begun!

What is SFTP and why use it?

SFTP is a replacement for FTP which is much more secure. It is based on SSH and is not to be confused with FTPS (despite similar names, the two are incompatible). SFTP encrypts all the data and commands that are sent to and from the server and provides protection against a number of network security risks. FTP, on the other hand, leaves everything – username, password, data, etc. etc. – in plaintext and so is susceptible to man in the middle attacks.

Needless to say, I’d highly recommend everyone use SFTP and disable their FTP logins.

What is FTPS?

FTPS is FTP running over SSL-enabled FTP servers. This is similar to the difference between HTTP and HTTPS. With FTPS, all the control data (e.g. authentication) is encrypted but the data may not be. This is because if you have already encrypted the data then there is no point having FTPS encrypt it again. Of course, if the data is in plaintext then you can ask FTPS to encrypt it.

The main problem with FTPS is that you need an SSL certificate plus it requires a secondary channel for the data which may cause problems with some firewalls. Of course, SFTP isn’t perfect as well but it’s the one I prefer.

Happy secure data transferring!

Tags: , ,
Posted in tips 23 Comments »

Experts Exchange

Experts Exchange

If you are a techy person then it is likely that you have used Google (or another search engine) to search for techy solutions to techy problems you are having. It is therefore likely that you have come across the website Experts Exchange as it seems to rate quite highly in search engines for a wide array of topics. You may then be frustrated to find that the answer to your question appears to not be on the page you were directed to and that you are required to not only sign up but actually pay for said solution!

Jings crivens! Paying for something on the interwebs! Heaven forbid such a thing!

Yet here’s Tom’s Top Tip for the day: just keep scrolling down. Scroll past the hidden answers. Scroll past the adverts. Scroll past the topic list. Scroll as if your life depended on it. If you scroll enough then you shall be rewarded with the answers to your question.

I highly doubt that I am the first to expouse this knowledge but I do know that a number of my friends did not know this nugget of wisdom and so would constantly bypass any Experts Exchange results returned by their search engine of choice.

I’m totally perplexed as to why people choose to use that website though. There are any number of websites dedicated to answering your questions and the vast majority are free and don’t require you to scroll past craploads of junk. Can anyone shed a light?

Tags: ,
Posted in tips No Comments »