Linux Reef Controller – Web Server Setup

image_pdfimage_print

This guide will explain how to setup a web server to poll sensor servers that are installed on your network, and use that data to generate meaningful graphs and output to a webpage for central data collection and viewing of all of your sensor information.

In all of the following examples I use Gentoo Linux as my Operating System. Any flavor of Linux will do as long as you can install the required owfs packages, either via source or a package manager. Check your particular distro’s documentation for further details.

This document assumes you have a fully configured Gentoo or other Linux environment with Apache, PHP, Perl, Sendmail, and Cron properly configured. Any specific configuration requirments will be outlined. Other than that default installations will suffice.

Notice: The installation and configuration of Gentoo Linux, Sendmail, Cron, Perl, Apache, and PHP are beyond the scope of this document. Please visit the Gentoo Website for a wealth of documentation to help you along. You may also check out my Gentoo Guide.

  • Before you begin verify package settings
    • Add the following to /etc/portage/package.keywords
      • sys-fs/owfs
    • Add the following to /etc/portage/package.use
      • sys-fs/owfs fuse server php
      • net-analyzer/rrdtool rrdcgi

  • Make sure your kernel has fuse support
    • cat /usr/src/linux/.config | grep -i fuse
    • Should ouput:
      CONFIG_FUSE_FS=m
    • If not rebuild your kernel with fuse support

  • Setup your web directory and cgi-bin
    • On Gentoo these are both setup in /var/www/localhost by default after installing Apache
    • Setting up userdir support and vhosts are beyond the scope of this document, however they will work fine if used.

  • Install owfs and rrdtool
    • emerge -avq owfs rrdtool

  • Create the necessary directories
    • Get root privileges
      • sudo -s
    • Setup the directory that will hold the generated web file for each sensor that you will include in your main page.
      • mkdir /var/www/localhost/htdocs/include
    • Setup the graphs directory
      • mkdir /var/www/localhost/htdocs/graphs
    • Setup the RRD database directory
      • mkdir /var/www/localhost/htdocs/RRD
    • Setup the log directories
      • mkdir /var/log/lrc
      • mkdir /var/log/lrc/mail_log

  • All the prereqs should now be in place! Your server now has the ability to poll your devices as well as serve as a sensor server itself.
  • Check out my Script Example page to see scripts you can use to get things going!
  1. No Comments