Subdomains on Windows Azure - subdomain

I've got a Windows Azure project I'm working on. It has two web roles - one is a public-facing site, and the second is an administration site for my customer to make changes to the database etc.
I had expected to be able to use a subdomain for each role - so for example have mysite.com and admin.mysite.com (obviously CNAME-mapped to the .cloudapp.net DNS name). However it looks like Azure doesn't do this, and instead has one subdomain (mysite.com) with different ports for each web role. So, for example, I would have mysite.com:80 for the main public site, and mysite.com:8080 for the administration.
Is this correct? Is there no way I can have subdomains for particular web roles?
Thanks in advance
John

This is correct. You can, of course, respond to both subdomains in a single role. But multiple web roles in Windows Azure correspond to multiple ports on the same virtual IP address.

Related

In Blazor, can I share user login across multiple apps?

I'm separating one super-large Blazor app (an English education site) into two separate solutions for independent development: the main educational site, and a second gaming app.
Given that the two are hosted as apps under the same IIS site, will they share their login credentials? If not so by default, is there any way to achieve this?
Specifically, I want someone who is currently signed in under the main app to be able to navigate to the gaming section under the same credentials, but I want oustide users (who may not even know about the educational site) to be able to register and login to the gaming app.
Both apps share the same SQL database, and use the default Blazor identity system.
Yes, you can integrate with external authentication services. That will serve as centralized login service.
Azure B2C for example:
https://learn.microsoft.com/pt-br/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory-b2c?view=aspnetcore-7.0
There are others services like aws aws cognito. Also you can create your own authentication service.

How can I point one domain to different websites

I have two pages built with two website builders. One with Wix.com, and the other using kickofflabs.com. I want to host both of the pages to my domain and hosting. I can only host one now, how can I host two? I used CNAME in pointing on of the websites.
Thanks in Advance!
The closest thing would be to create one or two subdomains, and point each one of those at the appropriate hosting. For instance, page1.domain.com would point to your wix.com page, and page2.domain.com would point to your kickofflabs.com page.
See this SO question: Subdomain on different host
To be honest, you'd probably be better off in the long run just using one website builder.
you should use an a record to point your domain to server. and you should config that server to receive that request

Firewall management on OpenShift

I am creating a SOA application and I would like to separate out logic in multiple OpenShift applications. The problem is, that some of the applications aren't supposed to be accessible from the internet -- only private services are going to use them.
I would like to allow access to those applications only from specific domains (lets say appB-domain.rhcloud.com and appC-domain.rhcloud.com). Is it possible to do that somehow on OS/OpenShift (like firewall rules and I haven't found about them in the docs)? Or must I do that in application level?
Thanks
You need to do that at the application level. There are no firewall rules that you can change, for instance, you can not update iptables.

Single database for many domains approach

Good morning.
I have to build a system (php/mysql) that run in a 20 domains for 20 different cities (for example). The system that run in this 20 domains is identical, the database too.
My issue is: I pretend to create a single database to serve this 20 domains, controlling the cities by something like city_id.
I wish to know if this is the best practice, or if the right way is create one database to each city/domain.
The domains are hosted in the same server, the core system is out of public_html directory.
/mysystem_classes
/public_html/city1.com
/public_html/city2.com
/public_html/city3.com
/public_html/city20.com
To serve images, css and js I will work with something like a CDN.
Normally you would setup just one virtual host, install your application there and let all the domains point to that software. Which domain points to which website is not specified on the server level, but on the application level in that case.
TYPO3 for example works like that when building multiple sites with one instance of TYPO3 and the used MySQL database. (using TypoScript or the backend configuration to define which domain belongs to which site-ID)
Wordpress has a multisite feature, which could be set up easily to use several subdomains. It uses one database and a single software instance but can deliver multiple blogs to different domains. (e.g. city1.example.org, city2.example.org). You will need to setup a wildcard domain (i.e. *.exqample.org) to let all possible subdomains point to the single vHost. This is similar to how the basic Wordpress.com-Blogs work. See: http://codex.wordpress.org/Create_A_Network
I believe you are looking for Mysql replication.

Web application Development - Subdomain

I'm currently at the very early design stage of building a web app that will be used by companies. Each company will have many departments and each department many staff. Each department will manage its own application with staff logging onto the application.
There is the possibility that staff across different organisations will have the same staff id. For that reason, I'm thinking of going with subdomains. Each company will have its own subdomain. I've googled a bit about using subdomains and have seen a number of positives, however not too many negatives except for the SEO implications (which do not interest me really.. this app will require direct contact with each organisation.. it's very specialised)
Can anybody think of any other disadvantages to going with subdomains? Can anyone think of a better way of doing things?
Regards,
Fiona
Your login information will presumably be in a database table somewhere. You will either need separate databases for each company and will need to identify which database to use. Or you will have all users in one table, with some sort of company id - and you will need to determine which company id to add to your login query.
You can make either of these determinations based on subdomain, or on a company-specific login page, or directory, or you can ask them to pick which company they want to log in to (which would be pretty ugly).
Subdomains should work fine. You'll have to do DNS setup every time you add a company, or work out some apache magic. You may need SSL certificates for each subdomain (I think - I'm not well versed on those). Other than that, I don't see any big disadvantages or advantages as far as code or architecture go. Marketing may have a stronger case for one over the other.
You'll still want to use other methods of making sure that users don't have access to other companies' data, especially if other subdomains are guessable.
We also have a multiple-company application, but decided to make all logins unique. This makes it a little easier for us to identify users uniquely at the expense of occasionally having to explain why some username is not available even though that user's company isn't using it.
using sub domains is a good idea, the only concern i have is regarding the authentication of the users. I am a .net guy so i am bringing up this query, i am not sure if you are using asp.net for your development. In case you are using asp.net for developing this website and you are using the asp.net membership, profiles and roles for authentication and authorization, you would end up having security problems. Because a user after logging into http://abc.site.com would have access to the site http://xyz.site.com also. This is the default way the asp.net membership thing works. So you would need to keep this in mind.
Rest i think the sub domain philosophy is good enough.
Subdomains might work just fine with asp.net membership. Because the was the tables are created for the membership provider there is a aspnet_applications table which has fields for te application name and description. In the aspnet_memberhip table, each user has a field for applicationID. If the application name is the subdomain then you could possibly limit which user can gain access to which application. XYZ subdomian would be one application with it's own ID, and ABC application would be another one.
Interesting domain problem. Good luck and share your results after it's creation.