Wednesday, October 15, 2014

Notes on setting up Ubuntu 14.04 Django server

Ubuntu 14.04 / python / Django / uWsgi / Nginix / postgres / postgis / upstart

# Notes and reference on building Ubuntu 14.04 server

adduser skywalker
echo "skywalker    ALL=(ALL:ALL) ALL" >> visudo

nano /etc/ssh/sshd_config
Port 10022
PermitRootLogin no
AllowUsers skywalker
service ssh restart

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-virtualenv
sudo pip install virtualenvwrapper

sudo apt-get install mercurial

clone the repo

sudo apt-get install python-dev libffi-dev

maakevirtualenv starwars
workon starwars
pip install -r requirements.txt

sudo apt-get install libpq-dev
sudo apt-get install postgresql postgresql-contrib

sudo adduser yoda
sudo -u postgres createuser -D -A -P --superuser yoda
sudo -u postgres createdb -O yoda starwars

workon starwars
python migrate
python runserver

sudo apt-get install nginx
sudo cp code/starwars/conf/djago /etc/nginx/sites-available
ln -s /etc/nginx/sites-available /etc/nginx/sites-enbled
sudo service nginx restart

mkdir /home/skywalker/code/starwars/log
sudo chmod -R 777 /home/skywalker/code/starwars/log

sudo mkdir /opt/django-nginx-uwsgi/
sudo chmod -R 777 /opt/django-nginx-uwsgi/
sudo chown skywalker:www-data /opt/django-nginx-uwsgi/

sudo usermod -g www-data skywalker

sudo cp /code/starwars/conf/upstart.conf /etc/init/uwsgi.conf

sudo reboot

## important

iptables -L
cat /etc/host.conf 
cat /etc/hosts.allow 
cat /etc/hosts.deny 
netstat -tulpn | grep ssh

## setting up SSL - Reference

## Hardening SSL

1 comment:

  1. Best bets for soccer today - Sports Toto
    Today, we're going to tell you febcasino a few key to checking 도레미시디 출장샵 into soccer betting apps. of the most popular soccer septcasino betting options and 토토사이트 which ones will