ECO Districts Hampton Roads is a progressive project in Hampton Roads, Virginia. The building foundation for ECO Districts derives an emphasis on three imperatives--climate action, resilience, and equity. With over 5,000 homes and 12,000 residents in the community, in order to progressively transform a community of this size, communication is key. With the push of modern technology through websites and mobile applications today, the managing director of ECO Districts Hampton Roads, Gary Harris, decided that a web-based platform would promote community involvement which is where our team plays a role.
Linux Sever Configuration for Hampton Roads application
The Hampton Roads application is now running on the Linux sever on the Apache2 environment.
Visit http://hamptonroads.ga to see it.
If the link doesn't work, try http://50.17.107.48.xip.io
Note: if you use your personal VM environment like vagrant or VMware, go to see "Keep the sever up-to-date" section
public IP Address: 50.17.107.48 private key is not provided here
Open ports are:
- SSH Port: 22
- HTTP: 80
- NTP: 123
To Action From
-- ------ ----
22 ALLOW Anywhere
80/tcp ALLOW Anywhere
123 ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
123 (v6) ALLOW Anywhere (v6)
Download the private key and locate it under your path ~/.ssh/
Open a terminal window and type:
ssh username@50.17.107.48 -p 22 -i ~/.ssh/keyname
After login-in via the terminal, type:
sudo adduser <new username>
sudo touch /etc/sudoers.d/<new username>
sudo nano /etc/sudoers.d/<new username>
And on the nano widow, type:
<new username> ALL=(ALL:ALL) ALL
type CTRL+X, 'y' and ENTER to save and exit
On the client computer, open terminal and type:
ssh-keygen
By following the step, you can generate private and public key in the path ~/.ssh
Now you should copy the value of key into the server.
On your server side terminal, type
sudo nano .ssh/authorized_keys
Copy the public key value into this and save
Give permission by typing
chmod 700 .ssh
chmod 644 .ssh/authorized_keys
sudo ufw allow 2200
sudo ufw allow 80
sudo ufw allow 123
sudo ufw enable
sudo apt-get update
sudo apt-get upgrade
python -m pip install --upgrade pip
sudo apt-get install apache2
sudo apt-get install libapache2-mod-wsgi-py3
sudo apache2ctl restart
sudo apt-get install git
sudo apt-get install python-pip
sudo apt-get install python-pip3
sudo -H pip3 install Flask-SQLAlchemy
For python2:
pip install flask
For python3:
pip3 install Flask
If those doesn't work try: For python2:
pip -H install flask
For python3:
pip3 -H install Flask
sudo apt-get install postgresql
sudo -u postgres createdb hamptonRoads.db
sudo -u postgres createuser daewoong
sudo -u postgres psql
psql=# alter user daewoong with encrypted password daewoong;
psql=# grant all privileges on database hamptonRoads.db to daewoong;
To edit:
sudo nano /etc/apache2/sites-enabled/000-default.conf
Add the lines of the codes into the file:
<VirtualHost *:80>
DocumentRoot /var/www/html
WSGIScriptAlias / /var/www/html/app.wsgi
<Directory /var/www/html/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
import sys
sys.path.insert(0, '/var/www/html/')
from __init__ import app as application
application.secret_key = 'super_secret_key'
sudo tail /var/log/apache2/error.log
When linux server is not updated: https://serverfault.com/questions/265410/ubuntu-server-message-says-packages-can-be-updated-but-apt-get-does-not-update
How to make username and password for database in PostgreSQL: https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e
Change ssh port: https://www.godaddy.com/help/changing-the-ssh-port-for-your-linux-server-7306