Since there is no billing feature with Virtualmin, I need to be able to enable/disable a particular website and webmin login via text.conf file but not sure the exact or best way to do so.
Somewhere in /etc/webmin/virtualmin??
I see a lot of .acl file but I did not come across the
There’s a comprehensive API for this exact purpose (which expanded out to include everything else in Virtualmin eventually, but it started out being for billing apps to be able to create, delete, enable, disable, etc. accounts).
The command you’re looking for is “disable-domain”, and it can be easily called using the virtualmin wrapper command:
virtualmin disable-domain --domain domain.tld --why "No moneys"
It is also available via the remote version of the API. There’s huge swaths of documentation about this stuff (and all of the huge array of other functionality in the API) here:
Note that the commands are exactly the same between remote and CLI, so the remote docs only cover how to call them…not any of the specific commands or options.
Thanks for your reply.
I have another question then.
I need to be able to use php to execute the domain-disable.pl.
I was trying to think of the best secure way to do this…
–Add the server php-web-user to the root group??
–Change permissions of the disable-domain.pl to the php-web-user??
–Somehow user php-ssh-shell(how) to run the command with password embedded??
–Run a cgi-perl script??
Any secure ideas?
Anything would help.
That depends a lot on the situation, but I’d probably suggest using the remote API rather than making your PHP script run as root. This is almost certainly the simplest option.
You could also create a setuid script specifically for all of the root-level actions, if you really wanted it to happen via the command line. You’d, obviously, want to make sure that script was inaccessible to anyone other than the virtual server where your PHP application runs.