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

分享下CentOS6环境单服务器FastDFS+Nginx+fastdfs-nginx-module 安装配置简单过程笔记。

因公司内部的测试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*fastdfs 下载页面地址http://sourceforge.net/projects/fastdfs/files/

nginx  下载页面地址http://sourceforge.net/projects/fastdfs/files/

fastdfs-nginx-module    下载页面地址  http://sourceforge.net/projects/fastdfs/files/FastDFS%20Nginx%20Module%20Source%20Code/

/configure --user=nginx --group=nginx --prefix=/usr/local/nginx --add-module=../fastdfs-nginx-module/src
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 一致,说明成功

此文安装

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

相关推荐