-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.txt
80 lines (57 loc) · 1.93 KB
/
deployment.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
1. Install stuff (root)
RUN apt-get update
RUN apt-get install -y apt-utils vim curl apache2 apache2-utils mariadb-server libmariadbclient-dev git python3-dev libapache2-mod-wsgi-py3 rabbitmq-server python3-pip python3-virtualenv python3-openpyxl
adduser user
copy and configure:
copy 000-default.cnf, default-ssl.cnf to /etc/apache2/sites-available
copy celery_init/default/ to /etc/
copy celery_init/celerybeat and celeryd to /etc/init.d/
2. Database
mysql -u root -p $rootpassword
CREATE DATABASE RobustQ;
grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'localhost' identified by 'PASSWORD';
(for remote access, prob not needed): grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'%' identified by 'PASSWORD';
flush privileges;
switch to user
3. Get project files (in /home/user/Projects/)
git clone https://github.com/domvie/RobustQ.git
mkdir uploads
mkdir logs
mkdir logs/www
4. Virtual env
python3 -m virtualenv --python=/usr/bin/python3 /home/user/Projects/RobustQ/venv
source /home/user/Projects/RobustQ/venv/bin/activate
5. Install python stuff
pip3 install -r requirements.txt
touch RobustQ/local_config.py -> DB = {
'USER': 'DB_USER',
'PW': 'DB_PW',
'EMAILP': 'xxx',
'NAME': 'RobustQ'
}
5. Check rights
usermod -a -G www-data user
usermod -g www-data user (primary group change)
chown user:group -R ./
(chmod 755 -R ./*)
chmod g+s ./
set future ownership with ACL:
setfacl -d -R -m u::rwx ./
setfacl -d -R -m o::rwx ./
setfacl -d -R -m g::rwx ./
6. Check if django works:
python3 manage.py createcachetable
python3 manage.py createsuperuser
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py runserver
/etc/init.d/celeryd start
/etc/init.d/celerybeat start
7. Copy/add Perl modules
cp scripts/perlModules/Math /usr/share/perl/5.30/Math/
8. Enable SSL
Get SSL key & cert
edit default-ssl.cnf
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo a2enmod rewrite