The inability to get the browser interface to work can be attributed to:
- The browser interface program "apcupsd-cgi" appears to be outdated in the Ubuntu repository. I was able to get, with much difficulty, other programs to work in the "/usr/lib/cgi-bin" directory. Which is good news in a way.
- The tutorials for installing the browser interface have left out crucial steps that must be taken prior to installing "apcupsd-cgi". This led to a lot of "why doesn't it work" anguish. Eventually, I was able to uncover these "missing" steps.
- Programs, overtime, are subject to revision. That is normal However, at times these revisions may be incompatible with "old" tutorials. This was the case with my installed version of Apache2.
The next undisclosed hurdle related to the file: "/etc/apache2/sites-available/000-default.conf". This file contained the link for designating the location of CGI files. See the sample script below. Warning. Do not copy the script below without reading Apache Tutorial: Dynamic Content with CGI. As I noted in Point #3, programs/tutorials change over time and the Apache tutorial is outdated by using "LoadModule", you need to use "sudo a2enmod cgi".
# --------------------------------------------------------
# https://httpd.apache.org/docs/2.4/howto/cgi.html
ScriptAlias "/cgi-bin/" "/usr/lib/cgi-bin/"
<Directory "/usr/lib/cgi-bin">
Options Indexes FollowSymLinks Includes ExecCGI
AddHandler cgi-script .cgi .pl
AllowOverride all
Allow from all
Require all granted
</Directory>
# --------------------------------------------------------
Additionally, I recommend that you undertake an internet search on the terms used in the script sample above. The reason is that there is a lot of conflicting advice concerning which terms to use. The above example may work for me in Ubuntu 16.04, but it may not work for you. Who knows, there may yet be an undiscovered option that would get "apcupsd-cgi" to work. Though I was never able to get "apcupsd-cgi" to work, I was able to enable CGI scripting. Which is good news in the end.
---------------------
PS: As an aside, you need to use HTML entities to prevent the "<" and ">" from being interpreted. Click here for more information on Common Gateway Interface (CGI).
No comments:
Post a Comment