- 安装准备
- 修改配置文件 mod_fastdfs.conf
- 在Nginx的nginx.conf 配置文件中加上以下配置
- 启动成功后我们就可以远程访问我们上传的文件了
- 在安装的过程中出现以下错误的参考文章
- 执行流程图
[root@localhost ~]# fdfs_test /etc/fdfs/client.conf upload aa.txt 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. [2022-04-22 08:58:02] DEBUG - base_path=/opt/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=192.168.32.128, port=23000 group_name=group1, ip_addr=192.168.32.128, port=23000 storage_upload_by_filename group_name=group1, remote_filename=M00/00/00/wKgggGJh_ZqARBP9AAAAG7LcCIQ069.txt source ip address: 192.168.32.128 file timestamp=2022-04-22 08:58:02 file size=27 file crc32=3000764548 example file url: http://192.168.32.128/group1/M00/00/00/wKgggGJh_ZqARBP9AAAAG7LcCIQ069.txt storage_upload_slave_by_filename group_name=group1, remote_filename=M00/00/00/wKgggGJh_ZqARBP9AAAAG7LcCIQ069_big.txt source ip address: 192.168.32.128 file timestamp=2022-04-22 08:58:03 file size=27 file crc32=3000764548 example file url: http://192.168.32.128/group1/M00/00/00/wKgggGJh_ZqARBP9AAAAG7LcCIQ069_big.txt安装准备
上述命令需要在我们解压的Nginx文件中执行
如果上述命令执行没有报错继续执行接下来的命令
修改配置文件 mod_fastdfs.confmake
make install
在80端口下加入如下内容:
location ~/group([0-9])/M00 {
ngx_fastdfs_module;
}
启动Nginx
启动成功后我们就可以远程访问我们上传的文件了如果你的Nginx设置了开机自启,请使用以下命令来启动你的nginx
[root@localhost local]# systemctl daemon-reload
[root@localhost local]# systemctl stop nginx.service
[root@localhost local]# systemctl start nginx.service
[root@localhost local]# systemctl status nginx.service
FastDFS整合Nginx的模块:fastdfs-nginx-module报错:fdfs_define.h:15:27: 致命错误:common_define.h:没有那个文件或目录
参考文章
fastdfs与nginx的结合使用
执行流程图


