forked from zhouzhousc/file_trans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d_env.txt
51 lines (38 loc) · 1.82 KB
/
d_env.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
#!/bin/bash
# Date:16:29 2020-03-09
# Author: Create by Carl
# Description: This script function is django env
# Version: 1.10
# no文件夹在~目录
echo "23716"|sudo -S apt update
echo "23716"|sudo -S apt upgrade -y
# 安装依赖
echo "23716"|sudo -S apt install python3-dev python3-pip python-pip memcached -y
echo "23716"|sudo -S apt install supervisor -y
echo "23716"|sudo -S apt install nginx -y
echo "23716"|sudo -S apt-get install python-dev
pip install virtualenv
mkdir edgeBox && cd edgeBox
echo "23716"|sudo -S cp -r ~/no/edgebox_final ./ && mkdir env
cd env && virtualenv -p /usr/bin/python3 edgebox_env
source edgebox_env/bin/activate
pip install -Ur ~/edgeBox/edgebox_final/requirements.txt && pip install -Ur ~/edgeBox/edgebox_final/requirements.txt
# gunicorn 配置
pip install gunicorn
echo "23716"|sudo -S cp ~/no/gunicorn_start.sh ~/edgeBox/ && echo "23716"|sudo -S chmod +x ~/edgeBox/gunicorn_start.sh && bash ~/edgeBox/gunicorn_start.sh
#nginx配置
# 删除默认配置
echo "23716"|sudo -S rm /etc/nginx/sites-enabled/default
#将no文件夹中edgebox_final.conf 放入/etc/nginx/sites-enabled/
echo "23716"|sudo -S cp ~/no/edgebox_final.conf /etc/nginx/sites-enabled/
echo "23716"|sudo -S cp ~/no/edgebox_vue.conf /etc/nginx/sites-enabled/
#其中edgebox_vue.conf配置文件中包含前端代码的路径,按实际更改
echo "23716"|sudo -S cp -r ~/no/dist ~/edgeBox/
#保存并退出。重启nginx:
echo "23716"|sudo -S /etc/init.d/nginx restart
#配置Supervisor
echo "23716"|sudo -S cp ~/no/supervisor_edgebox.conf /etc/nginx/sites-enabled/
echo "23716"|sudo -S mv /etc/nginx/sites-enabled/supervisor_edgebox.conf edgebox_final.conf
echo "23716"|sudo -S supervisorctl update
echo "23716"|sudo -S supervisorctl reload
echo "23716"|sudo -S /etc/init.d/memcached restart && sudo /etc/init.d/nginx restart