Virtualmin Access URL

4 posts / 0 new
Last post
#1 Mon, 12/31/2012 - 02:16
calvin

Virtualmin Access URL

Hello, when I access webmin/virtualmin it's accessible via https://mars.domain.net:10000 and https://domain.net:10000. Is it possible to set the config so that http://domain.net:10000 doesn't redirect to the webmin/virtualmin at https://mars.domain.net:10000? In the future I will have many servers named after planets -- https://mars.domain.net:10000 ; https://jupiter.domain.com:10000 etc.

thank you!

Mon, 12/31/2012 - 04:38
Locutus

Yeah, you can configure that redirect in the Server Templates, section "Apache Website". You can choose there if there should be a redirect, and where it should point.

Templates apply to newly created domains. For existing ones, you'll need to edit the Apache virtual host config ("Services / Configure Website / Edit Directives") and modify the RewriteCond/Rule directives doing the redirect.

And don't forget that Pluto is no longer a planet. ;)

Mon, 12/31/2012 - 09:31
andreychek

Howdy,

An alternative way to apply that redirect to all existing domains is to use the command line API... the following will add it to all your domains, once you've modified your Server Templates as Locutus mentioned:

virtualmin modify-web --all-domains --no-webmail
virtualmin modify-web --all-domains --webmail

That will disable the current redirect, and then re-add it.

-Eric

Mon, 12/31/2012 - 10:40
Locutus

@Eric: Ooh, that's a nice feature, I didn't know that. :) I could have used it a while ago when I manually edited the webmail redirection target for all my email-enabled domains.

Anyway, I think I found a bug in that procedure. After performing those two commands (on one test domain), the RewriteCond directive for webmail was missing. Possibly because I have a custom rule in my config.

Before the cycle, the Rewrite block looked like this:

RewriteEngine on
RewriteRule ^/mail/config-v1\.1\.xml http://tiahost.de/mail/config-v1.1.php [L,R=301,NE,QSA]
RewriteCond %{HTTP_HOST} =webmail.futterkrippe-oberdrees.de
RewriteRule ^(.*) http://webmail1.tiahost.de [R]
RewriteCond %{HTTP_HOST} =admin.futterkrippe-oberdrees.de
RewriteRule ^(.*) https://futterkrippe-oberdrees.de:10000/ [R]

After turning webmail off, like this:

RewriteEngine on
RewriteRule ^/mail/config-v1\.1\.xml http://tiahost.de/mail/config-v1.1.php [L,R=301,NE,QSA]

After turning it back on, this:

RewriteEngine on
RewriteRule ^/mail/config-v1\.1\.xml http://tiahost.de/mail/config-v1.1.php [L,R=301,NE,QSA]
RewriteRule ^(.*) http://webmail1.tiahost.de [R]
RewriteCond %{HTTP_HOST} =admin.futterkrippe-oberdrees.de
RewriteRule ^(.*) https://futterkrippe-oberdrees.de:10000/ [R]

I'm too lazy right now to create an entry in the issue tracker. ;)

Topic locked