Koozali.org: home of the SME Server

Linux SME 7.3 Multiple Domain Hosting- HOW TO???

Offline ber

  • ****
  • 239
  • +0/-0
Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« on: July 10, 2008, 12:55:13 PM »
Hi all, am a Linux Newbie and have been enjoying the ride, been at it for about 8 months and have learnt plenty. Tried many distros but the SME is great for me.
I would like to host multiple domains for clubs and some small clients that I look after. Currently i have configured the server to host our website and emails etc..works great.
I understand that Linux SME is able multiple domains but am unable to work out how to do this!!
I've read lots of instructions but just cant make any sense how to do it.
As mentioned I would like to setup the server so that I can host the website and domain name of different organizations I belong to...Can anyone help me?
I can register a new domain but cant understand how the server can distinguish which user belongs to which domain...for email address purposes.

Hope this makes some sense to someone.. :-P

Offline e[nt]e

  • *
  • 172
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #1 on: July 10, 2008, 01:31:00 PM »
Hey,

The easiest way to store websites are the ibays. You can set if you want an ibay to be accessible from the internet or just for local networks, you can set groups which are allowed to view or edit the content, set passwords and so on. Just have a look at the server-manager panel ibays.
Then you can add a virtual domain which you can then point to the ibay. (server-manager panel domains)
Regarding the email:
Every user you have created on the server has a email address on every domain on your server. (user1@domain1.com, user1@domain2.com, ..., user2@domain1.com, user2@domain2.com, and so on and so forth)
I think there was a thread dealing with this topic some time ago...try to use the search button.

Regards
Niklas
1984 wasn't meant to be a manual.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #2 on: July 10, 2008, 02:10:04 PM »
ber

Re email:

To distinguish specific addresses for specific domains, create a Pseudonym in the form of
user1@domain1.com forwards to joe
user1@domain2.com forwards to peter
etc

Don't make the mistake of creating your end users with the same name you want them to use as an email address.
Have a carefull read of the Pseudonyms section of the manual.

In webmail you will need to change the default sending address/domain for each user depending which domain name they use. By default, email sent from webmail will appear to come from the main domain, so that's why each user must be configured withe the name & domain they use.

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline ber

  • ****
  • 239
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #3 on: July 16, 2008, 06:37:46 PM »
 :-P Mary and Support team thanks for your input, I;m still struggling to get around how it all works- pseudonyms etc...

I understand the concept just need time and some patience to take it a step at a time.

I've made some progress but more laborious trial and error coming thanks again

Regards John   :smile:

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #4 on: July 16, 2008, 07:24:46 PM »
Quote
I can register a new domain but cant understand how the server can distinguish which user belongs to which domain...for email address purposes.

We have multiple domains on our main server. Unless there is a situation where two users on different domains need exactly the same name, this does not seem to cause a problem. Lets say it is something like this.

Users,
joe@domain1
fred@domain2

all mail to joe@domain1 or joe@domain2 go to the same user. Joe gives out joe@domain1 as his e-mail address, the fact that mail addressed to joe@domain2 would also go to him does not seem to cause a problem for us as he never uses that address anyway.

The only time you really have a problem is when you have joe@domain1 and joe@domain2. In this case per the user manual you create users joea and joeb. You then set up a Pseudonym for each like this

Pseudonym: joe@domain1 > joea

Pseudonym: joe@domain2 > joeb

If you set up the user name as joe you cannot do this as they Pseudonym is already used as a user name. Hence mary's warning:
Quote
Don't make the mistake of creating your end users with the same name you want them to use as an email address.


I really can't see a reason to do the Pseudo creation with every user as it just seems not to cause a big problem if all domains route to the same user.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #5 on: July 16, 2008, 09:24:05 PM »
ber

Quote
I really can't see a reason to do the Pseudo creation with every user as it just seems not to cause a big problem if all domains route to the same user.

Yes that's correct. You only need to create a pseudonym email address to ensure that mail for a particular name/domain/address ONLY goes to a particular end user account (associated with a particular domain), and cannot go to other user accounts (not associated with that domain).

It really is the answer for situations where you do want to receive email for the same username@different domains but want it to go to different end user accounts.

To reiterate to ber for further understanding.
sme only supports one name set, so you cannot have multiple user accounts for the same user (eg joe) at different domains, you can only have one user account for joe which applies to all domains.

The workaround is to create user accounts with a different name to what will be used as an email address.
eg
create user account joe1
create user account joe2
create user account joe3

DO NOT create a user account for joe

create pseudonym for joe@domain1 which forwards to user account joe1
create pseudonym for joe@domain2 which forwards to user account joe2
create pseudonym for joe@domain3 which forwards to user account joe3

joe1 logs in using joe1 but advertises their email address as joe@domain1


Your main or primary domain is created during initial setup in the admin console, Configure this server.
Your additional domains are created using the Domains panel, and are called Virtual domains, but they function virtually identically to the main domain.
In the Domains panel, you select an ibay for the content that will apply to virtual domain web sites.

The mail server accepts mail for all valid domains (either the main or virtual), and delivers the mail to end user acounts or pseudonym addresses.

Note you do not need to use pseudonyms.
You can just do the following.
create user account joe1 with effective email address of joe1@domain1
create user account joe2 with effective email address of joe2@domain2
create user account joe3 with effective email address of joe3@domain3

This arrangement will work fine, but note that if email is inadvertantly sent to
joe2@domain1 then joe2 will still receive that email (rather than joe1).
External users would not really be sending to joe2@domain1 as that address has never been advised to anyone as being active.

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #6 on: July 16, 2008, 09:31:59 PM »
mary,

I think your explanation is very clear. Do you think the manual is clear enough on this or should we add a howto of some sort to the documentation?

It seems to me that it is covered in the manual but it is one of those things that a user tends to forget because they do not use it very often.

We could do something in the FAQ or a howto entitled "multiple Users with the same name on different domains" or something like that............

Offline e[nt]e

  • *
  • 172
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #7 on: July 16, 2008, 09:42:32 PM »
Do you think the manual is clear enough on this or should we add a howto of some sort to the documentation?

Although I'm not mary, I think that's a good idea.
1984 wasn't meant to be a manual.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #8 on: July 16, 2008, 09:53:19 PM »
It seems to me it belongs in the FAQ maybe under http://wiki.contribs.org/SME_Server:Documentation:FAQ#Email
as Subheading EDIT: 3.9 User accounts
                             3.9.1 Multiple Users with the same name on different domains

If you agree that is where it belongs I will try to do it in the next couple of days. (I will probably use most of mary's post for this)
« Last Edit: July 16, 2008, 09:59:26 PM by mercyh »

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #9 on: July 16, 2008, 10:11:31 PM »
mercyh & e[nt]e

The manual has a large section on practical usage re pseudonyms and domains etc (which I have pasted below), which does explain the concepts quite well. Is that not clear enough to end users, assuming of course that they are reading it (which is often not the case) ?


Practical usage guidelines

An SME Server has only one name set, meaning only one occurrence of a name can be in the system, whether it be a user, a group, a pseudonym or an ibay.

Therefore whenever you create a user account and you have multiple domains, then that user will apply to all domains automatically.

So the user account "sales" will receive email for sales@domain1 sales@domain2 sales@domain3 sales@domain4

The problem with this is that you cannot have different people using the same user account name to collect email.

Using the pseudonyms panel is the only way that SME Server can distribute email for the same user "name@different-domain" names, but you need to use it in conjunction with the correct underlying naming concepts.

The golden rule is never allocate unique user names to end users accounts as these will no longer be available for globalname@domain type email address usage.

eg create your domains eg domain1, domain2, domain3, domain4 and configure those domains to use different ibays for the web content. You can even setup different groups to allow only different users to access each ibay to update web content etc.

create user accounts user1, user2, user3, user4 as needed for users who want to use the email address "sales", but keep in mind they will use the login name user1 rather than sales (the login names could be johnb, johnb2, johnw, johnm etc)

create user accounts user5, user6, user7, user8 as needed for users who want to use the email address "info", but keep in mind they will use the login name user5 etc rather than info

create user accounts user9, user10, user11, user12 as needed for users who want to use the email address "accounts", but keep in mind they will use the login name user9 etc rather than accounts

create pseudonyms eg sales@domain1 which forwards to user1 sales@domain2 which forwards to user2 sales@domain3 which forwards to user3 sales@domain4 which forwards to user4

info@domain1 which forwards to user5 info@domain2 which forwards to user6 info@domain3 which forwards to user7 info@domain4 which forwards to user8

accounts@domain1 which forwards to user9 accounts@domain2 which forwards to user10 accounts@domain3 which forwards to user11 accounts@domain4 which forwards to user12

ie. in the pseudonyms field type the whole pseudonym name as sales@domain1

Note do not use sales, info or accounts for any other purpose ie. as user account names or group names or pseudonym names (on its own) or ibay names.

If your want your end users to use webmail then they login in using the URL https://domain1/webmail https://domain2/webmail https://domain3/webmail https://domain4/webmail

If you want webmail to be configured for the correct domain for the correct end user the first time they use it, then you will need to do that manually yourself before issuing the login details to the user, eg login to webmail as the end user eg user1 (for domain1) and setup the profile for that user to show the return email address of sales@domain1

login to webmail as the end user eg user2 (for domain2) and setup the profile for that user to show the return email address of sales@domain2

Do the same for all other webmail accounts that will be issued configuring the profile and return address as applicable.

If you don't configure webmail profiles manually then they will have the default return address of loginusername@domain1 (or the main domain name of the server if different).


Summary eg For user1 for domain1

The user account will be user1 (eg johnb) and the person uses that name (& corresponding password) to login to the server or to webmail. The email address for the user will be the same as the pseudonym ie sales@domain1 and that is the address the user should publish and use as the return email address. Obviously the name before the @domain is different to their login username, that's the compromise to be accepted if using sme this way. It is quite common in practise, as users often have different "position related" pseudonyms anyway eg manager@domain1 forwards to user1.

As the user account user1 has been created on the server, then that will also work as a valid email address ie user1@domain1 will deliver email to user1, but note also that email "inadvertantly" sent to user1@domain2 or user1@domain3 or user1@domain4 will also be sent to user1. This is not usually a problem as you simply don't tell user1 that any other hosted domain addresses will work for that name.


Alternative configuration of users

If the above method is not acceptable/desirable, then the only other way you could setup users is to have only one occurrence of a user name in the system eg john, john1, john2, john3, johnb, johnb1, johnb2, johnw, johnws etc, similar to what ISP's do anyway.

Every username will be a valid (email address) for every domain hosted on your server, but you only tell the end user about their domain eg john@domain1 john2@domain1 john3@domain2 johnb@domain1 johnb2@domain2 johnb3@domain3 etc

but john@domain2 and john@domain3 etc will still work.

Any email sent to any of the addresses will automatically be received by the end user account, and the user account name and login name will be the same. There is no need to configure pseudonyms in that case.

You will still need to configure Webmail profiles manually for each domain that is different to the default domain.


The ultimate answer to having separately administered domains and identical user names at different domains, is to host only one domain on each SME Server ie have a different server for every domain. There are posts in the contribs.org forums explaining how to do this and forward/delegate email for different domains from one gateway server to other server-only boxes on the same LAN using the same Internet connection.

See this thread for details http://forums.contribs.org/index.php?topic=30953.0
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #10 on: July 16, 2008, 10:20:01 PM »
That is the reason for my question on need of additional documentation.

It is well documented in the manual.

It IS a question that has been asked multiple times.

This thread in the forum "may" make it easier for some to find the answer.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #11 on: July 16, 2008, 10:46:28 PM »
ber & mercyh

I don't have a problem about something being added to the FAQ, but perhaps it should just link to the manual and to this or other forum posts.

It seems to be a subject that some users cannot easily "get their heads around", perhaps because they do not read the manual, or perhaps it is just a tricky concept due to the "one name set" issue.
I think admins start off naming their user accounts "inappropriately", and then cannot use those same user names to create different domain based email addresses. They persist with trying to use those original user names, but the concept they are applying is obviously wrong then, whereas they should use a different naming structure altogether eg domain based pseudonyms.

To ber, perhaps you should comment, is the manual clear enough or not ?
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #12 on: July 16, 2008, 10:49:55 PM »
Quote
but perhaps it should just link to the manual


I was thinking the same thing after posts #9 and #10.

I think I will wait a bit and see if anybody else has any input.....

Offline e[nt]e

  • *
  • 172
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #13 on: July 17, 2008, 12:38:48 AM »
The already existing documentation about this thing is, as stated, quite detailed.
Maybe let's add the section to the FAQ as mercyh suggested, using mary's post with it's, in my opinion, easy to understand instructions. But nevertheless link to the detailed section in the manual from there.

Just my 2cent
1984 wasn't meant to be a manual.

Offline ber

  • ****
  • 239
  • +0/-0
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #14 on: July 17, 2008, 12:48:03 AM »
 :-)Hi thanks for the input, yes the manual is clear my problem is trying to get my head around the fact that the server uses "one name set" and this impacts upon getting the right setup for the different accounts and domains etc...
This is indicative of the server and must be grasped in order to appreciate how to use the pseudonyms/accounts etc work...
Its a comprehension issue with me and the more I work through with it its becoming clearer...I'm a new user and am enjoying the learning curve.
Im thin on the ground with server admin experience and it shows by my post.
Marys points are well put.
"It seems to be a subject that some users cannot easily "get their heads around", perhaps because they do not read the manual, or perhaps it is just a tricky concept due to the "one name set" issue.
Hope the feedback helps in someway. Thanks again

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #15 on: July 17, 2008, 02:53:51 PM »
I will add the section to the FAQ in the next couple of days.

Thanks for all your input.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: Linux SME 7.3 Multiple Domain Hosting- HOW TO???
« Reply #16 on: July 17, 2008, 05:31:09 PM »