项目地址:
https://github.com/qsbaq/vps-stock-monitor
本文转载自:https://1024.ee/index.php/2020/06/26/%e8%87%aa%e5%bb%bavps%e5%ba%93%e5%ad%98%e7%9b%91%e6%8e%a7%e7%b3%bb%e7%bb%9f-vps-ck-mk/
下载安装
cd /data git clone https://github.com/qsbaq/vps-stock-monitor cd vps-stock-monitor # 如果出现这个错误 # ModuleNotFoundError: No module named 'vpsmonitor.settings' cp vpsmonitor/settings_local.py vpsmonitor/settings.py pip3 install django python3 manage.py makemigrations --merge ; python3 manage.py migrate # 创建后台超级用户 python3 manage.py createsuperuser
反代+启动
# 加好反代 vps.ck.mk # 去vpsmonitor/settings.py做个修改,把vps.ck.mk加入到ALLOWED_HOSTS里面去
配置商家和商品
打开 https://vps.ck.mk/admin 登录后就看到
要先加入商家信息 – 网址链接类似 https://bwh88.net/aff.php?aff=37266&pid=
pid=后面要空着,在商品配置中会用到
加入商品信息 – 一定要确定商家和PID.
建立开机自启动
# systemd cat > /etc/systemd/system/vps_stock_monitor.service <<EOF [Unit] Description=VPS_Stock_Monitor After=network.target [Service] User=root Type=simple ExecStart=/usr/bin/python3 /data/vps-stock-monitor/manage.py runserver 0.0.0.0:8200 Restart=on-failure [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl restart vps_stock_monitor systemctl status vps_stock_monitor systemctl enable vps_stock_monitor
定时监控/Crontab
crontab -e # 末尾加入以下的两行 #check every 15 minutes for stock */15 * * * * /usr/bin/python3 /data/vps-stock-monitor/manage.py run >> /data/vps-stock-monitor/refreshing.log 2>&1 &
文章评论