When creating a new template from an existing Virtualmin server, we have to cleanup several values like, for example, the IP address in the following configuration files:
/etc/webmin/webmin/virtual-server/config
/etc/webmin/webmin/virtual-server/last-config
/etc/webmin/webmin/virtual-server/localips
So instead of cleaning them IP I thought why not to use global variable. Anyway, I decided to test this by defining a system-wide global variable $IP which has a value of the current server, replaced all the occurrences of real IP address with the global variable in the above configuration files. Restarted webmin and browsed its UI and didn't notice any errors. So everything works just fine except that checking Virtualmin configuration gives the following notice:
Default IP address is set to $IP, but the detected external address is actually xx.xx.xx.xxx. This is typically the result of being behind a NAT firewall, and should be corrected on the module configuration page.
which is fine, we can live with it, provided of course, there are no real harm.
Could someone from *min team elaborate on possible negative implications of using a global variable instead of real values in Webmin's config files? Thanks a lot!
Comments
Submitted by andreychek on Tue, 10/30/2018 - 10:00 Comment #1
Submitted by JamieCameron on Tue, 10/30/2018 - 21:56 Comment #2
You can't use a literal $IP in those files - not all of them will get automatically substituted by Virtualmin.
Submitted by yngens on Wed, 10/31/2018 - 04:02 Comment #3
Got it. Thanks.