Can I host index.html (homepage) on the Rackspace CloudFiles CDN? - performance

I want to make my web app fast, especially the first page load (index.html).
Can I do this by hosting myfastapp.com on Rackspace CloudFiles and then have a subdomain called nodeserver.myfastapp.com which connects to a Node Server on Joyent.
Note: The node server will only connect via socket.io to tell the client which additional files to grab from the CDN (myfastapp.com).

There's a guide for this in the Cloud Files docs at Create Static Website.

There should be no issue with that the logistics of that.
The main issue is getting the main site on Cloud Files due to cname restrictions, at least in the Rackspace system, but it can probably be done.

Related

how to serve node js api through AWS cloudfront?

I am trying to serve my node js API (deployed on AWS EC2 and attached with application load balancer) through cloudfront url, is it possible?
Here are the steps I followed so far -
Created S3 bucket to host static website hosting
Created cloudfront distribution and linked S3 bucket with it. I can access S3 bucket contents with default url generated from cloudfront
Created custom origin for node js instance
Created behavior "api/*" to access node js API through cloudfront.
But when I am trying to access API with following url -
http://d3m30a4naen9t2.cloudfront.net/api/getItems
it throws "not found", it's not 404, this response is from EC2 server however the specified route exists.
Can anyone help please?
I am using ELB. I deployed my code which is on node.js, and everything is working fine. I was facing a lots of problem in ELB but finally we came to stable stage. If you want to serve your APIs then first use SSL which has lesser protocols in other words, use less secure SSL otherwise, your API will not be able to hit from any other source. Simply deploy your code through git or directly from filezilla and run the command on both servers (primary and secondary) as pm2 start index.js/server.js or whatever your main express file is.
Suggestion: Please be careful while selecting security certificates, because on ELB, if you do not follow the correct implementation, you will definitely face the problem of "API not accessible" or "Remote server is unable to connect".

create php web service and access to the internet

I have recently installed PHP, MySQL Server, and Apache web server. I played around with some PHP scripts locally on the PC to insert some entries to MySQL Database.
Noob question so please be patient with me:
How do I get my web service out to the internet, by self hosting? Say I already have a domain for example mydomain.com How do I make it so that when someone not within my network can access mydomain.com/something and can send some data so my server gets it and do anything with that data?
Webhosting
You have to have some form of webhosting. You pay for hosting and you can upload your PHP files to their servers. They will usually also have database servers you can use.
Your domain name has to point to those servers via DNS so the internet can reach your application. I'd suggest you search the internet for popular hosts that provide the tools your need for this.
Self hosting
Another possibility is to open your network up to the world, but this is not recommended unless you have network administration experience due the security trouble that comes with it.
In short: forward a port through your router to the machine running your application. The website portforward.com has instructions on how to do this but keep in mind that misconfiguration could lead to vulnerabilities in your network.
In order to make you site public
1. you need host
2. you need domain
there are bunch of hosting sites you should get one first.
This link explains very well about self hosting
https://www.boutell.com/newfaq/creating/hostmyown.html

Firebase hosting, and external APIs

Background
I'm currently using Heroku, running a single Hobby Dyno to serve both static assets and a simple API using node.js. I'm now looking to separate the static delivery and API into different dependencies. Having looked around, I'm now considering Firebase for static hosting.
Question
Using Firebase static hosting, is it possible to configure the DNS, or setup a URL rewrite, to make external API calls for a given URL, e.g.
http://myapp.com/api -> external API call to http://myapp.herokuapp.com/
http://myapp.com/* -> serve static file
If not, is it possible to configure a DNS entry to point www to Firebase, and api to Heroku?
Bonus Question
If possible; would this API call count as a cross-origin request? Preferably all requests would be made against the Firebase domain, and then everything done behind closed doors.
It is not possible to have Firebase Hosting rewrite the URL to a different server. While it is possible to have Firebase Hosting redirect the request to the Heroku server, that likely won't help you.
The common approach is indeed to split this in the DNS. Have api.myapp.com point to Heroku and www.myapp.com to Firebase Hosting.

Google Cloud Storage for dynamic website using HTTPS

Currently I'm hosting a client application written in AngularJS on Google Cloud Storage using the configuration described here.
I like this configuration because it acts as a CDN and we don't have to use a dedicated machine to host the frontend files.
The problem is that Google Cloud doesn't support HTTPS for custom domain names, and we want to improve our security standards serving at least the login page on an https domain.
¿Is there anyway we can keep the static files hosted on Google Cloud/some other CDN for fast serving and use an https domain?
Update
For anyone interested, we finally migrated all our CDN with HTTPS requirements to Amazon S3 + CloudFront and it works like a charm.
While Google Cloud Storage does support HTTPS, it does not support HTTPS for custom domain names.
Although you've found a solution not connected with your original question, I'm answering in case someone gets here with the same question like I did.
Google Firebase link is an excellent way to serve websites (and apps) as it is automatically through SSL (https) and Google Edge servers (effectively CDN function). And https will work using your own domain name. You can push your site from your local machine (Node.js needed) or from GitHub, Gitlab, etc. using continuous integration/deploy.
There is a generous free trial plan to try it first, then a reasonable monthly rate to pay as you go as your usage grows. plans

Have static site on Amazon S3 and Cloudfront, how to add sub-domain hosted elsewhere?

I have a site with a root domain (mysite.com) as a jekyll static page, hosted on Amazon S3 and Cloudfront. I'd like to add a sub-domain such as purchase.mysite.com which would be located on another provider such as Heroku. The intention here is to have a landing page backed with Amazons CDN and the services somewhere else as at that point I don't think the speed is as important. Has anyone else gone this route? How and what was involved with it's implementation? Is there a better way to accomplish the same goal?
This setup is pretty common I'd imagine.
You need to create a subdomain on your DNS using a CNAME record type pointing at the .herokuapp.com address that Heroku will give your application and then add the custom domain to your Heroku application.

Resources