Commit 2f38a06d authored by delanoe's avatar delanoe

[INSTALL] OLD install.

parent baa9d71b
### Update and install base dependencies
echo "############ DEBIAN LIBS ###############"
apt-get update && \
apt-get install -y \
apt-utils ca-certificates locales \
sudo aptitude gcc g++ wget git vim \
build-essential make \
postgresql postgresql-client postgresql-contrib \
postgresql-server-dev libpq-dev libxml2 \
postgresql postgresql-client postgresql-contrib \
nginx rabbitmq-server
# WARNING: uwsgi is not on stretch any more (get it from unstable)
# uwsgi uwsgi-core uwsgi-plugin-python3
### Configure timezone and locale
echo "########### LOCALES & TZ #################"
echo "Europe/Paris" > /etc/timezone
dpkg-reconfigure --frontend=noninteractive tzdata
#ENV TZ "Europe/Paris"
sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
update-locale LANG=fr_FR.UTF-8 && \
update-locale LANGUAGE=fr_FR.UTF-8 && \
update-locale LC_ALL=fr_FR.UTF-8
# Not: using LC_ALL is discouraged
# see warning: https://wiki.debian.org/Locale
### Install main dependencies and python packages based on Debian distrib
echo "############# PYTHON DEPENDENCIES ###############"
apt-get update && apt-get install -y \
libxml2-dev xml-core libgfortran-5-dev \
libpq-dev \
python3 \
python3-dev \
python3-six python3-numpy python3-setuptools \
python3-numexpr \
python3-pip \
libxml2-dev libxslt-dev
#libxslt1-dev zlib1g-dev
UPDATE AND CLEAN
apt-get update && apt-get autoclean
#NB: removing /var/lib will avoid to significantly fill up your /var/ folder on your native system
########################################################################
### PYTHON ENVIRONNEMENT (as ROOT)
########################################################################
#adduser --disabled-password --gecos "" gargantua
cd /srv/
pip3 install virtualenv
virtualenv /srv/env_3-4
echo 'alias venv="source /srv/env_3-5/bin/activate"' >> ~/.bashrc
# CONFIG FILES
# su gargantua -c 'all commands below'
# but nltk needs right access (so done in root, not really good for safety)
source /srv/env_3-4/bin/activate && pip3 install -r requirements.txt && \
pip3 install git+https://github.com/zzzeek/sqlalchemy.git@rel_1_1 && \
python3 -m nltk.downloader averaged_perceptron_tagger -d /usr/local/share/nltk_data
chown gargantua:gargantua -R /srv/env_3-4
#######################################################################
## POSTGRESQL DATA (as ROOT)
#######################################################################
sed -iP "s%^data_directory.*%data_directory = \'\/srv\/gargandata\'%" /etc/postgresql/9.4/main/postgresql.conf
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.4/main/pg_hba.conf
echo "listen_addresses='*'" >> /etc/postgresql/9.4/main/postgresql.conf
#!/bin/bash
##################################################
# __| |(_) __ _ _ __ __ _ ___
# / _` || |/ _` | '_ \ / _` |/ _ \
# | (_| || | (_| | | | | (_| | (_) |
# \__,_|/ |\__,_|_| |_|\__, |\___/
# |__/ |___/
##################################################
#configure django migrations
##################################################
echo "::::: DJANGO :::::"
#echo "Starting Postgres"
#/usr/sbin/service postgresql start
/bin/su gargantua -c 'source /env_3-4/bin/activate &&\
echo "Activated env" &&\
/srv/gargantext/manage.py makemigrations &&\
/srv/gargantext/manage.py migrate && \
echo "migrations ok" &&\
/srv/gargantext/manage.py createsuperuser'
#!/bin/bash
#######################################################################
## ____ _
## | _ \ ___ ___| |_ __ _ _ __ ___ ___
## | |_) / _ \/ __| __/ _` | '__/ _ \/ __|
## | __/ (_) \__ \ || (_| | | | __/\__ \
## |_| \___/|___/\__\__, |_| \___||___/
## |___/
#######################################################################
echo "::::: POSTGRESQL :::::"
su postgres -c 'pg_dropcluster 9.4 main --stop'
#done in docker but redoing it
rm -rf /srv/gargandata && mkdir /srv/gargandata && chown postgres:postgres /srv/gargandata
su postgres -c '/usr/lib/postgresql/9.4/bin/initdb -D /srv/gargandata/'
su postgres -c '/usr/lib/postgresql/9.4/bin/pg_ctl -D /srv/gargandata/ -l journal_applicatif start'
su postgres -c 'pg_createcluster -D /srv/gargandata 9.4 main '
su postgres -c 'pg_ctlcluster -D /srv/gargandata 9.4 main start '
su postgres -c 'pg_ctlcluster 9.4 main start'
service postgresql start
su postgres -c "psql -c \"CREATE user gargantua WITH PASSWORD 'C8kdcUrAQy66U'\""
su postgres -c "createdb -O gargantua gargandb"
echo "Postgres configured"
#service postgresql stop
Cython==0.20.2
Django==1.6.11
Jinja2==2.7.3
MarkupSafe==0.23
Pillow==2.5.3
Pygments==1.6
RandomWords==0.1.12
SQLAlchemy==0.9.9
South==1.0
aldjemy==0.3.10
amqp==1.4.6
anyjson==0.3.3
bibtexparser==0.6.0
billiard==3.3.0.19
celery==3.1.17
certifi==14.05.14
cffi==0.8.6
chardet==2.3.0
cryptography==0.6
decorator==3.4.0
django-autoslug==1.7.2
django-autoslug-field==0.2.3
django-celery==3.1.16
django-cte-trees==0.9.2
django-extensions==1.4.0
django-grappelli==2.5.3
django-hstore==1.3.1
django-maintenance==0.1
django-mptt==0.6.1
django-nested-inlines==0.1
django-pgfields==1.4.4
django-pgjson==0.2.2
django-pgjsonb==0.0.10
django-treebeard==2.0
djangorestframework==3.0.0
gensim==0.10.3
graphviz==0.4
ipython==2.2.0
kombu==3.0.24
lxml==3.4.1
matplotlib==1.4.0
networkx==1.9
#nltk==3.0a4
nose==1.3.4
numpy==1.8.2
pandas==0.14.1
pexpect-u==2.5.1
psycopg2==2.5.4
pycountry==1.8
pycparser==2.10
pydot2==1.0.33
pyparsing==2.0.2
python-dateutil==2.2
python-igraph==0.7
pytz==2015.2
pyzmq==14.3.1
readline==6.2.4.1
redis==2.10.3
scikit-learn==0.15.1
scipy==0.14.0
simplerandom==0.12.1
six==1.7.3
sympy==0.7.5
tornado==4.0.1
uWSGI==2.0.7
ujson==1.33
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment