Hundreds and thousands of web application & web sites are being created every single day. In order to run or process these kinds of web-based application huge chunks of server are required, and to power these servers 24/7 huge amount of electricity is consumed. It might be possible to buy/rent certain amount of server space, but it is very expensive to buy the entire server. So, the main objective of this project is to make even more highly efficient, completely inexpensive and portable pocket size web server.
1 | 2 | 3 |
---|---|---|
4 | 5. | 6 |
---|---|---|
7 | 8 | 9 |
---|---|---|
10 | 11 | 12 |
---|---|---|
Setting up Raspberry Pi 4 to serve a Django project using Apache2. .
Raspberry pi Operating system-- https://www.raspberrypi.org/downloads/raspberry-pi-os/
SD card formatter -- https://www.sdcard.org/downloads/formatter/
Flash Rapios os in Sd card -- https://www.balena.io/etcher/
-
Total wipeout of the SD Card:
-
Download SDFormatter.
-
Install it
-
Plugin MicroSD card.
-
Open SDFormatter
-
Select that specific card
-
Select "Quick Format".
-
Click "Format"
-
-
Download Raspberry-pi os .
-
Once downloaded, extract/unzip downloaded contents.
-
The file is about 3 Giga bytes.
-
-
Download and open Etcher
-
Run it and select the operating system image file.
-
Select the formatted SD card.
-
Click Burn to transfer Raspbian to the microSD card. Once complete, you can safely pull the card out
-
Insert the microSD card into Raspberry Pi
-
Power on Raspberry Pi
-
Turn Raspberry Pi on and ensure microSD card is inserted that contains the Raspbian Jessie Linux Operating System
-
Connect USB Keyboard, USB Mouse, and Monitor (through HDMI)
-
Connect Raspberry Pi to the Internet on your local network :
-
Open up
Terminal
and typeifconfig
. You should see the following result:You'll need to find this line
inet addr:
-
SSH into your Pi with
ssh pi@<ip>
:Mac/Linux Users (non-Pi linux):
- Open Open Terminal
- type
ssh pi@<IP>
- Accept the warning about fingerprint authenticity (if any)
- The default password is
raspberry
Windows Users:
- Download & Install PuTTY
- Open PuTTY
- type
ssh pi@<IP>
- Accept the warning about fingerprint authenticity
- The default password is
raspberry
Install Apache2 on raspberry-pi:
sudo apt-get install apache2 -y
sudo apt-get install libapache2-mod-wsgi-py3
Install Pip & Django:
sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install pip
sudo pip install django==X.Y.Z #where X.Y.Z is the version number
sudo pip install django==1.10.3
sudo pip install virtualenv
Enabling module wsgi
sudo a2enmod wsgi
Restart Apache service:
# Restart in two ways:
sudo apachectl restart
sudo service apache2 restart
Start Apache service :
# Start the Apache:
sudo apachectl start
sudo service apache2 start
Stop Apcahe Service :
# Stop Apache in two ways:
sudo apachectl stop
sudo service apache2 stop
mkdir pramitserver_env
cd pramitserver_env
pip install virtualenv
virtualenv .
cd Scripts
source activate
For Bulk installation copy it and paste it inside requirements.txt file and install it as pip3 install -r requirements.txt
Pillow==5.2.0
chardet==3.0.4
Django==2.1
django-crispy-forms==1.7.2
idna==2.7
requests==2.19.1
pytz==2018.5
certifi==2018.10.15
python manage.py runserver 0.0.0.0:8080
. | Table of Content: |
---|---|
Aim of Project | Project Objectives |
---|---|
Meeting Record | ER Diagram |
---|---|
Structure Chart | USe Case Diagram |
---|---|
Task Sheet | Gantt Chart |
---|---|
calendar | Timeline |
---|---|
Network Diagram | Network Diagram |
---|---|
Network Diagram | Network Diagram |
---|---|
Network Diagram | Resources Used |
---|---|
Requirement Catalogue "Overview" | Requirement Catalogue "Functional Requirement" |
---|---|
Requirement Catalogue "Non-Functional Requirement" | website Mockups |
---|---|
website Mockups | Raspberry pi server mockups |
---|---|
Arduino circuit diagram mockups | Arduino circuit diagram mockups |
---|---|
Product Development:Front-End ”Login-page” | Register |
---|---|
Home-Page | Back End |
---|---|
Product Development:“Users” Database Tables on db.Sqlite3 | Product Development: “Posts” Database Tables on db.Sqlite3 |
---|---|
Final Product | Final Product |
---|---|