Skip to content

Install bm web server

bestchanges edited this page Apr 25, 2018 · 12 revisions

Prepare environment

sudo apt-get install -y python3-pip
sudo pip3 install virtualenv

NGINX

sudo apt-get install -y nginx
sudo vi /etc/nginx/sites-available/bestminer

Content (mind about static location, and proxy_pass port number)

server {
    listen 80 default_server;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/user/hellomoto22/server/bestminer;
    }

    location / {
        include proxy_params;
        proxy_pass http://localhost:5000;
    }
}

If you have apache2 installed, remove it:

sudo service apache2 stop
sudo apt-get --purge remove apache2

Commands:

sudo ln -s /etc/nginx/sites-available/bestminer /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx start

Mongo

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl enable mongod.service
sudo service mongod start

Clone from GIT with your userkey

git clone [email protected]:egorfedorov29/hellomoto22.git

or

git clone https://github.com/egorfedorov29/hellomoto22
virtualenv -p python3.5 .python
. ./.python/bin/activate
vi .basrc # add . ./.python/bin/activate
./update.sh

Configure

make server/settings.py

MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465
MAIL_USE_SSL = True
MAIL_USERNAME = '[email protected]'
MAIL_PASSWORD = 'pass'
MAIL_DEBUG = False
MAIL_DEFAULT_SENDER = '[email protected]'

Autorun

vi /etc/rc.local

hostname <NAME>.bestminer.io
su - user -c './all.sh start'
Clone this wiki locally