BeagleBone Black: Webserver running on Ubuntu

If you are looking for a way to make a cheap web server, primarily to be used as a testing environment or to store files, then BeagleBone Black might be a good choice. A BBB is a new inexpensive mini computer(BBB features). 

The idea behind it is that the tablets like iPads normally don't have large storage space and that we always need to share some music or films within the family. So to make life easier and reduce the download bandwidth (e.g. I often go to Youtube and listen to the same several songs), I decided to build a web server.

 

Step 1: Install Ubuntu

In the beginning I tried installing the web server on the Angstrom that is the default system. Unfortunately, it crashed when installing the Lighttpd for running a light web server. Then I turned over to the Ubuntu that is also much easier and more user-friendly.

The image I used is ubuntu-raring-13.04-armhf-3.8.13-bone20.img. Don't get confused by another blog in which I used Angstrom ( I have two BBBs cheeky )

 

Step 2: Install ApacheMySQLPHP

After loading the image you need to install some software (e.g.ApacheMySQLPHP). There are plenty of tutorials or videos about installing these.

Before the next step I recommend you to set up a static IP address for your BBB.

 

Step 3: Install WordPress(or Drupal)

Already installed LAMP or LEMP(Nginx with PHP,Mysql) on your Ubuntu? Then it's time to install WordPress CMS. WordPress is a popular blogging tool and a content management system(CMS) based on PHP and supporting MySQL. It's free and open-source.

Follow the instructions : install WordPress on Ubuntu 13.04

 

Step 4 : Install the theme and plugins for your web site

after logging in to the wp-admin, you may see a similar page as follows:

 

Personally, I installed several Plugins for audio and video:

Audio player : to play mp3 files

Viper's Video Quicktags : to watch embeded videos with browser

HTML5 MP3 Playerlist Player: to make a audio playlist (Tutorials)

example of audio playlist:

 

Step5: Mount the USB stick to web server

The microSD card for BBB is only 8GB that is too small for a web server. So I mounted a USB stick of 60GB to the web server. Here you need to make some changes so that the upload files go to the USB stick instead of to the microSD card (the default upload folder is in microSD card)

log in as root: sudo -i

plug in your USB stick and locate the device file of the USB stick by listing the disks:

fdisk -l

It will be something like sda1, sdb1,sda2 etc. Mine is /dev/sda1 and the format of the USB stick is exFAT.

Next, we need to create a directory 'usb' under /var/www, so you will be able to mount your device.

/var/www is also the folder where your web site is located.

mkdir /var/www/usb

 

To use the exFAT file system on Linux systems, you need the exfat fuse module. Installing it on Ubuntu requires executing:

apt-get install exfat-fuse

 

Then mount your USB stick with ...

root@ubuntu-armhf:~# mount -t exfat -o rw /dev/sda1 /var/www/usb

(or for other format e.g. mount -t vfat -o rw /dev/sda1 /var/www/usb )

when you want to detach the usb stick, unmount it with umount /dev/sda1

 

 

All done?

It's time now to make some change in the web site configurations.

Go to the folder /var/www and open the wp-config.php with

cd /var/www

nano wp-config.php

Add a line in the file

define('UPLOADS', ''.'usb/UPLOADS');

the usb/UPLOADS is the folder in the usb stick where the uploaded files via web site should go to. Then you need to create a new directory UPLOADS in the usb folder with 'mkdir UPLOADS'.

 

Step6: Change the maximum upload file size and maximum post size

When you want to upload a film to the web server and share it with your family, then you will find out that you cannot do it, because the film is too large. Then you need to change the allowed maximum upload file size and maximum post size.

The default maximum upload file size is only 2MB and maximum post size is 8MB.

I tried changing them to 2GB, but the web site still shows maximum size of 1GB that,I guess, is the maximum size.  

This is how I did it:

1) Create a new text file in your wp-admin directory root and name it info.php

2) Open the info.php and add these lines:

<?php

phpinfo();

?>

3) save it and go to the website_IP_adress/wp-admin/info.php in your web browser.

4)

 

5) In the 5th line you will see Configuration File (php.ini) Path, in my case it is /etc/php5/apache2

6) Go to this path and open the php.ini

7) Search for post_max_size=8M, and change it to post_max_size=1000M
    Search for upload_max_filesize=2M, and change it to upload_max_filesize=1000M

8) Then you can go back to your admin page -> Media ->Add New , then you can see

(for the users when they go back to your web site, make a new post and add insert new media in the post, they will see the maximum upload size is 1GB now)

 

Step7: Test web server 

As you may have noticed, the bufferring speed of the films is quite fast in a LAN.

 

FYI, you can embed the images captured by webcam into your website, more details are referred to another blog.

Comments

Can it be installed it Gentoo Linux too?

By Lauren Slater (not verified)

https://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=4&c...

"The BeagleBone Black is supported on Gentoo, thanks to Beagleboard.org who provided us with hardware to bring this forward"

By Olivier Caytan

Add new comment

User login