Welcome, Guest
Please Login or Register.
Lost Password?
subdomain for usermin instead of portnumber (1 viewing)
Post Reply

TOPIC: subdomain for usermin instead of portnumber

#10740
palcrypt (User)
Posts: 3
graphgraph
subdomain for usermin instead of portnumber 2008/03/03 10:28  
Is there a way I can set up my various virtual hosts so that they can get to usermin by going to webmail.thedomain.com instead of www.thedomain.com:20000?
  The administrator has disabled public write access.
#13482
STG (User)
Posts: 20
graphgraph
Re:subdomain for usermin instead of portnumber 2008/06/06 03:50  
Just wondering if you were ever able to figure this out. We are not having any luck with it.

Rick
  The administrator has disabled public write access.
#13868
andreychek (User)
Posts: 269
graphgraph
Re:subdomain for usermin instead of portnumber 2008/06/15 11:27  
There may be a more "webmin'y" way of accomplishing this, but I have had luck doing this using mod_rewrite.

What you can do is add code to your httpd.conf file, which looks for a particular string in the url the browser is going to, and if it exists, redirect to another url.

So in this case, take the following code:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^webmail..*$ [NC]
RewriteRule ^(.*) http://your_domain.com:2000

The above will look for url's beginning with "webmail.", and upon seeing it, will redirect to "your_domain.com:2000".

You can of course explore how to use $1 rather than hardcoding "your_domain.com" if you want to preserve the domain name the user typed in.

More docs on mod_rewrite here:

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

Good luck!
-Eric
  The administrator has disabled public write access.
#13869
Joe (Admin)
Posts: 3795
graph
Re:subdomain for usermin instead of portnumber 2008/06/15 12:18  
The "Webmin-y" way isn't actually all that different:

http://doxfer.com/Webmin/UnderApache#Webmin_Proxied_Through_Apache
  The administrator has disabled public write access.
#15488
staticanime (User)
Posts: 1
graphgraph
Re:subdomain for usermin instead of portnumber 2008/08/07 07:12  
Is there any way to do it, so that if a user goes to http://usermin.theirdomainname.com, they'll be brought to the Usermin login, using just the one Default host?

For example, User A goes to http://usermin.sitea.com and User B goes to http://usermin.siteb.com, and both actually get sent to port 20000 of the server they're on?
  The administrator has disabled public write access.
#15489
andreychek (User)
Posts: 269
graphgraph
Re:subdomain for usermin instead of portnumber 2008/08/07 07:42  
Howdy,

There's an option in System Settings -> Server Templates -> Apache Website for handling this now.

In that, you'll see both "Redirect webmail.domain to Usermin" for Usermin and "Redirect admin.domain to Virtualmin" for Virtualmin.

Although that's just for new domains, the code they're using for that is pretty straight forward:

Code:

RewriteCond %{HTTP_HOST} =webmail.sitea.com RewriteRule ^(.*) https://sitea.com:20000/ [R]



I think I recall Joe mentioning a way to apply new template settings to existing domains, but I've never tried it nor do I recall what it is :-)
-Eric
  The administrator has disabled public write access.
#15496
Joe (Admin)
Posts: 3795
graph
Re:subdomain for usermin instead of portnumber 2008/08/07 10:36  
In Virtualmin Professional here is a virtualmin command to make the switch:

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

I think that'll do it. The modify-web command isn't available in Virtualmin GPL, so I don't think it can be done automatically for existing domains.
  The administrator has disabled public write access.
#15861
beat (User)
Posts: 2
graphgraph
Re:subdomain for usermin instead of portnumber 2008/08/24 10:39  
STG wrote:
Just wondering if you were ever able to figure this out. We are not having any luck with it.

Rick


That's really nice command, but it just does redirect to port 20000.
In quite some situations only port 80 and 443 are authorized by corporate firewalls, and a local "routing" or "tunnelling" or server-side include or sort of natting from domain webmail.domain.com (ports 80 and 443) to domain.com:20000 would be much better.

Any chance to see that in a future version of webmin ?

PS. I don't see a "Subscribe" button for forums (only exists for threads), e.g. I would like to subscribe to any new thread in announcements forum.
Beat 8)
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.