Project deployed on AWS EC2 Instance
URL of Hosted Application: http://ec2-34-203-238-215.compute-1.amazonaws.com/
- Download private key and write down your public IP address
- cd /Users/Desktop/key
- chown 400 yourKeyPair.pem
- ssh -i yourKeyPair.pem ubuntu@ip-address
- sudo apt-get update
- sudo apt-get update
- sudo adduser grader
- Password: grader
- Verify: grader
- sudo visudo
- We add the following line after the comment line, “User privilege specification”:
- grader ALL=(ALL:ALL) ALL
- sudo adduser grader sudo
- Switch to grader user
- sudo su grader
- ssh-keygen
- Enter file in which to save the key (/home/grader/.ssh/id_rsa): /home/grader/.ssh/grader
- /home/grader/.ssh/grader
- mkdir .ssh
- chmod 700 .ssh
- touch .ssh/authorized_keys
- chmod 600 .ssh/authorized_keys
- cat ~/.ssh/authorized_keys
- nano .ssh/authorized_keys
- Paste public key from previous step
- sudo vim /etc/ssh/sshd_config
- change Port value to 2200
- Change PermitRootLogin from without-password to no
- Temporalily change PasswordAuthentication from no to yes.
- Append AllowUsers grader
- sudo service ssh restart
- sudo ufw default deny incoming
- sudo ufw default allow outgoing
- sudo ufw allow 2200/tcp
- sudo ufw allow www
- sudo ufw allow ssh
- sudo ufw allow ntp
- sudo ufw enable
- sudo apt-get install apache2 libapache2-mod-wsgi git
- sudo a2enmod wsgi
- sudo dpkg-reconfigure tzdata
- From the menu I selected 'None of the above' and then 'UTC.'
- cd /var/www/
- sudo git clone https://github.com/juanv911/Restaurant.git
- sudo touch application.wsgi
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, "/var/www/Restaurant/")
from project import app as application
application.secret_key = 'secret'
- sudo service apache restart
- sudo apt-get install postgresql postgresql-contrib
- sudo -i -u postgres
- createuser --interactive
- createdb catalog
- psql
- \password catalog
- sudo apt-get install git-all