| 系统 | Centos 8 Stream [2cpu 4G内存] |
|---|---|
| 域名 | app.hehelucky.cn |
| 域名SSL证书 | nginx 格式证书 [阿里云和腾讯云都可以申请免费ssl证书] |
| 数据路径 | /data |
dnf install mariadb-devel mariadb-server -y
systemctl restart mariadb
systemctl enable mariadbdnf install redis -y
systemctl restart redis
systemctl enable redismkdir /data/
cd /data/
dnf install git gcc zip unzip mariadb-devel -y
git clone https://github.com/nineaiyu/flyappsdnf install python39 python39-devel -y
python3.9 -m venv py39cd /data/flyapps/fir_ser/
source /data/py39/bin/activate
pip install -U setuptools pip -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/mysql执行下面mysql命令
create database flyapps default character set utf8 COLLATE utf8_general_ci;
grant all on flyapps.* to flyuser@'127.0.0.1' identified by 'KGzKjZpWBp4R4RSa';
quit;
echo 'requirepass nineven' >> /etc/redis.conf # 配置授权密码
systemctl restart redisdnf install openssl-devel -y
dnf install gcc-c++ gcc -y
cd /data/flyapps/fir_ser/
tar xvf zsign-1.1.2.tar.gz
cd zsign-1.1.2/
g++ *.cpp common/*.cpp -lcrypto -O3 -std=c++11 -o /usr/bin/zsignecho '127.0.0.1 mariadb redis flyapps' >> /etc/hostsclass DOMAINCONF(object):
API_DOMAIN = "https://app.hehelucky.cn" # 用与开启本地存储,上传应用配置
WEB_DOMAIN = "https://app.hehelucky.cn" # 用于超级签跳转配置,该域名一般为前端页面域名const pro_base_env = {
baseUrl: '/', //该选项可以填写web-api的域名,类似 https://api.xxx.com/
index_static: '/', //若配置cdn等加速,可以填写cdn加速域名
baseShortUrl: '/', //该选项可以填写short-api的域名,也可以和web-api域名一样,类似 https://api.xxx.com/
short_static: '/short/', //若配置cdn等加速,可以填写cdn加速域名
version: version,
};dnf install npm -y
npm install -g n
n 12.13 # 安装12版本的node或者14版本 ,最新版本会有问题
npm install -g yarnvim /data/flyapps/fir_client/vue.config.js #根据需求修改相关信息,并保存退出
# pro_base_env 正式环境信息
# dev_base_env 开发环境信息cd /data/flyapps/fir_client/
yarn install
yarn build index # 前端打包,输出目录 dist_index
yarn build short # 下载页打包,输出目录 dist_shortcd /data/flyapps/fir_admin/
yarn install
yarn build:prod # 下载页打包,输出目录 distdnf install nginx -ycp /data/flyapps/nginx.conf.d/flyapps-vhost.conf /etc/nginx/conf.d/1.创建web目录,并将打包好的web复制该目录
mkdir -pv /data/{fir_client/short,fir_admin}
cp -a /data/flyapps/fir_client/dist_index/* /data/fir_client/
cp -a /data/flyapps/fir_client/dist_short/* /data/fir_client/short/
cp -a /data/flyapps/fir_admin/dist/* /data/fir_admin/
chown nginx.nginx -R /data/{fir_client,fir_admin}2.启动nginx服务
nginx -t
systemctl restart nginx
systemctl enable nginxsource /data/py39/bin/activate
cd /data/flyapps/fir_ser/
python manage.py makemigrations
python manage.py migrateecho 'net.core.somaxconn=1024' >> /etc/sysctl.conf
sysctl -pcd /data/flyapps/fir_ser/
source /data/py39/bin/activate
python manage.py start all -u nginx -usm 1 -dpython manage.py createsuperuser- 需要输入用户名,邮箱和密码
- 用户名和密码用与登录管理后台
- 邮箱和密码用与登录前端web