Monday, 20 May 2013

Creating A Website On the Pi

I've been spending a bit of time learning some of the skills needed to create a website.

A bit of research told me that I needed to know "basic" HTML and CSS to begin with. Then, when I'd got familiar with those, I could make my site more dynamic using Javascript and PHP.

I'm using the HTML Dog tutorials to get me up to speed on HTML, CSS, and Javascript. They're excellent. They come in bite-size chunks, get straight to the point, giving you all the skills you need, and they even have a sense of humour.

So far, I've done the basic and intermediate levels for both HTML and CSS and found it a pretty quick and painless process. Off the back of this, I can now put together a convincing looking website, complete with images, links, navigation bars, headers and footers.

I used a fake family news site as a prototype to practise the skills I'd learnt. The idea worked well - Forcing me to work through a number of problems that wouldn't have occured to me otherwise.

The starting place for your web pages is the index.html file in the /var/www folder. Apparently that file's more or less the standard place for most websites.

I found a really useful program for my web deveopment work called puTTY. It allows you to connect to your Pi remotely from a Windows PC. For example, I can connect to the Pi from my netbook, login, then edit the web pages. I can even copy & paste stuff from my netbook to the Pi using my right mouse button. More about puTTY here.

If you want to develop your web code on a PC then move it across to the Pi, use WinSCP (See here). By the way, you can't copy files directly to /var/www unless you change the ownership of this folder using: sudo chown -R pi /var/www