I am trying to use Custom Commands to create a Custom Command button in Usermin that when clicked displays the current AWStats report for the domain of the user. But nothing I do works.
When I use $DOM/awstats/awstats.pl I get “Output from $DOM/awstats/awstats.pl … /bin/sh: 1: /awstats/awstats.pl: not found”
That first command is being run from the command line, bin/sh. It needs to be called in same manner as if it was a browser link. So make the command something like ‘wget https://domain.ltd/awstats/awstats.pl’. Which will open the link like a browser.
Tried wget with many other settings including providing the Username/Password both in Parameter fields and directly in the url and got the error below.
Custom Commands are for command line tools, not for web apps. It could probably be tweaked to work with some kind of wrapper script, but it’s going to be pleasant.
One way to achieve this would be to make a module for Usermin to do the job. A very simple wrapper can display HTML web pages. There’s even already code to do it, and change all the links to point to the right places, inside of Webmin or Virtualmin, somewhere (since we have some embedded web pages in Virtualmin already). I’d have to poke around in the code some to figure out where it is.
Also, the Virtualmin AWStats plugin might be a good starting point. A Usermin variant would need to alter how it thinks of the world (Virtualmin runs as root and drops privileges when it can, Usermin runs as the user, and cannot elevate privileges, so everything has to be do-able by the logged in user).