I am planning on creating several sites for a client, and one of the requirements is a shared membership base.
I'm not quite sure as to how to start on this one. Perhaps I can reuse the existing .net membership api by creating a common user control for registering users, that populates the members table accordingly for different sites. I can then perform other login features out of the box.
Or would I have to implement a custom membership provided completely. Any pointers on where to start looking would be greatly appreciated.
If possible I would suggest running all of your sites from a single umbraco instance, that way they could use and share the umbraco membership provider. If not your best choice is probably the .net sql membership provider.
+1 on chris' suggestion, use a single umbraco installation for all sites for a same client, making it possible oob to share membership stuff across all those sites.
Thanks for the suggestion. My problem is that I would be using entirely different domain names for these sites, so I'm hesitant to mix them using the same umbraco installation. From what I know, you can only change the host header names, but use the same IP-port combination in IIS to access these two sites. Perhaps i am mistaken here?
You can use different domains names (host header) as well as ip/port combination. In IIS add multiple site bindings to a single website and for each binding you can specify a combination of IP/PORT/HostHeader. You would then use the managehostnames in umbraco option to specify which site (root start node) each "hostname" would use.
If you use the ASP.NET SQL Membership Provider it's completely separate from Umbraco. You can then have the database tables outside of the Umbraco database (as it has its own connection string) and this database is then shared between multiple website instances.
If you want the capability of logging into site A and being logged into site B then well, that's a whole different problem. Single Sign On is a bitch.
Thanks Chris, I did try doing this, but it keeps throwing 404 errors. I must be missing something obvious, as this seems pretty basic. (forgive me as this isn't directly relevant to the topic)
In IIS 6 I set up two mappings for my web site:
127.0.0.1 :80 with host header 'test1'
127.0.0.1 :80 with host header 'test2'
and in the umbracoSettings.config file, made sure the tag under <requestHandler> was set as:
<useDomainPrefixes>true</useDomainPrefixes>
In umbraco I clicked "manage hostname" for site 1 and site2 and set them to test1 and test2 respectively. I then republished the two sites to update the cache.
If you're running multiple sites under the same umbraco install locally I would suggest using the host file. This is your "local dns". This way you can access the individual sites in umbraco by a name rather than ip address.
Host file can be found at : c:\windows\system32\drivers\etc\hosts.
If you're opening the file on vista you will need to open notepad as run as admin.
Make an entry at the end of the file for each of your hostheader names like this:
127.0.0.1 test1
127.0.0.1 test2
This points those names to the localhost or (127.0.0.1). Make sure your host headers in IIS, and in umbraco match the hostnames you specify in the hosts file. When you go to production you will need to obviously redirect your dns for the real domains to your server with umbraco.
Thanks for the quick reply Chris. (Almost) getting it to work now.
Thing is I can't assign an individual hostname to a site. Now both host names bind to site 1.
So I tried logging in again, and both the host names are missing, even though the properties tab of my site 1 header contains the alternate links of http://test1 and http://test2.
Guess i dug up a bug :-)
I think I should be able to figure it out from here. Thanks a lot again, great support!
Got it working, finally! Trick is to add a hostname using "manage hostname", and then re-publishing the site before adding the next hostname for site 2.
Sharing membership across sites
I am planning on creating several sites for a client, and one of the requirements is a shared membership base.
I'm not quite sure as to how to start on this one. Perhaps I can reuse the existing .net membership api by creating a common user control for registering users, that populates the members table accordingly for different sites. I can then perform other login features out of the box.
Or would I have to implement a custom membership provided completely. Any pointers on where to start looking would be greatly appreciated.
If possible I would suggest running all of your sites from a single umbraco instance, that way they could use and share the umbraco membership provider. If not your best choice is probably the .net sql membership provider.
Here is a similar post on this topic: http://our.umbraco.org/forum/getting-started/installing-umbraco/3603-Shared-membership-database-between-Umbraco-sites?p=0
-Chris
+1 on chris' suggestion, use a single umbraco installation for all sites for a same client, making it possible oob to share membership stuff across all those sites.
Cheers,
/Dirk
Thanks for the suggestion. My problem is that I would be using entirely different domain names for these sites, so I'm hesitant to mix them using the same umbraco installation. From what I know, you can only change the host header names, but use the same IP-port combination in IIS to access these two sites. Perhaps i am mistaken here?
You can use different domains names (host header) as well as ip/port combination. In IIS add multiple site bindings to a single website and for each binding you can specify a combination of IP/PORT/HostHeader. You would then use the managehostnames in umbraco option to specify which site (root start node) each "hostname" would use.
So,
www.clientsite1.com (ip 10.12.4.10:80) - > IIS (Defaultwebsite) -> Umbraco
www.clientsite2.com (ip 10.12.4.11:80) - > IIS (Defaultwebsite) -> Umbraco
A wiki to get you started: http://umbraco.org/documentation/books/running-multiple-websites-on-one-umbraco-installation-(1)/setting-up-umbraco
-Chris
If you use the ASP.NET SQL Membership Provider it's completely separate from Umbraco. You can then have the database tables outside of the Umbraco database (as it has its own connection string) and this database is then shared between multiple website instances.
If you want the capability of logging into site A and being logged into site B then well, that's a whole different problem. Single Sign On is a bitch.
Thanks Chris, I did try doing this, but it keeps throwing 404 errors. I must be missing something obvious, as this seems pretty basic. (forgive me as this isn't directly relevant to the topic)
In IIS 6 I set up two mappings for my web site:
127.0.0.1 :80 with host header 'test1'
127.0.0.1 :80 with host header 'test2'
and in the umbracoSettings.config file, made sure the tag under <requestHandler> was set as:
<useDomainPrefixes>true</useDomainPrefixes>
In umbraco I clicked "manage hostname" for site 1 and site2 and set them to test1 and test2 respectively. I then republished the two sites to update the cache.
I tried going to http://test1 , http://127.0.0.1:80/test1, but they all keep throwing 404 errors. Any ideas what I'm missing here?
Thanks a lot!
@slace:Thanks mate, I might well end up taking this route.
For single sign on, I guess a crossover-key could be used between sites, but yeah getting it running might be a pain ;-)
If you're running multiple sites under the same umbraco install locally I would suggest using the host file. This is your "local dns". This way you can access the individual sites in umbraco by a name rather than ip address.
Host file can be found at : c:\windows\system32\drivers\etc\hosts.
If you're opening the file on vista you will need to open notepad as run as admin.
Make an entry at the end of the file for each of your hostheader names like this:
127.0.0.1 test1
127.0.0.1 test2
This points those names to the localhost or (127.0.0.1). Make sure your host headers in IIS, and in umbraco match the hostnames you specify in the hosts file. When you go to production you will need to obviously redirect your dns for the real domains to your server with umbraco.
Now you should be able to access your sites by http://test1 and http://test2
-Chris
Thanks for the quick reply Chris. (Almost) getting it to work now.
Thing is I can't assign an individual hostname to a site. Now both host names bind to site 1.
So I tried logging in again, and both the host names are missing, even though the properties tab of my site 1 header contains the alternate links of http://test1 and http://test2.
Guess i dug up a bug :-)
I think I should be able to figure it out from here. Thanks a lot again, great support!
Got it working, finally! Trick is to add a hostname using "manage hostname", and then re-publishing the site before adding the next hostname for site 2.
I guess it's an issue with the cache.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.