简介
这是一个在实际应用场景下的软件。 通过Curl
抓取网页源代码来监控目标字段的变化,实时把握库存信息,支持微信/TG
频道推送。
截图
安装
Github地址:https://github.com/546669204/vps-inventory-monitoring
本教程使用的是宝塔面板,建议新手也使用这个。
1、安装宝塔
#Centos系统
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh
#Ubuntu系统
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh
#Debian系统
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && bash install.sh
安装完成后,请进入面板安装PHP
至少5.4
,Nginx
,mysql
环境。再添加域名。
2、下载程序
#进入根目录
cd /www/wwwroot/xx.com
git clone https://github.com/546669204/vps-inventory-monitoring.git
mv vps-inventory-monitoring/{.,}* ./
chmod -Rf 755 ./*
3、伪静态设置
左侧网站-域名设置-找到网站目录,把运行目录改成public
。再找到伪静态,添加:
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
4、配置数据库
将根目录下的mysql.sql
导入到你的数据库,编辑app/database.example.php
文件,填写数据库信息,并重命名为database.php
。
5、修改系统配置
编辑app/index/config.php
文件修改定时时间、域名等。然后打开域名访问即可。
6、自动检测
最后我们需要定时设置检测,有2
种方法,自己选择吧。
1、定时任务设置
点击宝塔左侧定时计划,任务类型选择URL访问,时间设置每5分钟,URL:https://xx.com/index/index/test
2、运行验证程序,间隔时间去app/index/config.php修改
screen -S vpstest //创建screen
cd [网站根目录]
php think VpsTest
CTRL A D //退出screen
然后关闭ssh即可 重新进入查看可使用
screen -r vpstest
使用
由于原项目没有说明初始用户名和密码,所以我们需要自己注册账号后,去数据库找到xm_user
删除id
为1
的初始账户,找到自己注册账户id
,并编辑app/index/config.php
文件,将adduid
改成自己的。
程序暂时没有删除操作,我们可以去数据库,通过操作xm_place
、xm_company
、xm_index
进行删除操作。
如果添加后不会检测,修改数据库xm_index
的status
为1
(1
视为通过审核)。
最新评论
请问下,python3 tg_username_update.py都会提示下面这个是因为什么啊 Traceback (most recent call last): File "tg_username_update.py", line 21, in <module> cake = emojize(":cake:", use_aliases=True) TypeError: emojize() got an unexpected keyword argument 'use_aliases'
不可以了
# Install [Debian] [bullseye] [amd64] Downloading... grep: (standard input): binary file matches Error! grub.cfg. root@RRR2:~#
博主你好,请问cloudfront 上传收费这个是事实吧,已经找了几个贴子确认了。 那有什么好办法能够避开这个收费呢?如果不能避开感觉还是cloudflare 比较稳。
来看看
第5步添加自定义主机名进去后等txt验证提示custom hostname does not name to this zone
那没事了,我静态博客。谢谢
为什么缓存键和源请求那里不设置缓存?