element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RIoTboard
  • Products
  • Dev Tools
  • Single-Board Computers
  • RIoTboard
  • More
  • Cancel
RIoTboard
Blog Riotboard webserver : Part1 - Introduction
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RIoTboard to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: tusharp
  • Date Created: 22 Aug 2014 12:46 PM Date Created
  • Views 647 views
  • Likes 1 like
  • Comments 0 comments
  • webserver
  • tusharp
  • Ubuntu
  • freescale
  • imx6
  • riotboard
  • embedded
  • php
  • arm
  • mysql
  • apache
  • linux
Related
Recommended

Riotboard webserver : Part1 - Introduction

tusharp
tusharp
22 Aug 2014

Contents:

Part1: Environment Setup  <-- You are here

Part2: Monitering Temperature with Xtrinsic Sensor

Part3: Capture sensor data to database ..

Part4: Remote datalogger

 

Before we start we need to update the OS on Riotboard to get all up-to-date libraries.

The official Riotboard BSP has an Ubuntu 11.10 and needs to be updated.

 

Run the below command to check Ubuntu distro details:

# cat /etc/lsb-release

 

DISTRIB_ID=Linaro

DISTRIB_RELEASE=11.10

DISTRIB_CODENAME=oneiric

DISTRIB_DESCRIPTION="Linaro 11.10 (development branch)"

 

We need to update the ubuntu debian packages resource details.

We will use apt-get later to install packages from these sources.

 

copy/paste the below in terminal.

cat <<EOF >> /etc/apt/sources.list

deb http://old-releases.ubuntu.com/ubuntu/ oneiric main restricted universe multiverse

deb http://old-releases.ubuntu.com/ubuntu/ oneiric-updates main restricted universe multiverse

deb http://old-releases.ubuntu.com/ubuntu/ oneiric-security main restricted universe multiverse

EOF

 

the above will setup the sources that point to ubuntu 11.10  repository.

 

 

Next Install aptitude to proceed with upgrade:

sudo apt-get install aptitude

 

Performing an update on existing packages

sudo aptitude update

Setting the correct time

sudo ntpdate -s ntp.ubuntu.com

 

again checking for the updated ubuntu details:

# cat /etc/lsb-release

 

DISTRIB_ID=Linaro

DISTRIB_RELEASE=12.03

DISTRIB_CODENAME=oneiric

DISTRIB_DESCRIPTION="Linaro 12.03"

 

The oneiric has been updated to a newer linaro release.

 

Once the BSP is updated we can proceed with install new packages.

 

We will start the  setup by installing web server , database and web development tool.

 

We consider below softwares:

Apache    :  A http web server that can fetch and display webpage in browser.

MySQL    :  An Open Source database management system through  which we can store and retrieve data using SQL queries.

PHP         :  A programming language we use to develop webpages.

 

I will install the packages one-by-one with explanation for better understanding.

 

Installing apache:

sudo apt-get install apache2


this will install apache2.

the config files are located at /etc/apache2/apache2.conf and httpd.conf.

the root web directory is /var/www.


detecting ip address of Riotboard .

ifconfig eth0 | grep 'inet addr:' | cut -d ':' -f2 | cut -d' ' -f1

OR
curl ipecho.net/plain


To test your installation, navigate to below link in your web browser.

http://localhost

or

http://<IP_ADDRESS_DETECTED_ABOVE>



Verify Apache Server on Riot:

k4ffxu.jpg
Incase you are editing any apache config files.

  1. shutdown the server : /etc/init.d/apache2 stop
  2. edit config files.
  3. restart apache:   /etc/init.d/apache2 restart



Installing MySQL:

sudo apt-get install mysql-server mysql-client


This will install mysql server and  a client.


during installation it will ask for root pasword for mysql server,  this is to secure  privileges for root user.

we will do more setting later when we will setup databases later.

 

 

Installing PHP:


installing the php libraries and the php module for apache2

sudo apt-get install php5 php5-mysql libapache2-mod-php5 php5-cli

 

 

Verifying the  php installation


through command line

# php -r 'echo "PHP is working\n";'

PHP is working

 


    

through browser

execute in terminal:

echo "<?php phpinfo(); ?>" > /var/www/test.php

 

 

open link in browser:

http://localhost/test.php


The above will provide you with a lot of information and the php version.

xfn9sh.jpg



With this we completed our initial setup of the required softwares .
Next time we will integrate a temperature sensor with RIoTboard .




  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube