-
Notifications
You must be signed in to change notification settings - Fork 22
Installation on AWS
By vanshyp
Follow this tutorial to launch a Linux VM on Amazon EC2: https://aws.amazon.com/getting-started/launch-a-virtual-machine-B-0/
HTTP TCP 80 0.0.0.0/0
ssh -i ~/.ssh/MyKeyPair.pem ec2-user@{IP_Address}
sudo yum update
sudo -s
curl -sL https://rpm.nodesource.com/setup_6.x | bash -
yum install -y nodejs
exit
sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo nano /var/lib/pgsql9/data/pg_hba.conf
File content:
local all all trust
host all 127.0.0.1/32 trust
sudo service postgresql initdb
sudo service postgresql start
sudo -u postgres psql postgres
postgres=# \password postgres
postgres=# CREATE DATABASE euro2016;
postgres=# CREATE USER blabla password 'blibli';
postgres=# GRANT ALL ON DATABASE euro2016 TO blabla;
postgres=# \q
sudo nano /etc/sysctl.conf
net.ipv4.ip_forward 1
sudo sysctl -p /etc/sysctl.conf
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -A INPUT -p tcp -m tcp --sport 80 -j ACCEPT
sudo iptables -A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
sudo yum install git
git clone https://github.com/syxolk/euro2016.git
cd euro2016
npm install
sudo npm install -g bower
cp template.config.coffee config.coffee
nano config.coffee
File content:
URL origin of the web server
origin: 'http://My_IP_Address'
PostreSQL connection URL
db: 'postgres://blabla:blibli@localhost:5432/euro2016'
Password registration captcha
recaptcha:
key: 'My_KEY'
secret: 'My_SECRET_KEY'
sudo npm install -g forever
forever start index.js
If at any point you need to restart the app:
forever restart 0
If you reboot your server instance, don't forget to restart postgres and run iptables rules (or retain these settings the advised way).
You have to register for services listed in the config file and get security codes from these services to fully get up and running. Mailgun requires a domain name. There are several free options.