如何免费搭建自己的图片服务器 Linux系统+FastDFS+Nginx

本文详细介绍了如何在Linux系统(CentOS7)上免费搭建自己的图片服务器,通过FastDFS和Nginx的整合,实现图片上传与访问。步骤包括依赖环境的安装、libfastcommon、tracker、storage的配置,以及FastDFS和Nginx的整合,最终实现在项目中便捷使用FastDFS的功能。
摘要由CSDN通过智能技术生成

在制作网站、小程序或者APP时,肯定离不开图片的,那么这些图片存放在什么位置?怎么存放?又如何展示呢,那么,这篇文章手把手带你搭建一台属于自己的图片服务器。

 

话不多说,上号,不对,是上代码:

 

所需工具:Linux系统+FastDFS+Nginx

 

1.依赖环境下载

系统: vagrant(centos7)

  • yum install -y  gcc-c++  #需要依赖gcc

  • yum install -y  pcre  #用于支持rewrite模块   pcre-8.32-17

  • yum  install -y  libevent  #FastDFS依赖libevent库 libevent-2.0.21-4.el7.x86_64

  • yum  install -y  zlib zlib-devel    #用于支持gzip模块 zlib-1.2.7-17.el7.x86_64

  • libfastcommon-master.zip   #libfastcommon包含了FastDFS运行所需要的一些基础库https://github.com/happyfish100/libfastcommon/releases

  • fastdfs-nginx-module-master.zip  # https://codeload.github.com/happyfish100/fastdfs-nginx-module/zip/master

  • FastDFS版本:fastdfs-5.11.zip  #https://github.com/happyfish100/fastdfs/archive/V5.11.zip

  • Nginx版本:nginx-1.14.tar.gz : #官网下载: http://nginx.org/en/download.html

2.安装libfastcommon

unzip libfastcommon-1.0.39.zip  mv libfastcommon-1.0.39 /usr/local/libfastcommoncd /usr/local/libfastcommon/./make.sh           #编译./make.sh install   #安装# 检查确认/usr/lib64  和 /usr/lib 目录下都生成了 libfastcommon.so (有些版本可能/usr/lib下不会生成)ls /usr/lib64  | grep libfastcommon.so  ls /usr/lib  | grep libfastcommon.so

3.安装tracker

cd /downloadunzip  fastdfs-5.11.zip mv fastdfs-5.11 /usr/local/FastDFScd /usr/local/FastDFS/./make.sh && ./make.sh install  #编译之后接着进行安装#确认安装成功,没有报错后,拷贝配置文件到/etc/fdfscp /usr/local/FastDFS/conf/* /etc/fdfs/#,进入/etc/fdfs 目录, 如果没有tracker.conf就拷贝一份tracker.conf.sample 去掉samplecp tr
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值