A Noob's Guide to Hosting a Website on Banana Pi with Apache2

Maybe you are a nub, maybe you are not, it doesn't matter, let's host a website on Banana Pi.


My website can be found http://projectbananapi.ddns.net/ (it is hosted on Banana Pi)



Overview

Apache2 is  a software that can host websites! Yay! And with a Banana Pi, we can host multiple websites from your home for free. This guide will walk you through on how to:
  • Install Apache2 on Banana Pi
  • Build a website
  • Upload a website
  • Configuring settings for a website or multiple sites
  • Setting up an URL for a website
  • Setting up Port Forwarding for a website
  • Going to your website on Chrome

Installing Apache2 on Banana Pi

This step is not hard and I think you can even do it without a brain! I have wrote previous guides on how to do this and I will share it with you here.

To set up Bananian

To set up Apache2

Building a Website

Building a website is fun and might be just a little challenging for those who lost their brains, but I think it can be managed without brains also!

There are many different programs and formats for a website and I recommend a basic html website with css and javascript. It is the foundations of most websites and it has unlimited potential. (unless you want to make a forum or link databases)

The Weebly Way

If you have no brains, type "weebly" in a search bar and press "enter". Click on the first link that appears and follow the instructions on the page. You don't even have to host it on Banana Pi!

The DIY Way

Download a template or start from scratch and make a html document. I suggest w3 templates since they are free and pretty decent too. Open up a html editing software like Dreaweaver and edit your way around the html tags.



<h>here is what will be displayed and it HAS to be followed by</h>
<p>this is a smaller version of what will be displayed</p>

the labels here correspond to a section in style.css 

.h {
color: 5f5f5f;
}

and you can see that it specified that the color of "h" is "5f5f5f" which is a grey.

Uploading a Website

Go back to my guide if you are reading this line

Basically just install FileZilla and make an entry with the local ip and logins of your Banana Pi.

Configuring Settings

On Bananian navigate to
cd /etc/apache2/
ls
Now you can see the file directory for the Apache2 application (it is not where your website is uploaded)



To edit the settings, go to
nano /etc/apache2/sites-enabled/000-default 
Now be careful, here is where all the configuration takes place. You will already have texts in here and what is important to take out is the below lines. Below is ALL you need to have in your configuration. I went out of my way to find the simplest way to make it work:)
<VirtualHost *:80>
DocumentRoot /var/www
ServerName projectbananapi.ddns.net
<VirtualHost>
and the only thing you need to change is the ServerName. Change it to the domain for your website.
ServerName yourdomain.com
ServerAlias www.yourdomain.com
and to host multiple websites on different domains, just add another entry starting with
<VirtualHost *:80>
and fill in the rest accordingly.

Setting up URL

If you do not have a domain, then get a free one 
Google noip and you will find a free domain name service, add a new host and you are good to go.
Do not change any settings, just specify the domain name and your public IP



Find your public IP by searching "my ip" on google and it should look like
  • 63.248.288.16
and you will get a sub domain like below from noip
  • iamawesome.ddns.net
This is the URL you will put in your configuration

Setting up Port Forwarding

Go to your router's configuration page, it is usually
192.168.0.1
or
192.168.1.1
Under QoS or NAT, there is a port forwarding option

Forward port from 80 to 80
to IP of your Banana Pi

Google this if you do not get it. It is self explanatory, but it may be confusing. I am not really in the mood to write a guide for every router in the world:)

Going to Your Website on Chrome or FireFox or Spartan(you know what)

 Open up your browser and type in the noip address without "www"



Hope you enjoyed my horrible humor

and i am not telling you to like my blog or my channel, but please do it if you don't feel like it.
https://plus.google.com/+projectbananapiblogspotz/about

 









Banana Pi Apache2 vs Web Hosting Servers Loading Speed Test Comparison

You Banana Pi is your perfect web server, but does it stack up against competition? Well, maybe your little board is faster than free web hosting plans!

We will be testing the loading time of a website on two different web hosts. This website will have big images along with java script to simulate the real world performance and test the download speeds of the two services.

Apache2 on Banana Pi

I took the time to test the web performance on a variety of web page test websites.


Cloud Flare




Uploading to Server

Banana Pi 4 seconds
MzzHost 46 seconds (no typos)


Web Test Android wifi



Cloud Flare 3806 ms
Banana Pi 1519ms

Conclusion

No matter what, the performance of both websites are not impressive. But Cloud Flare is free and hosting it on Banana Pi uses house hold internet. When the website is accesssed from around the world, Cloud Flare definitely wins because they have servers around the world. For some reason, Banana Pi does not perform well in benchmarks, but on my Android, it actually does 2 times better!

Banana Pi- a really great micro server to host websites with decent speed
Cloud Flare- the best way to speed up your website for no money

I have actually links to the test results here.

http://tools.pingdom.com/fpt/#!/beJh7m/projectbananapi.ddns.net
http://tools.pingdom.com/fpt/#!/bWJyiW/pumpkinpi.cu.cc
http://www.webpagetest.org/result/150201_0B_KJ1/
http://www.webpagetest.org/result/150201_5K_KPV/
http://gtmetrix.com/compare/VGsk6fPu/wOulurGH/07qYncJ6