栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Nginx 和 FastDFS的结合只为远程访问

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Nginx 和 FastDFS的结合只为远程访问

文章目录
    • 安装准备
    • 修改配置文件 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文件中执行

如果上述命令执行没有报错继续执行接下来的命令

make
make install

修改配置文件 mod_fastdfs.conf




在Nginx的nginx.conf 配置文件中加上以下配置

在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的结合使用

执行流程图

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/830584.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号