Skip to content

A baseline installation of a Linux distribution on a virtual machine to host my web applications, to include installing updates, securing it from a number of attack vectors and installing/configuring web and database servers.

Notifications You must be signed in to change notification settings

saranvoleti/LinuxConfiguration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 

Repository files navigation

Project Overview

In this project, I have taken aa baseline installation of a Linux server and prepared it to host your web applications. l secured my server from a number of attack vectors, install and configure a database server, and deploy one of my existing web applications onto it.
The project is deployed at http://54.236.59.250/
IP addreess 54.236.59.250
Port 2200

Get started on Lightsail

Start a new Ubuntu Linux server instance on Amazon Lightsail. SSH into your server.

Create a new user named grader

  1. Sudo adduser grader
  2. generate keys on local machine usingssh-keygen
  3. Then, execute the following commands: a. $ mkdir .ssh b. $ touch .ssh/authorized_keys c. $ sudo nano .ssh/authorized_keys -- Copy the public key generated on your local machine to this file and save d. chmod 700 .ssh e. $ chmod 644 .ssh/authorized_keys

Update packages

To update all the currently installed packages, execute the following commands: sudo apt-get update sudo apt-get upgrade

Change the SSH port from 22 to 2200

To change port from 22 to 2200, execute the following commads:
  1. sudo nano /etc/ssh/sshd_config -- change Port 22 to Port 2200
  2. sudo service ssh restart

Configuring uncomplicated firewall:

1. sudo ufw allow 2200/tcp 2. sudo ufw allow 80/tcp 3. sudo ufw allow 123/udp 4. sudo ufw enable

Install Apache

  1. sudo apt-get install apache2
  2. sudo apt-get install python-setuptools libapache2-mod-wsgi
  3. sudo service apache2 restart

PostgreSQL

5. sudo apt-get install postgresql
6. sudo su – postgres
7. create a database and a user. Grant all priveleges to the user.
8. Exit from PSQL.

Do not allow remote connections


PostgreSQL from the Ubuntu repositories does not allow remote connections by default. You can check this at:

sudo nano /etc/postgresql/9.1/main/pg_hba.conf

Cloning Udacity Item Catalog Project:


9. sudo apt-get install git
10. cd /var/www
11. sudo mkdir FlaskApp
12. cd FlaskApp
13. sudo git clone https://github.com/saranvoleti/ItemCatalog_Linux.git
14. Rename the project's name to Flaskapp
15. Rename item_catalog.py to __init__.py using sudo mv item_catalog.py __init__.py

To Configure and Enable a New Virtual Host and to create a .wsgi file


To Configure and Enable a New Virtual Host and to create a .wsgi file follow the instructions given in https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps

References:

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps https://www.digitalocean.com/community/tutorials/how-to-secure-postgresql-on-an-ubuntu-vps

About

A baseline installation of a Linux distribution on a virtual machine to host my web applications, to include installing updates, securing it from a number of attack vectors and installing/configuring web and database servers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published