Never underestimate the miniscule, $35 Raspberry Pi. Although it’s marketed as an experimental machine aimed at helping you learn to code, there’s nothing entry-level about its capabilities.
You could use your raspberry pi to host small php websites and web apps. For that you need to simply setup a Apache web server.
1.) Router – You would need a router and a internet connection from ISP. If you have a static IP that would be too good.
2.) Connecting Pi to Network – You need to have a wireless adapter or an ethernet cable to connect your Pi to router.
3.) Raspbian O.S – I would recommend using Raspbian Wheezy OS which could be downloaded from here.
4.) Setting Up SSH – You need to setup SSH on Pi . You could see my tutorial for that here.
Updating Your Pi.
1.) SSH into your Pi Using Putty ( Windows ) . ‘
Installing Nginx Web Server
1.) First install the
nginx package .
2.) Type :
sudo apt-get install nginx
3.) Then create a new directory for web apps that is the root directory .
4.) Type :
sudo mkdir /var/www
5.) Now type
sudo nano /etc/nginx/sites-available/default to edit the file.
6.) Find this part and make the changes accordingly as shown.
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
#listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
index index.html index.htm;
# Make site accessible from http://localhost/
1.) Create a file called
For that type in :
sudo nano /var/www/index.html
And create a sample page –
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Raspberry Web Server</title> </head> <body> <p><h1 align="center">Welcome,<br />... your Raspberry Web Server is ready!! </h1> </body> </html>
sudo service nginx restart Now enter the IP Address Of your Pi into web browser.