前言
Centos7.5/Python2.7
准备工作
- 一台正常工作的VPS
- 准备一个域名用于解析(可选)
开源项目
签到 —— 一个自动签到框架 base on an HAR editor
搭建部署
Centos1
2
3
4# 开发工具包
yum groupinstall "Development Tools" -y
yum install python-devel mysql-connector-python git -y
pip install tornado==4.5.3 u-msgpack-python jinja2 chardet requests pbkdf2 pycrypto
Ubuntu or Debian1
2apt-get install python-dev autoconf g++ python-pbkdf2
pip install tornado u-msgpack-python jinja2 chardet requests pbkdf2 pycrypto
克隆项目1
2git clone https://github.com/binux/qiandao.git
cd qiandao
运行项目
1 | # 后台运行 |
成功的话访问http://ip:8923/
登陆注册设置管理员1
python ./chrole.py [email protected] admin
模板的话可以在主站下载,也可以自己做,都有教程的。
反向代理
基本使用用ip访问就好,如果有要求域名的话,就使用反向代理吧1
2
3yum install nginx -y
systemctl start nginx
vim /etc/nginx/nginx.conf
conf配置1
2
3
4
5
6
7
8
9
10
11
12
13
14
15server
{
listen 80;
#替换域名
server_name domain.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location /
{
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8923;
}
}
nginx -t
然后重启服务
1 | systemctl restart nginx |
开机自启1
systemctl enable nginx
这样就能通过域名访问了
教程很乱,当文档看吧,针对有基础的,很多小细节都没多写。
End…