54.205.228.170:2200
54.205.228.170.xip.io
In order to have a properly running Python Flask application, certain packages needed to be installed. sudo apt-get install
was used to install all necessary packages unless otherwise noted.
apache2
for the web serverpython3-dev
for required python packageslibapache2-mod-wsgi-py3
for the python3 WSGI mod to run our applicationgit
to get our files from github and have a version maintenancepython3-pip
to allow for the installation of other python packagespython-flask
python-sqlalchemy
python-psycopg2
oauth2client
to allow for OAuth2 processesrequests
to allow for submission handling on the websitehttplib2
postgresql
for database managementpip3 install flask-dance[sqla]
to handle OAuth2 requests
On Amazon's Lightsail website, I added the port 2200 so that it could be used for SSH access. I then modified the /etc/ssh/sshd_config
file such that the server can only be remote accessed from port 2200, that root login is not allowed, and that a key is required to remote connect. The edited lines are below:
# What ports, IPs and protocols we listen for
#Port 22
Port 2200
# Authentication:
LoginGraceTime 120
#PermitRootLogin prohibit-password
PermitRootLogin no
StrictModes yes
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no
I then setup the ufw
firewall to allow only certain ports via:
ufw default deny incoming
ufw default allow outgoing
ufw allow 2200/tcp
which allows our SSH on port 2200ufw allow www
which allows access to our app through port 80ufw allow 123/udp
and began the firewall with ufw enable
-
Troubleshooting initial setup of the server was done through https://github.com/harushimo/linux-server-configuration.
-
Updated .conf file configuration from https://hk.saowen.com/a/0a0048ca7141440d0553425e8df46b16cdf4c13f50df4c5888256393d34bb1b9
-
All other troubleshooting was accomplished through the error logs and Udacity Coursework.