Installing local webserver in BeagleBone Black

[vc_row][vc_column width=”1/1″][vc_column_text]Server are computers that fulfill the query of client by delivering webpages which includes images, scripts , texts etc. We will be go with LAMP (LINUX, APACHE, MYSQL, PHP). I have ubuntu14.04 installed in BeagleBone Black(BBB).

The ubuntu os image, i am using, is from elinux.org. It already have apache installed, but i will assume you don’t have apache installed in your BBB. You can check it on your BBB by either typing http://arm.local  or your lan’s local ip address (eg. 192.168.1.20 in my case, use “ifconfig” to check yours).

logging by beaglebone lan's ip addressLets start

 

  • Installing Apache server

apache2 is available in Ubuntu package repository. you can install it by following command


sudo apt-get install apache2 
  • Installing MySQL5

It is also available in Ubuntu pakage repositiory, while installing you will need to specify a password for database. by default username is root.


sudo apt-get install mysql-server mysql-client 

 

  • Installing PHP5 (server based scripting language)
sudo apt-get install update;
sudo apt-get install upgrade;
sudo apt-get install mysql-server mysql-client; 

now you need to restart system and Apache

sudo reboot now 

afterwards login again and restart apache

sudo /etc/init.d/apache2 restart

Now, we will test whether php is working or not. For this we will use php script and call that in local network via any browser.

sudo nano /var/www/html/info.php 

and type

<?php phpinfo(); ?>

then save and exit by using ctrl+x.

  • Testing Php

For this we will use any mobile, pc or laptop connected in same local network .

type : http://1923168.1.20/info.php

if it worked then you will see a similar window as shown in picTesing php installation

 

  • Using MySQL with PHP5

To use MySQL with PHP5 you should install php5-mysql package. To install php5-mysql you can enter the following command in the terminal prompt

apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl 
  • Php scripts from command lines
    sudo apt-get install php5-cli
  • caching and optimizing PHP intermediate code

Xcache is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It’s similar to other PHP opcode cachers, such as eAccelerator and APC. It is strongly recommended to have one of these installed to speed up your PHP page.

Xcache can be installed as follows:

sudo apt-get install php5-xcache
  • restart apache2
     sudo /etc/init.d/apache2 restart
  • Installing phpMyAdmin

 

 sudo apt-get install phpmyadmin 

It will ask for password that you had given in 2nd step of mySql5 setting. Provide that and hit enter.

php password

reboot system by following command

 sudo reboot now 

[/vc_column_text][/vc_column][/vc_row]