Skip to content
Dan Kerchner edited this page Sep 2, 2020 · 5 revisions

Welcome to the libcal_pp_integration wiki!

Deployment

The following instructions have been tested for deployment on Ubuntu 20.04.

Package installations

sudo apt update
sudo apt upgrade
sudo apt install python3 python3-pip supervisor
sudo pip3 install virtualenv

App setup

Create lcpp user

The lcpp user will own the app. Create it using:

sudo adduser --disabled-password lcpp

Clone github repository

cd /opt
sudo git clone https://github.com/gwu-libraries/libcal_pp_integration.git
sudo chown -R lcpp:lcpp libcal_pp_integration

Note that until we make this GitHub repository public, you will need to enter your personal github credentials. This could become a problem if a different individual later needs to pull an update from the repo.

cd libcal_pp_integration
virtualenv ENV
source ENV/bin/activate
pip install -r requirements.txt

Supervisor setup

Create the supervisor configuration file for the application.

cd /etc/supervisor/conf.d
sudo vi lcpp.conf

The contents of lcpp.conf should be similar to:

[program:lcpp]
user=lcpp
directory=/opt/libcal_pp_integration
command=/opt/libcal_pp_integration/ENV/bin/python /opt/libcal_pp_integration/app.py --debug
stdout_logfile=/var/log/lcpp/lcpp_stdout.log
stderr_logfile=/var/log/lcpp/lcpp_stderr.log

Create the log folder

sudo mkdir /var/log/lcpp
sudo chown -R lcpp:lcpp /var/log/lcpp

Make sure supervisor reads the new configuration file, and start lcpp:

sudo supervisorctl update lcpp
sudo supervisorctl start lcpp

Starting and stopping the lcpp process with supervisor

sudo supervisorctl [start/stop/restart] lcpp