FastDFS基础

介绍

安装

CentOS(单机版)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$ yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y
### 创建安装包目录
$ mkdir -p /usr/local/src
### 创建数据存储目录
$ mkdir -p /home/dfs
$ cd /usr/local/src/
### 安装libfatscommon
$ git clone https://github.com/happyfish100/libfastcommon.git --depth 1
$ cd libfastcommon/
$ ./make.sh && ./make.sh install #编译安装
### 安装FastDFS
$ cd ../ #返回上一级目录
$ git clone https://github.com/happyfish100/fastdfs.git --depth 1
$ cd fastdfs/
$ ./make.sh && ./make.sh install #编译安装
### 配置文件准备
$ cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
$ cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
$ cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf #客户端文件,测试用
$ cp /usr/local/src/fastdfs/conf/http.conf /etc/fdfs/ #供nginx访问使用
$ cp /usr/local/src/fastdfs/conf/mime.types /etc/fdfs/ #供nginx访问使用
### 安装fastdfs-nginx-module
$ cd ../ #返回上一级目录
$ git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1
$ cp /usr/local/src/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs
### 安装nginx
$ wget http://nginx.org/download/nginx-1.15.4.tar.gz #下载nginx压缩包
$ tar -zxvf nginx-1.15.4.tar.gz #解压
#添加fastdfs-nginx-module模块
$ cd nginx-1.15.4/
$ ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/
$ make && make install #编译安装
坚持原创技术分享,您的支持将鼓励我继续创作!