一、准备环境

准备如下 tar 包:

fastdfs-6.06.tar.gz
libfastcommon-1.0.43.tar.gz
fastdfs-nginx-module-1.22.tar.gz
nginx-1.17.7.tar.gz

下载地址:

fastdfs-nginx-module,libfastcommon,fastdfs

nginx地址

1、使用 wget 命令下载压缩包,如果没有 wget 命令使用 yum 命令安装

yum install wget

2、下载 fastdfs

wget -c "https://github.com/happyfish100/fastdfs/archive/V6.06.tar.gz" \
-O fastdfs-6.06.tar.gz

3、下载 libfastcommon

wget -c "https://github.com/happyfish100/libfastcommon/archive/V1.0.43.tar.gz" \
-O libfastcommon-1.0.43.tar.gz

4、下载 fastdfs-nginx-module

wget -c "https://github.com/happyfish100/fastdfs-nginx-module/archive/V1.22.tar.gz" \
-O fastdfs-nginx-module-1.22.tar.gz

5、下载 nginx

wget -c http://nginx.org/download/nginx-1.17.7.tar.gz

6、安装编译工具及库文件

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

7、测试环境关闭防火墙

systemctl stop firewalld.service

8、开机禁用防火墙

systemctl disable firewalld.service

9、查看防火墙状态

firewall-cmd --state

二、解压并编译安装

1、解压下载好的包

tar -zxvf fastdfs-6.06.tar.gz
tar -zxvf fastdfs-nginx-module-1.22.tar.gz
tar -zxvf libfastcommon-1.0.43.tar.gz
tar -zxvf nginx-1.17.7.tar.gz

2、编译安装

2.1、编译安装 libfastcommon

1、进入解压后的目录

cd /root/download/libfastcommon-1.0.43

2、编译安装

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

3、检查

ls /usr/lib64|grep libfastcommon
ls /usr/lib|grep libfastcommon

出现libfastcommon.so即成功

2.2、编译安装 fastdfs

1、进入解压后的目录

cd /root/download/fastdfs-6.06

2、编译安装

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

3、检查

ls /usr/bin|grep fdfs

4、启用配置文件

cd /etc/fdfs/

cp storage.conf.sample storage.conf

cp client.conf.sample client.conf

cp tracker.conf.sample tracker.conf

mkdir -p /fastdfs/tracker

5、修改 tracker.conf 文件

vi /etc/fdfs/tracker.conf

base_path = /fastdfs/tracker

6、启动 tracker 服务

/etc/init.d/fdfs_trackerd start

7、检查服务是否启动

ps -ef|grep fdfs`

8、修改 storage.conf 文件

vi /etc/fdfs/storage.conf

base_path = /fastdfs/storage store_path0 = /fastdfs/storage

tracker_server = 192.168.0.154:22122

http.server_port = 80

9、创建目录

mkdir -p /fastdfs/storage

10、启动 storage 服务

/etc/init.d/fdfs_storaged start

11、设置开机启动

vi /etc/rc.d/rc.local

加入配置

/etc/init.d/fdfs_trackerd start

/etc/init.d/fdfs_storaged start

12、编辑 client.conf 文件

vi /etc/fdfs/client.conf

修改

base_path=/fastdfs/tracker

tracker_server=192.168.0.154:22122

2.3、安装 nginx 和 fastdfs-nginx-module

1、安装pcre

yum -y install pcre pcre-devel

2、进入解压目录

cd /root/download/nginx-1.17.7

3、添加 http_stub_status_module 模块

./configure --prefix=/usr/local/nginx --with-http_stub_status_module

4、进入 /root/download/fastdfs-nginx-module-1.22/src/

cd /root/download/fastdfs-nginx-module-1.22/src/

5、编辑配置文件

vi config

6、将config文件中的/usr/local替换成/usr

:%s+/usr/local+/usr

7、进入 nginx 解压目录

cd /root/download/nginx-1.17.7

8、添加fastdfs-nginx-module

./configure --add-module=/root/download/fastdfs-nginx-module-1.22/src/

9、编译安装

make && make install

10、复制并修改fastdfs-ngin-module中的配置文件

cp /root/download/fastdfs-nginx-module-1.22/src/mod_fastdfs.conf /etc/fdfs/
vi /etc/fdfs/mod_fastdfs.conf

修改配置

connect_timeout=10

tracker_server=192.168.0.154:22122

url_have_group_name = true

store_path0=/fastdfs/storage

11、进入fastdfd源码conf目录

cd /root/download/fastdfs-6.06/conf/

11、将http.conf,mime.types两个文件拷贝到/etc/fdfs/目录下

cp http.conf mime.types /etc/fdfs/

12、创建一个软连接,在/fastdfs/storage文件存储目录下创建软连接,将其链接到实际存放数据 的目录

ln -s /fastdfs/storage/data/ /fastdfs/storage/data/M00

13、编辑 nginx 配置

vi /usr/local/nginx/conf/nginx.conf

修改配置

server {
listen 80;
server_name 192.168.0.154;
location ~/group([0-9])/M00 {
root /fastdfs/storage/data;
ngx_fastdfs_module;
}
}

14、启动 nginx

/usr/local/nginx/sbin/nginx

三、测试

1、下载测试图片到本地

wget -c "https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=0f6379cdd8ca7bcb7d2ecf298e39475b/42a98226cffc1e17f7efcc3f4590f603738de968.jpg" -O boy.jpg

2、上传测试图片

/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /root/download/boy.jpg

得到返回文件名

group1/M00/00/00/wKgAml4RxbyARj9lAACxR4LEYRg912.jpg

与ip拼接:http://192.168.0.154/group1/M00/00/00/wKgAml4RxbyARj9lAACxR4LEYRg912.jpg

CentOS8安装fastdfs6.06的更多相关文章

  1. centos8安装fastdfs6.06集群方式三之:storage的安装/配置/运行

    一,查看本地centos的版本 [root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) 说 ...

  2. centos8安装fastdfs6.06集群方式二之:tracker的安装/配置/运行

    一,查看本地centos的版本 [root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) 说 ...

  3. centos8安装fastdfs6.06集群方式一之:软件下载与安装

    一,查看本地centos的版本 [root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) 说 ...

  4. centos8安装fastdfs6.06(单机方式)

    一,下载 fastdfs6.06 1,官方地址 https://github.com/happyfish100 2,说明:当前版本:共3个子模块 fastdfs v6.06 libfastcommon ...

  5. CentOS8安装VirtualBox,并创建CentOS虚拟机

    安装VirtualBox 执行以下命令并启用VirtualBox和EPEL包仓库 [root@localhost~] dnf config-manager --add-repo=https://dow ...

  6. centos8 安装vmware需要的内核头文件 kernel-headers.

    centos8 安装vmware需要的内核头文件 kernel-headers. uname -r (查看内核版本) rpm -qa kernel-headers (查看kernel-headers版 ...

  7. Centos8安装Docker提示:package docker-ce-3:19.03.8-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed

    Centos8安装Docker提示:package docker-ce-3:19.03.8-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but ...

  8. CentOS8 安装MySQL5.7

    CentOS_8 安装MySQL5.7 1.在安装之前,如果你的系统曾经安装过Mariadb,请先卸载:yum remove mariadb*2.安装依赖 yum install -y epel-re ...

  9. CentOS8安装Geant4笔记(三):Geant4介绍、编译、安装支持Qt5界面并运行exampleB1例程显示Qt界面

    前言   上一篇,安装了Qt5环境.  本篇在服务器CentOs8.2上安装geant4软件,geant4使用Qt5来显示.   GEANT4 介绍   Geant4 是一个用于模拟粒子穿过物质的工具 ...

随机推荐

  1. C. Tokitsukaze and Duel 前缀维护

    枚举每一个连续的K的第一个位置,如果是先手胜利,那么前[1 , i-1 ]和[ i+k , n ]区间要么全是0,要么全是1 如果能够平局,那么肯定是[1,i-1],以及[ i+k , n]中有两种情 ...

  2. 云数据库 MySQL 8.0 重磅发布,更适合企业使用场景的RDS数据库

    点击订阅新品发布会! 新产品.新版本.新技术.新功能.价格调整,评论在下方,下期更新!关注更多内容,了解更多 最新发布 云数据库MySQL 8.0 升级发布会 2019年5月29日15时,阿里云云数据 ...

  3. 【Vue】基于nodejs的vue项目打包编译部署

    一·项目编译 1·进入项目目录下的终端执行命令 npm run build 正常情况如下图,如遇到错误不会编译成功,且编译后的html文件不能正常渲染. 2·编译完成后进入项目下的dist目录运行生成 ...

  4. hdu 1217 Arbitrage(佛洛依德)

    Arbitrage Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total S ...

  5. OpenCV 安装与调试

    Visual Studio 是微软提供的面向任何开发者的同类最佳工具. OpenCV(开源计算机视觉库)是一个开源的计算机视觉和机器学习软件库. 目前最新版本:Visual Studio 2019.O ...

  6. mybatis 逆向工程(通过数据库表针对单表自动生成mybatis执行所需要的代码)

    mybatis需要程序员自己编写sql语句,mybatis官方提供逆向工程,可以针对单表自动生成mybatis执行所需要的代码(mapper.java.mapper.xml.pojo…),可以让程序员 ...

  7. 一次操作系统报错OutOfMemory Error的处理记录

    在启动公司内嵌的tomcat容器时出现报错, 如下: # There is insufficient memory for the Java Runtime Environment to contin ...

  8. java 集合类 & 容器

    为什么出现集合类? 面向对象语言对事物的体现都是以对象的形式,所以为了方便对多个对象的操作,就要对对象进行存储,集合就是存储对象最常用的一种方式. 数组和集合类同是容器,有何不同? 数组虽然也可以存储 ...

  9. Innodb_large_prefix

    innodb_large_prefix Prefixes, defined by the length attribute, can be up to 767 bytes long for InnoD ...

  10. linux 如何编译安装软件