• Stars
    star
    148
  • Rank 248,511 (Top 5 %)
  • Language
    C
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

nginx + lua +fastdfs Real-time dynamic compression of distributed pictures

install

进入docker目录
docker build -t  fastdfs:dev .
如果比较慢可以换一下网易的源
docker pull hub.c.163.com/qieangel2013/ngx-fastdfs:latest

使用

docker run --net=host -idt -p 80:80 fastdfs:dev '/etc/rc.local'

测试

进入容器执行test目录下的./test.sh或者直接执行下面脚本
fdfs_test /etc/fdfs/client.conf upload /home/steven/01.jpg
...
group_name=group1, ip_addr=192.168.1.181, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580.jpg
...
example file url: http://192.168.1.181/group1/M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580.jpg
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580_big.jpg
...
example file url: http://192.168.1.181/group1/M00/00/00/wKgdhFTV0ZmAP3AZAPk-Io7D4w8580_big.jpg

php调用

首先进入php_client
./configure --with-php-config=/usr/local/php/bin/php-config
make&&make install
在php.ini里添加
extension=fastdfs_client.so
[fastdfs_client]
fastdfs_client.base_path = /home/fastdfs/fastdfs
fastdfs_client.connect_timeout = 2
fastdfs_client.network_timeout = 60
fastdfs_client.log_level = info
fastdfs_client.log_filename =
fastdfs_client.tracker_group_count = 1
fastdfs_client.tracker_group0 = /etc/fdfs/client.conf
fastdfs_client.use_connection_pool = true
fastdfs_client.connection_pool_max_idle_time = 3600
根据自己的情况做相应的修改
重启php-fpm
执行test目录下的fastdfs.php就可以看到效果了

使用效果

自动压缩

自动压缩采用减少图片质量来达到减小图片体积的效果
使用方法是把nginx里的nginxauto.conf替换原有的或者自己按着该文件修改
把lua里的thumbnailauto.lua文件替换原有的或者自己按着该文件修改
注意:fastdfs的storage的配置/etc/fdfs/storage.conf中run_by_group和run_by_user,最好跟nginx的用户组配置一样

liveim是一款直播平台,内置im聊天功能

由于未开源,需要授权可以获取源代码

http://www.weivq.com:88/ (演示地址)
http://www.weivq.com:88/public/uploads/LiveIm.apk (安卓演示)
http://www.weivq.com:88/public/uploads/LiveImInstall.exe (pc端演示)

交流使用

交流群:337937322

如果你对我的辛勤劳动给予肯定,请给我捐赠,你的捐赠是我最大的动力

项目捐赠列表

More Repositories

1

zys

high performance service framework based on Yaf or Swoole
PHP
792
star
2

livego

go Implementation of live streaming services
Go
424
star
3

EsParser

PHP write SQL to convert DSL to query Elasticsearch
PHP
155
star
4

zqf

A high performance service tool for PHP
C
118
star
5

dfs

A distributed file server framework based on swoole and inotify
PHP
111
star
6

phpml

基于PHP-ML库实现机器学习
PHP
77
star
7

goMonitorLog

基于Aho-Corasick 算法+Trie树+DFA 来实现实时匹配,可以实时对文本过滤+字符过滤+敏感词过滤+关键词过滤+脏词过滤+多字符串匹配等处理 支持所有的文本文件类型(包括所有日志)
Go
29
star
8

zqfHB

统计php脚本文件运行时间的扩展
C
17
star
9

SmallAPP

WeChat applet demo
JavaScript
17
star
10

goMontioringDdl

go 通过binlog实现监控ddl发送钉钉报警
Go
17
star
11

zqf-cpp

A high performance service tool c++ for PHP
C++
14
star
12

ai

根据爬过来的数据进行清洗、调用word2vec实现智能分类
PHP
13
star
13

SqlReview

sql 去重、采样、解析、打分统计慢查询实现sql审核系统
Go
13
star
14

msecphp

基于腾讯开源的msec来进行php开发模块
PHP
13
star
15

phpword2vec

Php calls word2vec for machine learning
C
9
star
16

yaf-demo

yaf read write split mail cache
PHP
7
star
17

lua-nginx

nginx extension module lua
Lua
7
star
18

waf

waf 是一个基于lua-nginx-module(openresty)的web应用防火墙
Lua
7
star
19

cop

基于微信的libco实现php的协程扩展
C++
4
star
20

nginxLuaGmFastdfs

Nginx+Lua+Gm+Fastdfs可自动优化图片的图片服务
Lua
4
star
21

ns

程序员图书馆
Java
4
star
22

DCACHE

仿照配置中心的策略实现分布式删除yac缓存
Go
3
star
23

tcs-wzq

js html css 实现小游戏
HTML
3
star
24

hbase-parser

php的操作类库,通过写sql来来查询Hbase
PHP
3
star
25

ci-demo

ci读写分离
PHP
2
star
26

dms

python 协程实现数据迁移,可以跨库、同库之间迁移数据
Python
2
star
27

PythonChat

Python聊天室
Python
1
star
28

zqfcounter

并发最简单计数器
C
1
star
29

php_imagick_dpi

imagick把灰度图片转化为如果把图片以及php把图片转为dpi
PHP
1
star
30

smsService

基于gin和gorm实现的短信基础服务
Go
1
star