FastDFS安装

本文详细指导如何在Linux上安装FastDFS,修改配置文件以指定新的路径,并将其与Fast-NGINX模块集成,实现文件上传和访问。涉及步骤包括Tracker和Storage Server设置、Nginx模块编译与配置、以及FastDFS的启动与停止。
摘要由CSDN通过智能技术生成

tar xzf FastDFS_v4.06.tar.gz

cd FastDFS

./make.sh  & ./make.sh install

修改tracker & storage server 配置文件

  vi /opt/FastDFS/tracker.conf

base_path=/home/yuqing/fastdfs  修改为:base_path=/opt/FastDFS/tracker   ##include http.conf  修改为:#include http.conf  

vi /opt/FastDFS/storage.conf

base_path=/home/yuqing/fastdfs 修改为: /opt/FastDFS  store_path0=/opt/FastDFS 修改store_path0=/opt/FastDFS/storage           

 tracker_server=192.168.1.33:22122 修改为 tracker_server=ip:22122

安装fast-nginx-module 1.15

1 安装nginx 通常安装在/opt/nginx

2 下载并解压FastDFS nginx module:  tar zxf fastdfs_nginx_module_v1.15.tar.gz

3 进入到nginx src目录: cd /opt/nginx

4 编译 ./configure --add-module=/opt/fastdfs-nginx-module/src      make; make install

5 编译之前可以修改配置文件的 FDFS_OUTPUT_CHUNK_SIZE 和 FDFS_MOD_CONF_FILENAME, 也可以不改

  CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='\"/etc/fdfs/mod_fastdfs.conf\"'"

6 做一个symbol link ${fastdfs_base_path}/data/M00 to ${fastdfs_base_path}/data

  例如:ln -s /opt/FastDFS/storage/data  /opt/FastDFS/storage/data/M00 

7 增加nginx 配置文件

       location /group1/M00 {

            root /opt/FastDFS/storage/data;

            ngx_fastdfs_module;

        }

8 修改/etc/fdfs/mod_fastdfs.conf

  url_have_group_name = true

9 启动nginx server

  /opt/nginx/sbin/nginx -s stop; /opt/nginx/sbin/nginx

yum install -y pcre-devel openssl-devel

./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre --add-module=/opt/fastdfs-nginx-module/src

location ~ /group[0-9]+/M00/ {

    root /opt/FastDFS/storage/data;

    ngx_fastdfs_module;

}

ln -s /opt/FastDFS/storage/data  /opt/FastDFS/storage/data/M00

1: 启动FastDFS

          tracker: /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf

          storage: /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf

2:关闭FastDFS

          tracker:/usr/local/bin/stop.sh /usr/local/bin/fdfs_tracker

          storage:/usr/local/bin/stop.sh /usr/local/bin/fdfs_storage

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shibushi114

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值