What does Services, Configure Website, Apply Changes (specifically) actually do?

If I make a change in an apache config file with Services and Configure Website, I can click the little arrow-circle which mouse-overs to “Apply Changes”, and appears to launch:

(my server) /apache/restart.cgi?redir=%2Fapache%2F

I found a likely file:

/usr/share/webmin/apache/restart.cgi

But if I execute it from the command line I get:

Can’t locate ./apache-lib.pl at ./usr/share/webmin/apache/restart.cgi line 5.

from outside of the directory or:

WEBMIN_CONFIG not set at …/web-lib-funcs.pl line 5021.
Compilation failed in require at ./restart.cgi line 5.

from inside it.

I assume this uses something like:

service apache2 reload
systemctl reload apache2

But I would like to know for certain (and whether restart.cgi can otherwise be referenced/executed via the command line).

I have an IP-restricted folder on a website and users have to ask to have their IP added. I am considering how I might add a “ready for prime time” type of one-click “add new IP here” (for IPs already approved/users logged in to this site… not virtualmin), have it append the .conf file, and then do the apache reload. I just don’t want to miss anything that restart.cgi might do (or unnecessarily elevate privileges somewhere).

Thanks

Ron

Ubuntu 20.04
Virtualmin 7.8.2

SYSTEM INFORMATION
Ubuntu 20.04 REQUIRED
Virtualmin 7.8.2 REQUIRED

os type and virtualmin version please?

I will edit it to be correct, for the record this is how I ended mine originally (with that information just above system information):

This is wholly unrelated to your title. This is either a bug in Webmin, or a broken installation of Webmin.

Oh, wait, no. You’re trying to run Webmin files on the command line. Nevermind. I’m trying to figure out what you’re doing now…

Yes. Something like that.

It’s configured in the module related to the service. Go to Webmin->Servers->Apache Webserver->Module Configuration (click the gear icon :gear: in the upper left corner of the content pane)

Under:

Webmin → Servers → Apache Webserver → Global configuration → Configure Apache Modules

(which is the closest thing I see to the path you describe)

I have no gear in the upper left. I do have a list of modules installed for Apache. Is one of these “restart.cgi”?

Thanks.

Click the gear (:gear:) in the upper left corner of the content pane. That is Module Configuration. It exists in almost every module (any module that is configurable).

If you’re not using the default theme (Authentic), Module Configuration may be somewhere else or labeled differently.

Ah, duh, thanks. It’s:

/usr/sbin/apache2ctl graceful

For posterity.

Ron

It depends on your OS/version. e.g. see all of the config files in https://github.com/webmin/webmin/blob/master/apache/ such as https://github.com/webmin/webmin/blob/master/apache/config-AlmaLinux-7.0-ALL