Uncategorized

Web Hosting on Banana Pi with Apache2

Introduction

We all know what websites are, right? I hope so, because this is a website, in the form of a blog. Websites now are indispensable part of our lives! From your every day news website to a shopping website, it is awesome and it is convenient. So want to host your own website with your tiny server ready computer?

What you’ll need

Banana Pi (other boards work too)

Power cable and Ethernet cable (internet)

SD card (Debian 7 in this case)

Computer, or command line access

Downloads

Getting started

Connect to your Banana Pi. See setup if you are confused already.

Now I think we might need to install a software?

You are right!

Apache and Nginx

Both Apache and Nginx are software that can host a website on Linux OS. They are both pretty good, but in this tutorial I will be using Apache2. Some people might argue that Nginx is faster, but I will do a Nginx guide soon and post benchmarks to see the truth.

Installing

apt-get install apache2 -y

You should be somewhat familiar with ‚apt-get‘, it downloads and installs a program.

 /etc/init.d/apache2 start

this line starts ‚apache2‘ if it did not automatically start

Test website

Now if you type the IP of your Banana Pi, you will find a welcome page, it is a website!

Upload custom websites

Now if you want to change the website, you will have to have a website site ready to upload. The website should use html and not word press as we did not install it. You can use magically resources if you want to install other website management software.

To upload the website, i recommend Filezilla, open it up and create a new SFTP connection

leave ports blank

put IP of Banana Pi

Use normal authentication, input admin login (defaults are ‚root‘ and ‚pi‘)

Select SFTP

Find your website and copy it under /var/www directory in your Banana Pi

/var/www/

you should replace the ‚index.html‘ file already there.

If you go to ‚/var/www‘ in the command prompt, the files should match your website assets

cd

cd /var/www

change directory to /var/www

ls

list files in the directory

Once the upload finishes, restart apache 2

cd

/etc/init.d/apache2 restart

now you are ready to go!

Testing

Now if you go back to the IP adress, you will find your new website. It should load fast without a problem.

I did a few timeline tests and the results are decent, for your DIY web server. It can definitely handle low traffic websites, with up to a few thousands clicks a day.

Public IP Port Forwarding

To access your website through the world wide web, we can easily set it up with a few basic steps

I will go through it briefly right now, if you need a more complete guide, simply comment and request:)

  1. register a domain at cu.cc or no-ip
  2. forward the domain to your public IP
  3. set up port forwarding on your router, forward port ’80‘ to local IP of your banana pi

Thanks

for viewing, hoping you like it!

share this community and carry on the DIY spirit! See on G+

Kommentar verfassen

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.