...
Configure NOCLook
Code Block |
---|
$ cd /var/opt/norduni/norduni/src/niweb/ $ cp dotenv .env $ vi .env |
...
Code Block |
---|
# To make it easier for yourself set DJANGO_SETTINGS_MODULE=niweb.settings.prod in your bashprofile/bashrc $ cd /var/opt/norduni/norduni/src/niweb $ python manage.py migrate $ python manage.py collectstatic $ python manage.py runserver $ rm -r /tmp/django_cache |
Create local superuser
Code Block |
---|
$ python manage.py createsuperuser |
...
Code Block |
---|
$ sudo vi /etc/uwsgi/apps-available/noclook.ini The following configuration should be a good start. [uwsgi] # Django-related settings plugins = python protocol = uwsgi # the base directory (full path) chdir = /var/opt/norduni/norduni/src/niweb/ # Django's wsgi file wsgi-file = /var/opt/norduni/norduni/src/niweb/niweb/wsgi.py env = DJANGO_SETTINGS_MODULE=niweb.settings.prod # the virtualenv (full path) home = /var/opt/norduni/norduni_environment # logging daemonize = /var/log/uwsgi/app/noclook.log # process-related settings # master master = true # maximum number of worker processes processes = 5 #threads = 2 max-requests = 5000 # the socket (use the full path to be safe socket = 127.0.0.1:8001 # clear environment on exit vacuum = true |
Link the configuration in to the correct directory.
# for now we run uwsgi in lazy-apps, due to neo4j session problems
lazy-apps = true
# less noisy uwsgi logs (especially with sentry)
ignore-sigpipe = true
ignore-write-errors = true
disable-write-exception = true |
Link the configuration in to the correct directory.
Code Block |
---|
$ sudo ln -s /etc/uwsgi/apps-available/noclook. |
Code Block |
$ sudo ln -s /etc/uwsgi/apps-available/noclook.ini /etc/uwsgi/apps-enabled/noclook.ini |
...
Code Block |
---|
sudo chown -R ni:www-data /tmp/django_cache sudo chmod -R g+wrw /tmp/django_cache sudo chown -R ni:www-data /var/opt/norduni/norduni/src/niweb/logs/ sudo chmod -R g+w /var/opt/norduni/norduni/src/niweb/logs/ |
...
- Stop neo4j service if running
- Remove data/databases/graph.db in 3.2 `sudo rm -r /var/lib/neo4j/data/databases/graph.db/`
- Enable data migration in neo4j.conf `dbms.allow_format_migration=true` (should probably be disabled after first migration is done)
- Import database from 2.x `sudo -u neo4j neo4j-admin import --mode=database --database=graph.db --from=/var/opt/neo4j-community-2.1.8/data/graph.db/``
- Set default admin `sudo -u neo4j neo4j-admin set-default-admin neo4j`
- Set password `sudo -u neo4j neo4j-admin set-initial-password your_awesome_password`/graph.db/``
- Start neo4j service `sudo service neo4j start`
- you can follow along in `logs/neo4j.log`
...
Code Block |
---|
# In norduni directory as the NI user $ sudo -u ni -i $ cd norduni $ git stash $ git pull origin master $ git stash apply # You might get conflict e.g. in urls.py # Resolve it and run git reset $ rm -r src/niweb/norduniclient # Delete old virtualenv and create a new $ cd .. $ rm -r norduni_environment $ virtualenv norduni_environment $ . norduni_environment/bin/activate $ pip install -U pip $ pip install -U -r norduni/requirements/prod.txt # If running python 2.7 also run $ pip install -r norduni/requirements/py2.txt # update norduni/src/niweb/.env to have: NEO4J_USERNAME=neo4j NEO4J_PASSWORD=your_awesome_password NEO4J_RESOURCE_URI=bolt://localhost:7687 # If you have saml enabled you need to add the following to norduni/src/niweb/apps/saml2auth/config.py # Just beside the key_file and cert_file entries. 'encryption_keypairs': [{ 'key_file': path.join(BASEDIR, 'sp-key.pem'), # private part 'cert_file': path.join(BASEDIR, 'sp-cert.pem'), # public part }], # finally run migrate and collect statics $ python norduni/src/niweb/manage.py migrate --settings=niweb.settings.prod $ python norduni/src/niweb/manage.py collectstatic --settings=niweb.settings.prod |
...