Amazon Web service EC2 ubuntu Public DNS: ec2-54-173-174-148.compute-1.amazonaws.com Public IP: 54.173.174.148
Active ports: http -> 80, 3000
If you would like to download the code and try it for yourself:
- Clone the repo:
git clone https://github.com/AlexTsiganov/GolfProgrammingWebApp.git - Open project folder:
cd GolfProgrammingWebApp - Install packages:
npm install - Set NODE_ENV to development
export NODE_ENV=dev - Launch:
npm startornode bin/www - Visit in your browser at:
http://localhost:3000
- Switch to local deploy branch:
git checkout deploy - Commit your last changes to deploy branch or merge with master
- Push deploy branch to github:
git push origin deployAfter that web server restart and download lash commits from deploy branch via github hook
- Copy GolfProgramming.pem to folder
ws ec2 access - Connect to cloud via bash/ec2-cloud without params:
./bash/ec2-cloud(default user: ubuntu) - NodeJS web server working in the background with forever module
If forever doesn't working, start web server:
forever start bin/wwwCheck the current bg web servers:forever listStop all web servers:forever stopall - Project directory at
/home/ubuntu/GolfProgrammingWebApp
Be very careful with the editing database; errors can lead to data loss
- Connect
mysql -u golf -ppassword: golf - Select database:
use golf_programming - Show tables:
show tables; - All tables duplicate into
Database/tables.txt
export NODE_ENV=production echo export NODE_ENV=production >> ~/.bash_profile
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
create database golf_programming; grant all on golf_programming.* to 'golf' identified by 'golf';