提前准备所需4个包:
FastDFS_v4.06.tar.gz
fastdfs-nginx-module_v1.16.tar.gz
libevent-2.0.20-stable.tar.gz
nginx-1.11.8.tar.gz
将所需包都拷贝到/usr/local/FastDFS目录下

一、安装步骤:
依赖包
tar zxvf libevent-2.0.19-stable.tar.gz
./configure --prefix=/usr
make clean
make
make install

二、安装FastDFS
tar zxvf FastDFS_v4.06.tar.gz
解压成功后会看到一个FastDFS名称的文件夹
cd FastDFS进入到解压目录下执行编译
./make.sh
./make.sh install

如果安装报错如下:
../common/sched_thread.o:在函数‘sched_start’中:
/usr/local/FastDFS/FastDFS/tracker/../common/sched_thread.c:495:对‘pthread_create’未定义的引用
../common/pthread_func.o:在函数‘init_pthread_lock’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:32:对‘pthread_mutexattr_init’未定义的引用
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:40:对‘pthread_mutexattr_settype’未定义的引用
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:57:对‘pthread_mutexattr_destroy’未定义的引用
../common/pthread_func.o:在函数‘init_pthread_attr’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:84:对‘pthread_attr_getstacksize’未定义的引用
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:115:对‘pthread_attr_setstacksize’未定义的引用
../common/pthread_func.o:在函数‘create_work_threads’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:156:对‘pthread_create’未定义的引用
../common/pthread_func.o:在函数‘kill_work_threads’中:
/usr/local/FastDFS/FastDFS/tracker/../common/pthread_func.c:182:对‘pthread_kill’未定义的引用
collect2: error: ld returned 1 exit status
make: *** [fdfs_monitor] 错误 1

说明在执行make.sh过程中找不到pthread,也就是不同系统pthread的位置不一样,
需要在make.sh配置当前系统pthread的路径。
找到libpthread.so和libpthread.a
find / -name libpthread.so
/usr/lib/x86_64-linux-gnu/libpthread.so

find / -name libpthread.a
/usr/lib/x86_64-linux-gnu/libpthread.a

打开make.sh编辑
if [ -f /usr/lib/libpthread.so ] || [ -f /usr/local/lib/libpthread.so ] || [ -f /lib64/libpthread.so ] || [ -f /usr/lib64/libpthread.so ] || [ -f /usr/lib/libpthread.a ] || [ -f /usr/local/lib/libpthread.a ] || [ -f /lib64/libpthread.a ] || [ -f /usr/lib64/libpthread.a ];
这段修改为找到的libpthread.so和libpthread.a路径
if [ -f /usr/lib/x86_64-linux-gnu/libpthread.so ] || [ -f /usr/lib/x86_64-linux-gnu/libpthread.a ];

如果还报错:
if [ 1 -eq 1 -a /usr/local/lib = "/usr/local/lib" ]; then sh ./fdfs_link_library.sh; fi
ln: 无法创建符号链接"/usr/lib64/libfastcommon.so": 没有那个文件或目录
ln: 无法创建符号链接"/usr/lib64/libfdfsclient.so": 没有那个文件或目录

修改FastDFS下/client/fdfs_link_library.sh.in
先查找这两文件
find / -name 'libfastcommon.so'
/usr/lib/libfastcommon.so
/usr/local/lib/libfastcommon.so

find / -name 'libfdfsclient.so'
/usr/lib/libfdfsclient.so
/usr/local/lib/libfdfsclient.so

64位系统

if [ "$OS_BITS" = "8" ]; then
ln -fs $TARGET_LIB/libfastcommon.so.1 /usr/lib64/libfastcommon.so
ln -fs $TARGET_LIB/libfdfsclient.so.1 /usr/lib64/libfdfsclient.so
fi
修改为
if [ "$OS_BITS" = "8" ]; then
ln -fs $TARGET_LIB/libfastcommon.so.1 /usr/lib/libfastcommon.so
ln -fs $TARGET_LIB/libfdfsclient.so.1 /usr/lib/libfdfsclient.so
fi

修改完后重新./make.sh install

三、
创建保存tracker数据文件和日志目录:/usr/local/FastDFS/fastdfs_tracker
创建保存storage数据文件和日志目录:/usr/local/FastDFS/fastdfs_storage

四、
修改conf/tracker.conf
base_path=/usr/local/FastDFS/fastdfs_tracker

#fastdfs-client插件项目中配置文件fdfs_client.conf的http.tracker_http_port = 9999
http.server_port=9999

修改storage.conf
base_path=/usr/local/FastDFS/fastdfs_storage
store_path_count=1 //这里只配了一个store_path0所以为1
store_path0=/usr/local/FastDFS/fastdfs_storage
tracker_server=192.168.1.102:22122
http.server_port=8888

五、启动和测试
修改conf/client.conf
base_path=/usr/local/fastdfs_client //事先创建/usr/local/fastdfs_client目录
tracker_server=192.168.1.102:22122

启动tracker命令:fdfs_trackerd /usr/local/FastDFS/FastDFS/conf/tracker.conf
如果报错
fdfs_trackerd: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
需要复制 cp /usr/lib/libevent-2.0.so.5 /usr/lib64/

启动storage命令:fdfs_storaged /usr/local/FastDFS/FastDFS/conf/storage.conf

测试上传:
fdfs_test /usr/local/FastDFS/FastDFS/conf/client.conf upload /usr/local/mt.jpeg

上传成功后访问:http://192.168.1.102:8888/group1/M00/00/00/wKg4ZViMChWAZ5IZAAJ3HMOTGwQ16_big.jpeg
这时候还访问不了需要安装Nginx

六、安装nginx
sudo mkdir /usr/local/nginx

解压fastdfs-nginx-module_v1.16.tar.gz
tar zxvf fastdfs-nginx-module_v1.16.tar.gz

解压nginx-1.11.8.tar.gz
tar zxvf nginx-1.11.8.tar.gz

进入nginx-1.11.8
添加自定义模块(带有FastDFS模块的Nginx)Nginx
sudo ./configure --prefix=/usr/local/nginx --add-module=/usr/local/FastDFS/fastdfs-nginx-module/src

如果报错:
./configure: error: the HTTP rewrite module requires the PCRE library.
需要安装pcre-devel
sudo apt-get install libpcre3 libpcre3-dev (ubuntu系统 )

如果报错:
./configure: error: the HTTP gzip module requires the zlib library.
安装libssl-dev
sudo apt-get install libssl-dev

然后执行
sudo make
sudo make install

七、
编辑/usr/local/nginx/conf/nginx.conf
//listen对应FastDFS/conf/storage.conf中的http.server_port=8888
listen 8888;
location ~/group1/M00 {
root /usr/local/FastDFS/fastdfs_storage/data;
ngx_fastdfs_module;
}

编辑/usr/local/FastDFS/fastdfs-nginx-module/src/mod_fastdfs.conf
tracker_server=192.168.1.102:22122
url_have_group_name = true
store_path0=/usr/local/FastDFS/fastdfs_storage

拷贝
sudo cp /usr/local/FastDFS/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/

----Nginx命令----
启动Nginx
sudo /usr/local/nginx/sbin/nginx

重启Nginx
sudo /usr/local/nginx/sbin/nginx -s reload

启动Nginx成功后再访问就可看到上传的图片了:
http://192.168.1.102:8888/group1/M00/00/00/wKg4ZViMChWAZ5IZAAJ3HMOTGwQ16_big.jpeg

----FastDFS命令----
启动:
fdfs_trackerd /usr/local/FastDFS/FastDFS/conf/tracker.conf
fdfs_storaged /usr/local/FastDFS/FastDFS/conf/storage.conf
或者
sudo /usr/local/bin/fdfs_trackerd /usr/local/FastDFS/FastDFS/conf/tracker.conf
sudo /usr/local/bin/fdfs_storaged /usr/local/FastDFS/FastDFS/conf/storage.conf

停止:
tracker: /usr/local/bin/stop.sh fdfs_trackerd
storage: /usr/local/bin/stop.sh fdfs_storaged

查看:
/usr/local/bin/fdfs_monitor /usr/local/FastDFS/FastDFS/conf/storage.conf
或者
fdfs_monitor /usr/local/FastDFS/FastDFS/conf/storage.conf

FastDFS_v4.06安装简记的更多相关文章

  1. ganglia安装简记

    首先需要安装EPEL的源. yum install -y ganglia.x86_64 ganglia-gmetad.x86_64 ganglia-web.x86_64 ganglia-gmond.x ...

  2. Ubuntu学习总结-06 安装 Nginx

    Nginx是由俄罗斯人(zhan dou min zu)开发的一款高性能的http和反向代理服务器,也可以用来作为邮件代理.相比较于其他的服务器,具有占用内存少,稳定性高等优势. 一 Ubuntu源码 ...

  3. Ubuntu 16.06 安装拼音输入法 设置双拼

    一不小心把Ubuntu删东西删坏了 呜- 刚好跟可恶的  下载 文件夹告别了 现在百度上的相关教程多多少少有些问题,多数过时了. +++++++++++++++++++++说正事专用分隔符++++++ ...

  4. Sublime Text 3 安装简记

    1.下载:( Sublime Text Version 3.1.1 Build 3176 ) https://www.sublimetext.com/3 2.安装Package Control: &q ...

  5. CentOS 7 软件安装简记

    Install SW Record ================= $ sudo yum install vim-X11.x86_64 $ sudo yum install clang.x86_6 ...

  6. MySQL免编译二进制包安装简记

    相比较于MySQL的源代码安装来说.免编译二进制包的速度实在是快了太多,而且性能损失也不是很大,同时具有一定的定制性.所以,如果没有特殊的 需求,尽量用MySQL免编译二进制包来安装MySQL. 1. ...

  7. CentOS7安装OpenStack(Rocky版)-06.安装Neutron网络服务(控制节点)

    上一章介绍了独立的nova计算节点的安装方法,本章分享openstack的网络服务neutron的安装配制方法 ------------------- 完美的分割线 ----------------- ...

  8. CDH5离线安装简记

    需要的介质如下:CM: cloudera-manager-el6-cm5.4.3_x86_64.tar.gzCDH parcel: CDH-5.4.0-1.cdh5.4.0.p0.27-el6.par ...

  9. FastDFS_v4.06+nginx-1.4.2配置详解

    径不带group名(storage只有一个group的情况),如/M00/00/00/xxx:       location /M00 {            ngx_fastdfs_module; ...

随机推荐

  1. 使用xmanager图形化远程连接rhel6

    使用xmanager图形化远程连接rhel6 xmanager中Xbrowser可以提供图形化桌面远程.和vnc比,可以类似于本地一样用户切换. 操作步骤: linux服务端: 1:查看/etc/in ...

  2. ROS 错误之 [rospack] Error: package 'beginner_tutorials' not found

    ubuntu 下面情况处理 $ cd $gedit .bashrc 再后面加入两行 source /opt/ros/indigo/setup.bash source /home/lv/catkin_w ...

  3. 恶意代码分析实战-x86反汇编速成班

    x86反汇编速成 x86体系结构 3种硬件构成: 中央处理器:负责执行代码 内存(RAM):负责存储所有的数据和代码 输入/输出系统(I/O):为硬盘.键盘.显示器等设备提供接口 内存 一个程序的内存 ...

  4. 那些IT行业的经典定律

    几十年来,IT界有一些非常著名的定律,蕴含着行业发展的大智慧,非常有趣,略作收集总结,再加上一丁点自己的浅见~ 一.摩尔定律:价格不变,集成电路上可容纳的元器件数目,约每隔18个月便会翻一倍,性能也将 ...

  5. ARMV8 Procedure Call Standard

    1.前言 2.  术语说明 Term Note ABI Application Binary Interface 应用程序二进制接口 EABI Embedded ABI  嵌入式ABI PCS Pro ...

  6. Android GsmCellLocation.getCellLocation返回NULL

    Android GsmCellLocation.getCellLocation返回NULL 1.首先 获取服务 telephonyManager =(TelephonyManager)getSyste ...

  7. vue系列之MVVM框架

    当数据发生变化时,ViewModel就会检测到,然后通知相应的View改变 当用户操作View时,ViewModel就会检测到,然后Model,修改相应的数据,最终实现双向绑定 适用场景:针对具有复杂 ...

  8. OCM_第九天课程:Section4—》OCM课程环境搭建

    注:本文为原著(其内容来自 腾科教育培训课堂).阅读本文注意事项如下: 1:所有文章的转载请标注本文出处. 2:本文非本人不得用于商业用途.违者将承当相应法律责任. 3:该系列文章目录列表: 一:&l ...

  9. hdu5443 ST表裸题:求区间最大

    #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #d ...

  10. pytest五:fixture_autouse=True

    平常写自动化用例会写一些前置的 fixture 操作,用例需要用到就直接传该函数的参数名称就行了.当用例很多的时候,每次都传返个参数,会比较麻烦.fixture 里面有个参数 autouse,默讣是 ...