As far as I know, cloudbees is using nginx servers for routing the requests.
I am wondering if there is a way to drop my static files on nginx to make it serves my static files and save some load on my application server.
M.
On runtime the file system is "ephermeral". You have more info about it here.
You should use an external service like Amazon S3. The Amazon S3 ClickStart explains how to use this service from CloudBees.
You can also use other services like Dropbox or Google Drive.
Related
My application is hosted on Amazon Elastic Compute Cloud by the developer. I need to retrieve the source code for my web application. I am a new user so I need to know how can i download the source codes in my local host.
You need to log into the instance using SSH. If you're familiar with SSH then you can SCP from your local machine.
Of you're not familiar, you can use Systems Manager and transfer the data to S3 then download from there:
https://aws.amazon.com/premiumsupport/knowledge-center/systems-manager-ssh-vpc-resources/
I've put the database and files on separate servers (because I've set up 3 servers for our web application and use the load balancer for them) and I use SFTP for filestorage driver.
Because I've used the SFTP driver for Laravel file storage, the SSH connection to the destination server will increase and the SSH port will be block and the files cannot load from the storage server.
What should I do? is there any other solution to load files from another server?
I recommend using a cloud storage for this usecase, in which one can set the CORS settings. You could for instance use aws s3 for this or use digital ocean spaces which has a similiar api to s3.
You basically post your to that cloud server and save the url to your database.
Of course you need to set of the cors settings, to basically say that server x can access specific files on the cloud storage.
I'm building a small web application for a personal project. It will be an Angular web application which will talk to a Spring-Boot service layer which in turn will read/write stuff to MongoDb.
I hope to host all this on a single EC2 instance in AWS. My question is how to configure a web server (like Apache but doesn't have to be) to 'beautify' the URLs a bit. Example, without touching anything angular will run at something like host:4200 and the service layer at host:8080. I will then have to map a proper domain to host in AWS, but the hiding of ports etc is where it gets murky for me.
I want to be able to hit my web app at domain.com (no ports etc) and I also want my service layer to ideally have a similar setup e.g. domain.com/service (no ports etc).
How do I configure a webservice to do this for me? Examples or pointers to specific examples would be ideal, but even a pointer to the right documentation will be helpful.
This thread is kind of similar to what I want but not too helpful: How to deploy Spring framework backend and Angular 2 frontend application in any online server?
You can use a setup with AWS CloudFront as reverse proxy and CDN cache. You can map the Domain Name and SSL Certificates(You can use AWS issued free SSL Certificates through AWS Certificate Manager) to CloudFront while the EC2 instance is plugged as an origin behind CloudFront as shown in the following diagram.
In the diagram I have optionally added, which is a common practice in designing applications in AWS.
Hosting the Angular App in S3
Using Autoscaling & Loadbalancing for EC2 instances.
You need to use Apache or other web server as a reverse proxy. Start here -
https://devops.profitbricks.com/tutorials/configure-apache-as-a-reverse-proxy-using-mod_proxy-on-ubuntu/
You then will need to setup a custom domain name. The easiest option is to just use an ELB (now called Classic Load Balancer). More details are here -
http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html
I have an application hosted on EC2 instance.
Now I want to fetch all the static content used in application from Cloudfront.
Read from a source that Cloudfront uses S3/EC2 or private servers to get the static files.
I can't come to solution what exactly to use? Can I use same EC2 instance for this purpose? Any better option for this implementation?
Amazon CloudFront sits "in front" of your application on Amazon EC2 and/or your content in Amazon S3. It caches content in 50+ locations when people access your application.
For example, let's say you had a web app running on an EC2 instance serving HTML pages, and also some pictures in S3.
You would create a CloudFront distribution and configure two origins: one for your web server and one for your S3 bucket. Behaviours can be configured to tell CloudFront when to use each origin -- for example, serve *.htm URLs from EC2 and *.jpg URLs from S3.
Your users would then access your application via the supplied CloudFront URL. Content will be cached (if appropriate) at one of the 50+ CloudFront locations around the world that is closest to each of your users, resulting in faster response times for your user.
You can also use your own domain name with CloudFront so that it has a more-friendly URL than the one supplied on the CloudFront distribution (which looks like d3i7tv8nzqzfbt.cloudfront.net).
simply Amazon s3 is used for cloud storage where as Amazon EC2(elastic cloud) is used to server web pages(hosting) same as like godaddy.com.
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.