docker:nodejs :git:EC2:ubuntu <網站發佈!>

How to Set Up a Node.js Web Server on Amazon EC2


【under ubuntu of EC2】
ssh-keygen -C "**@**.com"
ssh -T [email protected]
mkdir zhcwebsite
ssh -T [email protected]
git config --global user.name "**"
git config --global user.email "**@**.com"
git remote add ptomo_origin [email protected]:**/**.git
git pull ptonmo_oritin master 

$ which curl
$ sudo apt-get update
$ sudo apt-get install curl
$ curl -sSL https://get.docker.com/ | sh
$ sudo docker run hello-world

cd dockerTest2
sudo docker images
sudo docker build -t zhc_web_ptomo .
sudo docker images
sudo docker run -ti --rm -p 3011:3011 zhc_web_ptomo
【under docker】cd src
【under docker】grunt
【under docker】exit

【AWS management console】 Security Groups-->enable http:80 ports

【under ubuntu of EC2】
cat /proc/sys/net/ipv4/ip_forward

sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3011
sudo iptables -A INPUT -p tcp -m tcp --sport 80 -j ACCEPT
sudo iptables -A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT



【under web browser】 < public ip of your EC2 machine >

how do i set the dns server on godaddy with AWS

3:Allocate an Elastic IP and associate it with your instance. This is really easy and you can do this in AWS EC2 console. Where it says "Networking & Security" on the left, click on "Elastic IPs". Then click "Allocate New Address", then "Associate Address", and select the instance you created in step one.
Now you will have an elastic IP which is a number that looks like 175.41.240.45. Save that number because we will use it later.

4:Go to the Zone Editor in GoDaddy. Now log into GoDaddy and go to this link: https://dns.godaddy.com/default.... Or from the home page, go to Domains -> My Account -> Domain Management -> DNS Manager. Click "Edit Zone" when it appears.

5:Associate domain with Elastic IP. In the Zone Editor, you will see several tables. In the table where it says "A (Host)", find the entry where Host = "@". Click on that entry to edit the field for "Points to". Add the elastic IP you just got from Amazon. Click "Save Zone File" when you are done.

6:Complete. After a few minutes your domain should now start resolving to the web server you have on EC2.


7:For 1&1, you need to go to your domain parameters on their website. Then go to modify DNS parameters, then go to A / AAAA registration, choose "another IP address" and in Ipv4 or Ipv6 write your IP from aws server (or create an Elastic IP in aws and use this one for Ipv4).


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章