Linux 下fastdfs 安装 部署 测试

19 篇文章 0 订阅
2 篇文章 0 订阅

第一步:安装依赖包 (基础依赖):

yum install -y zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip

添加fastDFS运行用户:

useradd -s /sbin/nologin fastdfs

第二步:安装FastDFS 5.05

第三步:安装fastdfs-nginx模块 、安装nginx

第四步:设置配置nginx、fastdfs文件信息

第五步:启动fastdfs
启动tracker storage.conf :
/home/xuan/soft/fastdfs-5.05/tracker/fdfs_trackerd /etc/fdfs/tracker.conf

/home/xuan/soft/fastdfs-5.05/storage/fdfs_storaged /etc//fdfs/storage.conf

上传文件:/usr/local/bin/fdfs_upload_file
下载文件:/usr/local/bin/fdfs_download_file [local_filename]
删除文件:/usr/local/bin/fdfs_delete_file
monitor: /usr/local/bin/fdfs_monitor /etc/fdfs/client.conf
关闭:
killall fdfs_trackerd
killall fdfs_storaged

/usr/local/bin/stop.sh /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/local/bin/stop.sh /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
重启:
/usr/local/bin/restart.sh /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/local/bin/restart.sh /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf

第五步:测试

nginx.conf配置文件:

  ##fastdfs-begin
server {
       listen 80;
       server_name 192.168.1.102;
       root /webdata/fastdfs.com;
       index index.html index.htm;

   location / {

       if (!-e $request_filename) {
          rewrite ^(.*)$ /index.html last;
          }

   location /group1/M00 {
            root /home/data/fastdfs/storage/data/;
            ngx_fastdfs_module;
          }

   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js)$ {

        #fastcgi_cache cache_one;  #nginx.conf 开启cache才行,要不然启动报错
       fastcgi_cache_valid 200 10m;
       fastcgi_cache_valid 304 3m;
       fastcgi_cache_valid 301 302 1h;
       fastcgi_cache_valid any 1m;
       fastcgi_cache_min_uses 1;
       fastcgi_cache_use_stale error timeout invalid_header http_500;
       fastcgi_cache_key $host$request_uri;
       access_log off;
       }

       }

    access_log off;

}
#fastdfs-end
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值