ngx_addon_name=ngx_http_fastdfs_module
if test -n "${ngx_module_link}"; then
ngx_module_type=HTTP
ngx_module_name=$ngx_addon_name
ngx_module_incs="/usr/include/fastdfs /usr/include/fastcommon/"
ngx_module_libs="-lfastcommon -lfdfsclient"
ngx_module_srcs="$ngx_addon_dir/ngx_http_fastdfs_module.c"
ngx_module_deps=
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/etc/fdfs/mod_fastdfs.conf\"'"
. auto/module
else
HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c"
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
CORE_LIBS="$CORE_LIBS -L/usr/lib -lfastcommon -lfdfsclient"
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/etc/fdfs/mod_fastdfs.conf\"'"
fi
增加依赖包并安装 nginx:
1
2
3
4
5
cd /usr/local/src/fastdfs/nginx/nginx-1.12.2
./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --user=root --add-module=/usr/local/src/fastdfs/nginx/fastdfs-nginx-module-1.20/src
make && make install
This is FastDFS client test program v5.11
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.csource.org/
for more detail.
[2018-09-06 20:30:37] DEBUG - base_path=/data/fastdfs/client, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
tracker_query_storage_store_list_without_group:
server 1. group_name=, ip_addr=172.20.15.75, port=23000
group_name=group1, ip_addr=172.20.15.75, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/rBQPS1uRHe2AKqfAAAC0cbebd6Q15.jpeg
source ip address: 172.20.15.75
file timestamp=2018-09-06 20:30:37
file size=46193
file crc32=3080419236
example file url: http://172.20.15.75:6666/group1/M00/00/00/rBQPS1uRHe2AKqfAAAC0cbebd6Q15.jpeg
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/rBQPS1uRHe2AKqfAAAC0cbebd6Q15_big.jpeg
source ip address: 172.20.15.75
file timestamp=2018-09-06 20:30:37
file size=46193
file crc32=3080419236
example file url: http://172.20.15.75:6666/group1/M00/00/00/rBQPS1uRHe2AKqfAAAC0cbebd6Q15_big.jpeg