Hosting a Website on The RPi

As detailed here, Pancake is lightweight built for RPi server software. And it’s pretty quick to get up and running.

First, we need to install php, so I went into the terminal and typed
sudo apt-get install php5-cli

Then, I navigated to Pancake’s website and downloaded the zip of the latest version (1.4.2) I saw by clicking on it, and just clicked the “save” button for it to go into the default download directory.

Then following shows how to install Pancake on an external drive that I have mounted on the RPi already. NOTE: It is not recommended to use the defaults for installation listed on Pancake’s website because it installs onto the SD Card from which the system boots. I’ve heard of people setting up wiki’s on their RPi’s, only to kill the SD card within a week. So, I will be installing in a directory on a spin drive: /media/USBHDD/web/. Now:

unzip pp3345-Pancake-* hitting tab at the * to autocomplete, and assuming you’ve got unzip installed on the RPi, and then enter in the following commands back to back:


cd ~

cd pp3345-Pancake-*

sudo mkdir /media/USBHDD/web/Pancake

sudo cp -r * /media/USBHDD/web/Pancake

cd /media/USBHDD/web/Pancake/sys

sudo chmod +x pancake.sh

cd ..

sudo cp init /etc/init.d/pancake

sudo chmod +x /etc/init.d/pancake

sudo update-rc.d pancake defaults enable

Now, pancake will start after you reboot, that is, pancake in the “default” installation location will start on reboot. But since we’ve installed pancake on an external drive and not on the internal SD card like default says, we will need to update the pancake script with:

cd /etc/init.d/

sudo nano pancake

And change the DAEMON=/media/USBHDD/web/Pancake/sys/pancake.sh line to whatever the installation path you chose was, down to the pancake.sh file.

To start it now: sudo /etc/init.d/pancake start

If you go to http://localhost/ on the RPi, you’ll see a “Welcome to Pancake Page”
Alternatively, you could type ifconfig to find out your RPi’s IP address, and got to http://192.168.1.100 (or whatever that IP address is) from another computer you have still within your local network.

What you see displayed in your browser is the file /media/USBHDD/web/Pancake/vhosts/default/index.html file.

So how do you get this visible to people outside your network, and for free? More on this later. And how do you put something up on here that you want to share? Also more on this later.

Published by ilzmaster

See www.ilyakavalerov.com .

One thought on “Hosting a Website on The RPi

  1. Hey there,

    Thanks for the awesome tutorial. I used it and got a server running on mine! Having a slight issue with down time though that I’m struggling to work out.

    I have a the no-ip system running on the pi to allow me to connect externally at shogran.no-ip.org

    The problem I have is that it seems to work fine for hours at a time and then randomly it cannot connect externally. Locally works, sometimes resetting the Pi will fix this but other times I just wait a few hours again and it seems to be back up. Any ideas why this is? Would traffic on the local network affect access?

    The pi is on an Ethernet connection directly connected to the router with a fixed IP, the power is direct from mains via a HTC USB wall charger and the hard drive containing the site is connected via a powered USB hub so power should not be an issue.

    Thanks in advance.

Leave a comment