手机版
你好,游客 登录 注册
背景:
阅读新闻

FastDFS_v4.06+Nginx-1.4.2配置详解

[日期:2013-10-09] 来源:Linux社区  作者:lcz_2 [字体:大 中 小]

4、修改配置文件
1)nginx.conf
在server中增加配置:
访问路径不带group名(storage只有一个group的情况),如/M00/00/00/xxx:
location /M00 {
ngx_fastdfs_module;
}
访问路径带group名(storage对应有多个group的情况),如/group1/M00/00/00/xxx:
location ~ /group([0-9])/M00 {
ngx_fastdfs_module;
}
2)mod_fastdfs.conf
将fastdfs-nginx-module_v1.15解压目录fastdfs-nginx-module/src下的mod_fastdfs.conf复制到-DFDFS_MOD_CONF_FILENAME配置的目录下,如/etc/fdfs/。
修改配置:
tracker_server=192.168.1.241:22122 -- tracker server的ip和端口,此处可以写多个tracker server,每行一个
url_have_group_name = true --访问路径带group时为true否则为false,多个group的情况下,必须为true,为false时,group_count必须为0

storage只有一个group的情况:
group=group1 --storage对应的group
store_path0=/webapp/fastdfs/storage --storage存储路径
group_count = 0

storage对应有多个group的情况:
url_have_group_name = true --必须设置为true才能支持多个group
group_count = 2 --storage的group个数

[group1]
group_name=group1
storage_server_port=23000
store_path_count=1
store_path0=/webapp/fastdfs/storage

[group2]
group_name=group2
storage_server_port=23000
store_path_count=1
store_path0=/webapp/fastdfs/storage2


5、重启Nginx,验证。

相关阅读:

CentOS 6.2实战部署Nginx+MySQL+PHP http://www.linuxidc.com/Linux/2013-09/90020.htm

使用Nginx搭建WEB服务器 http://www.linuxidc.com/Linux/2013-09/89768.htm

搭建基于Linux6.3+Nginx1.2+PHP5+MySQL5.5的Web服务器全过程 http://www.linuxidc.com/Linux/2013-09/89692.htm

CentOS 6.3下Nginx性能调优 http://www.linuxidc.com/Linux/2013-09/89656.htm

CentOS 6.3下配置Nginx加载ngx_pagespeed模块 http://www.linuxidc.com/Linux/2013-09/89657.htm

CentOS 6.4安装配置Nginx+Pcre+php-fpm http://www.linuxidc.com/Linux/2013-08/88984.htm

Nginx 的详细介绍:请点这里
Nginx 的下载地址:请点这里

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款