I wanted to add a widget to my Imperihome set-up telling me if my LIFX API was still running. If you check my earlier post, you’ll see that I am running the unofficial Ruby LIFX HTTP API from https://github.com/chendo/lifx-http.
I decided to write something simple in php and run it also on the Raspberry pi. But first, I need an http server. I decided to go for lighttpd (following directions from this page: http://www.penguintutor.com/linux/light-webserver).
- sudo apt-get install lighttpd
- sudo apt-get install php5-common php5-cgi php5
- sudo lighty-enable-mod fastcgi-php
- sudo service lighttpd force-reload
- sudo chown www-data:www-data /var/www
- sudo chmod 775 /var/www
- sudo usermod -a -G www-data pi
Write a bit of code and place it in /var/www:
And there we are!