inmar project
The following steps are for the Ubuntu
I've configured the basic ec2(t2.micro) of ubuntu server (16.04) AMI
sudo apt-get update
sudo apt-get install build-essential python-dev libpq-dev
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install redis-server
sudo apt-get install rabbitmq-server
sudo apt-get install supervisor
sudo apt-get install nginx
sudo -u postgres psql postgres
`
create database inmar;
create user inmar with encrypted password 'inmar';
\q
'
sudo apt-get install python-pip
sudo pip install virtualenv
Note: Incase if you get any error then
`export LC_ALL=C`
mkdir env
virtualenv inmar
source inmar/bin/activate
cd ~
git clone https://github.com/parthz/inmar.git
cd inmar
Note: you need to create a `.env` file to hold the configuration of the following
Your `~/inmar/inmar/.env` should like following
AWS_ACCESS_KEY_ID=<aws_access_key>
AWS_SECRET_ACCESS_KEY=<aws_secret_key>
AWS_SECRET_ACCESS_KEY=<s3_bucket_name>
TORNADO_URL=http://127.0.0.1:8002/notify
DB_NAME=<db_name>
DB_USER=<db_user>
DB_PASSWORD=<db_pass>
DB_HOST=<db_host>
DB_PORT=<db_port>
REDIS_LOCATION=127.0.0.1:6379:1
cd ~/inmar/inmar/
pip install -r requirements.txt
source ~/inmar/inmar/.env
python manage.py makemigrartions
python manage.py migrate
mkdir ~/assets
python manage.py collectstatic
cd ~ mkdir Logs cd Logs touch inmar-webserver.log touch inmar-worker.log touch inmar-tornado.log touch nginx-access.log touch nginx-error.log
chmod u+x ~/inmar/deploy/web/gunicorn.bash
chmod u+x ~/inmar/deploy/worker/celery.bash
chmod u+x ~/inmar/deploy/tornado/tornado.bash
sudo ln -s ~/inmar/deploy/web/gunicorn.conf /etc/supervisor/conf.d/
sudo ln -s ~/inmar/deploy/worker/worker.conf /etc/supervisor/conf.d/
sudo ln -s ~/inmar/deploy/tornado/tornado.conf /etc/supervisor/conf.d/
sudo ln -s ~/inmar/deploy/nginx /etc/nginx/site-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl restart all
sudo service nginx restart
or
sudo nginx -s reload
If everything works fine then you should be able to see the app