HowTo: Rasbpian+ lighttpd + apcupsd-cgi
Posted: 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:
This will install the apcupsd CGI scripts and the webserver.
2) Configure lighttpd cgi-bin support:
Should return this, if successful:
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:
Link the apcupsd CGI scripts:
Now you can access the UPS status by opening the .cgi files in your browser under the following address:
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:
1) Install required packages:
Code: Select all
$ sudo apt-get install apcupsd-cgi lighttpd
2) Configure lighttpd cgi-bin support:
Code: Select all
$ sudo lighttpd-enable-mod cgi
Reload changes:Enabling cgi: ok
Run /etc/init.d/lighttpd force-reload to enable changes
Code: Select all
$ sudo service lighttpd restart
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
Code: Select all
$ sudo ln -s /usr/lib/cgi-bin/apcupsd/ /var/www/html/cgi-bin/
(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: