change ports through CLI

4 posts / 0 new
Last post
#1 Tue, 07/29/2014 - 08:21
remibruggeman

change ports through CLI

Hey,

I am making an automated script to run on a newly installed server to set security and basic applications in a quick fashion.

In the script I will allow the possibility to run an install of Virtualmin. However, as a default policy, I do not run virtualmin or usermin on the default ports. I will want to create the firewall file before Virtualmin is created and need to be able to change the Virtualmin and usermin ports after the install.

I found the following file: /etc/webmin/miniserv.conf which shows me the ports I set for Virtualmin. Is this the only place where I need to alter the ports for Virtualmin, or are there more files? How about the Usermin ports? Where can I alter those?

Thanks a lot for your help :)

Tue, 07/29/2014 - 10:37
Locutus

Using some empiric tests (change the port number thru the GUI and then grep for the new one in /etc :) ), I found out:

The main port for Virtualmin/Webmin is in /etc/webmin/miniserv.conf, entry "port". The other entry with the default port 10000, "listen", applies to the UDP broadcast "search for Webmins" function.

The port for Usermin is in /etc/usermin/miniserv.conf, entry "port".

Those should be the only locations.

Tue, 07/29/2014 - 14:06
lp86

Locutus is correct, just change the port numbers in those two files and restart the applicable services.

Thu, 07/31/2014 - 01:30
remibruggeman

Great Thanks :) I'll post the script once it's finished. It should cut off a few hours of initial server configuration for security...

Topic locked