Raspberry Pi Web Server

Having spent some of the Christmas holiday reading up on HTML5, CSS3 and Javascript I thought about putting it all together. I’ve always liked the idea of a ‘homepage’ on my home network but the cost of having a dedicated computer server (let alone the annual cost of the electricity). So I decided to set one up using my Raspberry Pi.

The Pi is connected to my home router (and as it’s behind that firewall will only serve the devices logged onto my own router). It has an ethernet lead to the router and a 5v USB power adapter. All control is via Secure Shell (SSH) and the command line from my windows PC (which is running PuTTY) so no need for an extra monitor, keyboard or mouse. The Pi only consumes a few Watts of electricity.

I installed Apache2 and the PHP package for Apache using the sudo apt-get command. I can now nagivate to the installed directory on my Pi (/var/www/html) and write some HTML or PHP code to see what is possible. Two great learning sites are www.w3schools.com and http://htmldog.com/.

The examples from those sites can be selected, copied and pasted into the text editor on the Raspberry Pi using a right click…..I use Nano text editor.

It really is as simple as that !

Then just work thought those examples trying out forms and other dynamic content.

Next I plan to install MySQL on the Pi so I can save the information from the client/browser and act on it at a later date.


sudo apt-get update

sudo apt-get install apache2 -y

sudo apt-get install php5 libapache2-mod-php5 -y



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s