FastDFS_v5.05安装记录

时间:2025-03-19 16:04:13

1、软件包

  FastDFS_v5.

 

  fastdfs-nginx-module_v1.

  zlib-1.2.

  pcre-8.

  nginx-1.7.


2.安装部署

    FastDFS_v5.05依赖libfastcommon,不再依赖libevent

2.1、libfastcommon安装

    unzip  -d /usr/local

    cd /usr/local/libfastcommon-master

    ./

   ./ install

 默认安装到了/usr/lib64/,而FastDFS主程序设置的lib目录是/usr/local/lib,所以设置软连接

 ln -s /usr/lib64/ /usr/local/lib/
 ln -s /usr/lib64/ /usr/lib/
 ln -s /usr/lib64/ /usr/local/lib/
 ln -s /usr/lib64/ /usr/lib/


2.2、安装FastDFS

tar -zxvf FastDFS_v5. -C /usr/local

cd /usr/local/FastDFS

./

./ install

cd /etc/fdfs

1)、创建并修改、配置文件,这里暂不介绍如何配置

2)、启动tracker、storage

fdfs_trackerd

fdfs_storaged

3)、配置文件,进行上传文件测试

fdfs_test upload 文件,生成地址说明成功了。


2.3安装nginx插件

1)tar -zxvf fastdfs-nginx-module_v1. -C /usr/local

cd fastdfs-nginx-module/src

vi config,修改如下配置

我这里原来是

CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"

改成

CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"

这个是很重要的,不然在nginx编译的时候会报错的,我看网上很多在安装nginx的fastdfs的插件报错,都是这个原因,而不是版本不匹配。

实际情况,你可以自己查看在 /usr/local/include/路径下是否有fastdfs

cp  mod_fastdfs.conf /etc/fdfs

对 mod_fastdfs.conf 进行配置

2)、配置文件服务器的软连接

    ln -s /home/yuqing/fastdfs/data /home/yuqing/fastdfs/data/M00  (配置文件中stoage存放数据的路径)

3)安装nginx

tar -zxvf zlib-1.2. -C /usr/local

tar -zxvf pcre-8. -C /usr/local

tar -zxvf nginx-1.7.

cd nginx-1.7.9

./configure --prefix=/usr/local/nginx --add-module=/usr/local/fastdfs-nginx-module/src --with-pcre=/usr/local/pcre-8.12 --with-zlib=/usr/local/zlib-1.2.8

make

make install

cd /usr/local/nginx/conf

vi

添加

location /group1/M00{

    root /home/yuqing/fastdfs/data;

    ngx_fastdfs_module;

}

启动nginx就可以访问你测试上传的文件了。


以上配置经过实际操作的, 如果出现问题,一般都是配置文件没有配置好。


参看地址:/Linux/2014-10/