Custom domain for an IBM Cloud static website - custom-domain

The problem I am trying to solve is to configure a custom domain name, such as example.com and www.example.com for an IBM Object Storage Static Website. The part I especially need help with is the domain validation part.
Using the tutorial Accelerate delivery of static files using a CDN I have created an IBM Cloud Object Storage Static Website. My browser says that site (page) is dangerous but I am not sure why; that address is the public endpoint for the index.html document.
I tried to configure static.whateversam.com for the site. Currently the DNS does not have a CNAME or A record. I have created a CDN (Network) resource. The status is Domain validation required. When I view the details of that then view domain validation I get a pop-up with 4 tabs. The first tab is for CNAME and the description says ONLY if your domain is not serving live traffic. I do not know what that means but I seem to be using that. The second tab is for Challenge domain. I have tried to use that but when I try to edit the CDN details I am unable to edit the CNAME and other settings.
The tutorial uses static.yourdomain.com for the domain. I am not sure I can use the same procedure for www.yourdomain.com and for yourdomain.com. I am interested in complete and understandable instructions for configuring a custom domain for an IBM Object Storage Static Website but that might be a separate question.

Related

Naked Domain not working in Firebase and Google Domain

I created a free hosting account in Firebase and uploaded a single page site. It works
I have a custom Domain with Google Domains. I connected my custom domain and added the two IP address given by Firebase in Google Domain DNS A records. The connection is successful
Problem:
My website is working not working when I access it like http://moonstarinc.com
But it works well for any of the following URLs
www.moonstarinc.com
http://www.moonstarinc.com
I am trying to setup this URL for admob - URL: https://moonstarinc.com/app-ads.txt
You can refer to here:
https://firebase.google.com/docs/hosting/custom-domain#domain-key
Apex domain
Common inputs include:
#
The apex domain name (for example, example.com)
Leaving the Host field blank
Subdomain
Common inputs include:
The full subdomain name (for example, app.example.com)
Only the subdomain portion (for example, app only, and leaving out .example.com)
Only www for the subdomain of www.example.com

concerns about required A records for setting up Firebase Dynamic Links with a custom subdomain

In setting up our own subdomain to handle Firebase Dynamic Links using these docs, the wizard says to put the A records at example.com in our DNS. I'm getting pushback from our network administrators who are wary of creating an A record at the root of our domain, which is a large e-commerce web site.
A couple of concerns/questions about this:
The IP addresses required (151.101.1.195 and 151.101.65.195) point to non-Google servers (looks like Fastly), which is a bit alarming - it seems strange that Google would outsource their deep link hosting.
We don't want all of our e-commerce traffic (coming through example.com) to be subject to these A records. Is it possible to put the A records at link.example.com instead?
The Firebase documentation on using a custom domain for dynamic links has this note:
To use a custom domain for Dynamic Links, the domain must point to Firebase Hosting. If you have a domain you want to use with Dynamic Links and the domain points to a different host, you can either move to Firebase Hosting or create a subdomain hosted by Firebase, which you can use for Dynamic Links.
So you can indeed use a subdomain for the dynamic links. In that case, just set up the subdomain in Firebase hosting. You'll need the same TXT record as normal, to prove that you have access to the domain, but then just map the subdomain (e.g. links) for the A record.
Here is the answer I received from Firebase support about these my two concerns/questions:
Regarding Fastly, Firebase uses this subprocessor to deliver content and managed services on Firebase Hosting. For more details you could check the list of Subprocessors used by Firebase on this doc.
It's possible to use a subdomain as your Firebase project's FDL domain. You'd need to create a subdomain (link.example.com) on your domain's DNS provider and connect it to Firebase Hosting. You could check out this guide for more details.

Redirecting a domain to wordpress on google cloud platform

I installed WordPress on google cloud platform the first time in my life and besides of a few hick ups I could make it work, but one thing that seems really tricky is pointing a custom domain to WordPress. Here is what I have done so far:
On Google Cloud Platform
Created custom zones
Changed the external ip from ephemeral to static
In Wordpress
Changed the WordPress address URL and site address URL to swiftplayground dot io
On Google Domains:
Added the custom name servers:
ns-cloud-c1.googledomains.com
ns-cloud-c2.googledomains.com
ns-cloud-c3.googledomains.com
ns-cloud-c4.googledomains.com
Added custom resource records:
Now if I type 146.148.50.166 into the browser it redirects me to the right domain and website, but nothing happens if I type directly swiftplayground dot io
please help... :(

Can I Setup a localhost virtual host on google analitcs

I have a virtual host, say, http.mylocalhost.com on my localhost. I want to use google analytics. Can I create project with my this virtual host on google analytics and it starts working of tracking the visits and every thing?
If you have a public facing address associated with a web server that can be reached, then yes, you can put their validation code inside your header or the html file in your directory and it will validate it and you are good to go. But if not, then I don't see how you would get the data sent for aggregation or analysis.

How do I allow a user to use their own domain name for a hosted service?

I am working on an ASP.NET MVC web app that allows people to publish content, but other than publish the content to a remote server, I want to allow people to use their domain name directly. For example, the user "Tom" can have his domain name TomSite.com point to http://www.mywebapp.com/user/tom, but the sub path will also be mapped. For example, TomSite.com/path will be mapped to www.mywebapp.com/user/tom/path, and this is transparent to the web visitor. The visitor will never see "mywebapp.com" anywhere on TomSite.com.
I think Smugmug.com provides such service, to allow people to use their own domain name for the photo portfolio. I want to achieve the same result.
How can I do this? Thanks!
This require multiple steps.
First you have to find out how your users will configure their domain to have a CNAME record for you site. You can archieve this in a number of ways where the best is education. Making partnerships with hosting providers requires a great deal of volume.
In IIS this will require you to either add each host name manually (however this could also be archieved through scripting) or have a dedicated IP address only for you site.
There is also a need for the domain to be associated with an account. The user has to add this themselves and you would probably add a check in the interface which confirms the domain is pointed at your server. The code for this would look like (remember to include the System.Net namespace).
if (Dns.GetHostEntry("www.user.example.com").HostName == "www.example.com")
{
// www.user.example.com is a CNAME for www.example.com
}
In you ASP.NET MVC project you need to implement routes for this particular purpose. Create a custom class inheriting from Route which also takes the domain into account.
Smugmug (who you mentioned) get their users to setup a CNAME record that will alias the url for the user's personal photo section. For most users this will probably require them contacting their host or looking up help files in order to get it all setup.
So, while www.tomsite.com could transparently serve up pages hosted at www.mywebapp.com the users will have to put some kind of effort in. To make it a completely seamless you will need some kind of arrangement with the users web host (Smugmug appear to have such an arrangement with GoDaddy).
I doubt you will be able to setup such integration with all the web hosts out there, so the only complete solution would be to host the websites of your users yourself (I do not know enough about your wider situation to determine if that is a reasonable solution).
Note: setting up an alias on your own web server (aka url rewriting) will not work, unless you host their site yourself, as obviously people fetching from your user's domain will not arrive at your server in the first place.
Have each customer's friendlyname pointed at the external ip address of your webserver.
Use IIS to resolve the friendlyname specified in the host header request to the logical website you want delivered to that friendlyname. IIS will happily map both a website and a virtual folder to the same folder in the file system. Create a website for each customer. Then bind that website to the customer's friendlyname.
Remember to map the default website only to your own friendlyname(s). If you leave it in promiscuous mode (mapped to "*") results will be unpredictable.
To set host header mapping
Select Default Web Site under the Sites node. In the Actions pane at top right click on Bindings... to open the Site Bindings dialog. There will be a list of bindings, probably containing a single entry that says http * 80. Select this and click the Edit... button. Set Host name to your own friendlyname.
Run IIS7 Manager and for each customer site create a website under the Sites node. Set both file path and host header binding while you are creating each web site. Obviously the host header binding (host name) should be that customer's friendlyname.
Just make a new record in your webserver setting tomsite.com directly to your mywebapp.com/user/tom/ path ?
See it like an alias :)
Ofcourse, since you're asp.net/windows based, i think you'll have to digg deep into IIS to automate this kind of stuff. If you were on apache it would be adding 3 simple lines to httpd.conf.

Resources