gx-fastdfs是gix+lua+fastdfs实现分布式图片实时动态压缩。
istall进入docker目录docker build -t fastdfs:dev .使用docker -idt -p 80:80 fastdfs:dev /bi/bash进入容器执行/etc/rc.local测试进入容器执行test目录下的./test.sh或者直接执行下面脚本fdfs_test /etc/fdfs/cliet.cof upload /home/steve/01.jpg...group_ame=group1, ip_addr=192.168.1.181, port=23000storage_upload_by_fileamegroup_ame=group1, remote_fileame=M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580.jpg...example file url: https://192.168.1.181/group1/M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580.jpgstorage_upload_slave_by_fileamegroup_ame=group1, remote_fileame=M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580_big.jpg...example file url: https://192.168.1.181/group1/M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580_big.jpgphp调用首先进入php_cliet./cofigure --with-php-cofig=/usr/local/php/bi/php-cofigmake&&make istall在php.ii里添加extesio=fastdfs_cliet.so[fastdfs_cliet]fastdfs_cliet.base_path = /home/fastdfs/fastdfsfastdfs_cliet.coect_timeout = 2fastdfs_cliet.etwork_timeout = 60fastdfs_cliet.log_level = ifofastdfs_cliet.log_fileame =fastdfs_cliet.tracker_group_cout = 1fastdfs_cliet.tracker_group0 = /etc/fdfs/cliet.coffastdfs_cliet.use_coectio_pool = truefastdfs_cliet.coectio_pool_max_idle_time = 3600根据自己的情况做相应的修改重启php-fpm执行test目录下的fastdfs.php就可以看到效果了使用效果自动压缩自动压缩采用减少图片质量来达到减小图片体积的效果使用方法是把gix里的gixauto.cof替换原有的或者自己按着该文件修改把lua里的thumbailauto.lua文件替换原有的或者自己按着该文件修改注意:fastdfs的storage的配置/etc/fdfs/storage.cof中ru_by_group和ru_by_user,最好跟gix的用户组配置一样项目地址github地址:https://github.com/qieagel2013/gx-fastdfs欢迎star点击空白处退出提示











评论