View Code? Open in Web Editor
NEW
Documented the steps of tweaking Linux server.
deploy-linux-server's Introduction
- The IP address and SSH port.
- The complete URL to the hosted web application.
- A list of third-party resources.
All system packages have been updated to most recent versions.
sudo apt-get update
sudo apt-get upgrade
sudo apt autoremove
sudo reboot
Change ssh port from 22 to 2200
sudo nano /etc/ssh/sshd_config
- Under the line: "# What ports, IPs and protocols we listen for". Modify
Port 22
to Port 2200
.
- Restart ssh
sudo /etc/init.d/ssh restart
Setting firewall on ubuntu.
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow www
sudo ufw allow 2200/tcp
sudo ufw allow 123/tcp
sudo ufw enable
sudo reboot
sudo adduser grader
sudo nano /etc/sudoers.d/grader
,
Add grader ALL=(ALL) NOPASSWD:ALL
in /etc/sudoers.d/grader
- Create a public key on localhost.
- Type following command as root to allow grader login into instance.
cd /home/grader
sudo mkdir .ssh
sudo nano .ssh/authorized_keys
- copy public key and paste to
.ssh/authorized_keys
- Login as grader and change the owner of public key to grader.
sudo chown grader:grader .ssh
sudo chown grader:grader .ssh/authorized_keys
chmod 644 .ssh/authorized_keys
chmod 700 .ssh
Configure the local timezone to UTC.
sudo timedatectl set-timezone Etc/UTC
Install and configure Apache to serve a Python mod_wsgi application.
sudo apt-get install apache2
sudo apt-get install libapache2-mod-wsgi
sudo apt-get -qqy install python python-pip
pip install --upgrade pip
sudo pip install flask packaging oauth2client redis passlib flask-httpauth
sudo pip install sqlalchemy flask-sqlalchemy psycopg2 bleach requests
Set up catalog web application.
- Follow tutorial to set up flaskapp.
- Clone catalog app to
/var/www/FlaskApp/FlaskApp
sudo a2dissite 000-default.conf
sudo service apache2 restart
deploy-linux-server's People
Contributors
Watchers