#1. install eb, tutorial
$ brew install awsebcli
$ eb --version
#2. start to deploy
$ eb init
$ eb create
$ eb setenv NODE_ENV=production
$ eb open
#3. set up custom domain
- Go here and under the Networking section, select Route 53
- Create a hosted zone for your domain
- In the domain name field, enter “yourdomainname.com” and make sure it is set to public.
- Inside of your hosted zone, create a new record
- In the name field, enter “www.yourdomainname.com” and make sure to set the type to A-IPv4 address, set the alias to yes, and then save the record
- Select the Manage option at the right of the domain you want to set up
- Select the Advanced DNS tab
- For the CNAME record, change the host column to @ from www. For the value, paste in your Elastic Beanstalk environment address. You can find your address inside your Elastic Beanstalk console on AWS
- For the url redirect set the host to www and set your domain url to “http://yourdomainname.com”
#4 use ssh to connect to ec2
ssh -i ~/Downloads/aws-es2.pem ec2-user@[public-IP]
#5. install node on a ec2 linux server
-> http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html