HowTo: Rasbpian+ lighttpd + apcupsd-cgi

Step-by-Step descriptions of how to do things.

HowTo: Rasbpian+ lighttpd + apcupsd-cgi

Postby ^rooker » Fri Dec 16, 2016 3:59 pm

Here I'm going to describe the necessary steps to setup apcupsd-cgi using lighttpd (instead of Apache) on Raspberry Pi 1, running Raspbian 8 (Jessie).

1) Install required packages:
Code: Select all
$ sudo apt-get install apcupsd-cgi lighttpd

This will install the apcupsd CGI scripts and the webserver.

2) Configure lighttpd cgi-bin support:
Code: Select all
$ sudo lighttpd-enable-mod cgi

Should return this, if successful:
Enabling cgi: ok
Run /etc/init.d/lighttpd force-reload to enable changes

Reload changes:
Code: Select all
$ sudo service lighttpd restart


3) Link apcupsd CGI scripts:
In order for the apcupsd-cgi scripts we've installed to become accessible, they need to be made available under the "/cgi-bin/" folder in the www-root of the lighttpd webserver.

Create a cgi-bin folder:
Code: Select all
$ sudo mkdir /var/www/html/cgi-bin


Link the apcupsd CGI scripts:
Code: Select all
$ sudo ln -s /usr/lib/cgi-bin/apcupsd/ /var/www/html/cgi-bin/


Now you can access the UPS status by opening the .cgi files in your browser under the following address:
http://yourraspbianserver.home/cgi-bin/apcupsd/multimon.cgi

(Change "yourraspbianserver.home" to match your setup)

NOTE: Opening "/cgi-bin/apcupsd" will not work!
Lighttpd does not provide directory listings by default, so you'll get a "404 not found" which is misleading.


Basically, that's it!
Have fun :)



Links:
  • 0

Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
 
Posts: 1446
Joined: Fri Aug 29, 2003 8:39 pm
Reputation: 0

Return to HowTo's

Who is online

Users browsing this forum: No registered users and 1 guest

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: No registered users and 5 guests

Reputation System ©'