xek系统文件上传服务,python3

guanli 81be0127ca 更新 'README.md' 4 years ago
logs 2be747647e add file 4 years ago
venv 2be747647e add file 4 years ago
README.md 81be0127ca 更新 'README.md' 4 years ago
ar.upload.ming.conf 2be747647e add file 4 years ago
auth.dev.lua 2be747647e add file 4 years ago
auth.prod.lua 2be747647e add file 4 years ago
server.dev.py 2be747647e add file 4 years ago
server.prod.py 2be747647e add file 4 years ago
server.py 2be747647e add file 4 years ago
token.php 2be747647e add file 4 years ago
upload.py 2be747647e add file 4 years ago
upload_img_filter.dev.conf 2be747647e add file 4 years ago
upload_img_filter.prod.conf 2be747647e add file 4 years ago

README.md

项目安装部署:

1.    安装python3 

2.    部署上传服务代码,git cloen http://18.167.157.193:1026/guanli/akupload.git

3.    安装项目依赖 
      sudo /usr/local/python3/bin/pip3.6 install requests
      sudo /usr/local/python3/bin/pip3.6 install retry       

4.    修改上传配置,文件server.prod.py 里面有上传域名和上传目录等信息 

5.    启动上传服务: nohup python3 ./server.py >/dev/null 2>&1 & 

项目依赖nginx扩展

1. 配置nginx支持lua扩展

    1 编译安装lua
        wget  http://luajit.org/download/LuaJIT-2.0.5.tar.gz
        tar xf LuaJIT-2.0.5.tar.gz
        cd LuaJIT-2.0.5
        make PREFIX=/usr/local/luajit
        make install PREFIX=/usr/local/luajit
    2 下载扩展模块
        cd /usr/local/src/
        wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.1.tar.gz
        tar -xf v0.3.1.tar.gz

        wget https://github.com/openresty/lua-nginx-module/archive/v0.10.14.tar.gz
        tar xf v0.10.14.tar.gz
    3 查看之前编译的参数
        ./nginx -V
        nginx version: nginx/1.14.2
        built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
        configure arguments: (记录下这些参数,重新编译需要,再追加上lua扩展)

    4 开始编译安装nginx并且添加需要的模块
        //设置环境变量
        export LUAJIT_LIB=/usr/local/luajit/lib
        export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0
        设置完成后记得source profile
    5 //编译(进入到以前nginx编译目录,或者刚下载的nginx目录)
        ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --add-module=/usr/local/src/ngx_devel_kit-0.3.1 --add-module=/usr/local/src/lua-nginx-module-0.10.14

    6 //安装
        make && make install

2.安装nginx图片处理扩展,http_image_filter_module,步骤同上面安装lua类似。

           1. 增加 --with-http_image_filter_module

3.安装nginx文件(upload)模块扩展。

           1. Git clone https://github.com/fdintino/nginx-upload-module.git
           2. 增加新模块,执行:./configure nginx -V显示的内容 --add-module=/opt/soft/nginx-upload-module
           3. 执行 make && make install 执行nginx -V 查看