知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

CentOS6环境单服务器FastDFS+Nginx+fastdfs-nginx-module安装配置

发布时间:2015-02-02 18:30:04作者:知识屋

因公司内部的测试fastdfs服务器有变动,所以得重新搭建,以前没有搭建过,在网上找了许多配置文档,但问题多,所以折腾了两天

安装fastdfs 和nginx 需要的插件

yum install gettext gettext-devel libXft libXft-devel libXpm libXpm-devel automake autoconf libXtst-devel gtk+-devel gcc gcc-c++zlib-devel libpng-devel gtk2-devel glib-devel pcre*

1.系统环境 依赖库自行安装

Centosip 地址 192.168.1.11
tracker1: 192.168.1.11 storage1: 192.168.1.11
2.编译安装配置 FastDFS_v4.06.tar.gz
.编译安装 (1) vi make.sh WITH_LINUX_SERVICE=1
(2) ./make.sh ./make.sh install
tracker 配置 (1) vi /etc/fdfs/tracker.conf
base_path=/home/tracker1/fastdfs
( 2) mkdir -p /home/tracker1/fastdfs
( 3) service fdfs_trackerd start
( 4) netstat -ntl tcp 0 0 0.0.0.0:22122
storage 配置( 1) vi /etc/fdfs/storage.conf
http.server_port=80
group_name=group1
base_path=/home/storage1/fastdfs
store_path0=/home/storage1/fastdfs t
racker_server=192.168.1.11:22122
(2) mkdir -p /home/storage1/fastdfs
(3) service fdfs_storaged start
(4) netstat -ntl tcp 0 0 0.0.0.0:23000


0.0.0.0:*


LISTEN


0.0.0.0:*


LISTEN


3.安装配置 nginx-1.4.4 和 fastdfs-nginx-module_v1.15.tar.gz
(1) /configure --prefix=/usr/local/nginx --add-module=/home/fastdfs-nginx-module/src
make make install
(2) cp /home/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
vi /etc/fdfs/mod_fastdfs.conf
base_path=/home/storage1/fastdfs
tracker_server=192.168.1.11:22122
group_name=group1
url_have_group_name = true
store_path0=/home/storage1/fastdfs
(3) mkdir -p /home/storage1/fastdfs
(4) vi /usr/local/nginx/conf/nginx.conf
user root;
location /group1/M00 { root /home/storage1/fastdfs/data;

ngx_fastdfs_module;

}
(5) ln -s /home/storage1/fastdfs/data /home/storage1/fastdfs/data/M00
(6) service iptables stop
cd /usr/local/nginx/sbin/
./nginx
4.测试 (1) vi /etc/fdfs/client.conf
base_path=/tmp
tracker_server=192.168.1.11:22122
http.tracker_server_port=80
(2) /usr/local/bin/fdfs_test /etc/fdfs/client.conf upload test.txt
(3) 用浏览器打开返回的连接,返回内容跟 test.txt 一致,说明成功

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜