- Install xcode first
- Run the command:
xcode-select --install
Search This Blog
Install MyTardis on Ubuntu Linux 16.04
- Create a service user account for running MyTardis:
useradd -m -d /opt/mytardis -s /bin/bash tardis
- Check out MyTardis from github:
cd /opt sudo git clone -b master https://github.com/mytardis/mytardis.git sudo chown tardis:tardis /opt/mytardis
- Install required ubuntu packages:
sudo bash /opt/mytardis/install-ubuntu-requirements.sh
- Setup virtualenv for tardis account:
sudo su tardis source /usr/share/virtualenvwrapper/virtualenvwrapper.sh mkvirtualenv --system-site-packages mytardis pip install -U pip echo "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh" >> ~/.bashrc echo "workon mytardis" >> ~/.bashrc source ~/.bashrc
- (As user 'tardis',) To work around this bleach bug, set html5lib version by adding line below to requirements.txt:
html5lib==0.9999999
- remove billiard from requirements.txt or after installing the required packages, re-install celery package to downgrade billiard to 3.3.0.23. This is because the installed billiard 3.5.0.0 is installed and it causes celery failed to process any task. (Thread ResultHandler crashed: TypeError ...)
- (As user 'tardis',) Install required Python packages:
cd /opt/mytardis pip install -U -r requirements.txt
- (As user 'tardis',) Initialize tardis/settings.py (as user 'tardis'):
cd /opt/mytardis mv tardis/settings_changeme.py tardis/settings.py
add the following lines:DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3' DATABASES['default']['NAME'] = 'tardis_db'
- (As user 'tardis',) Generate SECRET_KEY and save to tardis/settings.py:
echo "SECRET_KEY='`python mytardis.py generate_secret_key`'" >> tardis/settings.py
or to re-generate:python -c "import os; from random import choice; key_line = '%sSECRET_KEY=\"%s\" # generated from build.sh\n' % ('from tardis.default_settings import * \n\n' if not os.path.isfile('tardis/settings.py') else '', ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789\\!@#$%^&*(-_=+)') for i in range(50)])); f=open('tardis/settings.py', 'a+'); f.write(key_line); f.close()"
- (As user 'tardis',) Initialize database:
python mytardis.py migrate
- (As user 'tardis',) Create cache tables:
python mytardis.py createcachetable default_cache python mytardis.py createcachetable celery_lock_cache
- (As user 'tardis',) Collect static files and save to static/ directory under /opt/mytardis:
python mytardis.py collectstatic
- (As user 'tardis',) Create superuser (as user 'tardis'):
python mytardis.py createsuperuser
- (As user 'tardis',) Create var/store directory:
mkdir -p var/store
- (As user 'tardis',) Start mytardis server:
python mytardis.py celeryd & python mytardis.py runserver 0.0.0.0:8000
Note: 1) celeryd has to be started manually prior mytardis; 2) append 0.0.0.0:8000 to runserver command will make the server serve other hosts rather than only localhost:8000 - Supervisor can be installed to auto-start celeryd and webserver...
Subscribe to:
Posts (Atom)