Submitted by Vince42 on Wed, 04/27/2016 - 16:41 Pro Licensee
I changed the Webmin and Virtualmin ports a while ago, and my virtual domains are still redirecting to the old port. I searched in the DNS settings and Server templates as advised by forum posts, but were not able to find the place, where I could specify the redirect. If this should not be realizable via the user interface: which files in the system should I change?
Status:
Active
Comments
Submitted by andreychek on Wed, 04/27/2016 - 17:24 Comment #1
Howdy -- you may want to verify that in System Settings -> Server Templates -> Default -> Apache Website, that the redirects listed in there are set properly for your setup.
Also, after making that change, it will only affect new domains. You would need to disable, and then-enable, the Apache website feature for your domains in order to re-create that redirect.
Submitted by Vince42 on Wed, 04/27/2016 - 17:39 Pro Licensee Comment #2
In the sections "URL for webmail redirect" and "URL for admin redirect" I have the option "Use domain name" set and thus no ports specified. This led me originally to the conclusion that the actual redirect setting must reside in some configuration file elsewhere. In all the sites-available / sites-enabled files I do find the wrong settings
RewriteCond %{HTTP_HOST} =webmail.eec.de
RewriteRule ^(.*) https://domain.tld:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.eec.de
RewriteRule ^(.*) https://domain.tld:10000/ [R]
But I wish to figure out how these directives made it into the apache site configuration files as the server template just says
ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory ${HOME}/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
<Directory ${HOME}/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
which prooves that there are no redirect settings explicitly given in the server template.
Submitted by Seito on Tue, 10/11/2016 - 12:08 Comment #3
Have you found a solution to this issue? I'm facing the same problem...
It seems at a quick glance you can override where and if the admin and webmail URLs go to in the section of the template where it says
The port is configured in the Webmin configuration "Webmin > Webmin Configuration > Ports and Addresses" and is embedded in the config as the site is created. I don't see a way to automatically change it after the domains are created, only going forward. It seems you'll have to manually update the apache config with a find and replace on the global config or some kind of sed from the command line to change all 10000 to the new port. I do think it would be nice for those directives to be put in the template text area rather than the radio dials but that's a feature request as well as changing it on all sites after creation. I'd suggest reposting this as a feature request but for now you have an understanding of where it's configured.
Submitted by JamieCameron on Tue, 10/11/2016 - 19:54 Comment #5
Yeah, it's a missing feature that the port doesn't get updated in the redirect if you change Webmin or Usermin from 10000 or 20000 after creating some domains.
Submitted by brad100 on Mon, 10/16/2017 - 08:22 Comment #6
Hi there
I see this topic is now a year old,
Can anyone tell me if there is now an easy way to set the port used in the webmail redirect? I have, as others have previously mentioned, set the new port in the Usermin port setting but the webmail redirect still takes you to port 20000 and now of course shows page not found .
Any advice would be appreciated
Kind Regards Brad
Submitted by JamieCameron on Mon, 10/16/2017 - 21:47 Comment #7
@brad100 - are you seeing this even for domains created after you changed the port?
For those, you will have to edit it in your Apache config file (/etc/init.d/httpd/httpd.conf)
Submitted by brad100 on Tue, 10/17/2017 - 07:37 Comment #8
Hi @JamieCameron Thank you very much this is just what I want to know. Yes the server being used for the hostname was created before I updated the port. All the best Brad
Submitted by Dexter00 on Mon, 07/02/2018 - 13:51 Comment #9
check here Virtualmin --> Services --> Configure Website --> Edit Directives
RewriteCond %{HTTP_HOST} =webmail.youradress:newport RewriteRule ^(.) https://youradress:newport/ [R] RewriteCond %{HTTP_HOST} =admin.youradress:newport RewriteRule ^(.) http://youradressl:newport/ [R]