Do you need a simple web server at home? If you have a low budget, you don't need a supercomputer and you don't want to buy a cloud virtual server account, this is the solution that's right for you.
A super combo webserver combination of instruments:
- Rapberry Pi: the hardware (the body)
- Python: the webserver language (the communication)
- Tornado Web Server: the webserver (the heart)
- NGinx: the webserver (the brain)
- MongoDB: the database (the memory)
1. Prepare your Rapberry Pi (with SD card 16GB class10 or greater)
Download the raspberry pi OS following this guide here:
IMPORTANT: prevent the Raspberry pi SHOCK overheating by installing a heat sink cooler and a 5v fan.
Install the raspbian os (easier and faster than the others). Connect keyboard, ethernet (or wifi), mouse and monitor. Expand the partition and set the current location for the timezone from the raspconfig menu, and startx (if you want to go in windows style).
Open terminal window and make a:
- sudo apt-get update
- sudo apt-get upgrade
Install SSH package to take control from remote (if not present):
- sudo apt-get install ssh
You should now access to the raspberry from your pc via ssh. For windows bash link command-console you can use putty.exe
Create a user with the adduser command or use pi default user: pi@raspberry
2. Check Python in your rasp
2. Check Python in your rasp
type python in your shell. If you get:
Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
it's ok, and go to the step 3. Otherwise install python 2.7 with sudo apt-get install python. Check python after installation and go to the step 3.
3. Install Tornado Web Server
Follow this guide:http://niltoid.com/blog/raspberry-pi-arduino-tornado/
Here the setup part:
First things first, install Tornado on your Raspberry Pi:1. Good thing to do before every install – update agt-get and installed packages
2. Install easy_install and pip (which are Python package managers)
3. Update your easy_install (and pip) package definitions
4. Now install Tornado using pip
To make sure everything works, create a file named “server.py” containing the following code (taken from Tornado’s site), and run it from terminal using the command “python server.py”
Now on a separate computer on the same network, navigate your browser to http://raspberrypi:8080 (or use the IP address for example 192.168.1.7:8080). You should see “Hello, world” if everything goes right.
2. Install easy_install and pip (which are Python package managers)
3. Update your easy_install (and pip) package definitions
4. Now install Tornado using pip
4. Install NGinx (optional - increase performances)
4. Install NGinx (optional - increase performances)
Open a terminal and execute:
sudo apt-get install nginx
setup nginx... (coming soon..).
5. Install and setup MongoDB

Follow this guide http://mongopi.wordpress.com/2012/11/25/installation/ from the point:
5. Install and setup MongoDB
Follow this guide http://mongopi.wordpress.com/2012/11/25/installation/ from the point:
sudo apt-get install git-core build-essential scons libpcre++-dev xulrunner-dev libboost-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev
Check for any update to these
$ sudo apt-get update
Pull the files from this fork on Github:
git clone git://github.com/RickP/mongopi.git
Build it (this took about four hours!):
cd mongopi
scons
you’ll see lots of these lines as the build progresses for several hours…
{standard input}: nnnnn: Warning: swp{b} use is deprecated for this architecture
Install it (this took about 3 hours)
$ sudo scons --prefix=/opt/mongo install
This will install mongo in /opt/mongo. Takes several hours. To get other programs to see it, add this dir to your $PATH:
Check the filepath where mongo is executed
pwd = present working directory
$ PATH=$PATH:/opt/mongo/bin/
$ export PATH
While you’re waiting for everything to install, take a look at the primer/tutorial on MongoDB on CPAN
sudo apt-get install git-core build-essential scons libpcre++-dev xulrunner-dev libboost-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev
$ sudo apt-get update
git clone git://github.com/RickP/mongopi.git
cd mongopi
scons
{standard input}: nnnnn: Warning: swp{b} use is deprecated for this architecture
$ sudo scons --prefix=/opt/mongo install
pwd = present working directory
$ PATH=$PATH:/opt/mongo/bin/
$ export PATH
No comments:
Post a Comment