当前位置:   article > 正文

Centos6.5 踩坑(安装) fastdfs 最正确的姿势_make: *** [fdfs_monitor] error 1

make: *** [fdfs_monitor] error 1

一、准备文件

fastdfs-6.07.tar.gz   -->  fastdfs-5.03.tar.gz

fastdfs-nginx-module-1.22.tar.gz  -->  fastdfs-nginx-module_1.16

libfastcommon-1.0.7.tar.gz

nginx-1.18.0.tar.gz

二、安装与配置

1、安装编译工具、库文件等

[root@localhost ~]# yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

2、解压准备好的文件

  1. tar -zxvf fastdfs-nginx-module-1.22.tar.gz
  2. tar -zxvf fastdfs-6.07.tar.gz
  3. tar -zxvf libfastcommon-1.0.7.tar.gz
  4. tar -zxvf nginx-1.18.0.tar.gz

3.编译安装 libfastcommon

  1. [root@localhost opt]# cd libfastcommon-1.0.7
  2. [root@localhost libfastcommon-1.0.7]# ./make.sh && ./make.sh install

(1)报错:

  1. ./make.sh: line 14: gcc: command not found
  2. ./make.sh: line 15: ./a.out: No such file or directory
  3. ./make.sh: line 99: perl: command not found
  4. ./make.sh: line 100: perl: command not found
  5. cc -c -fPIC -o hash.lo hash.c
  6. make: cc: Command not found
  7. make: *** [hash.lo] Error 127

(2)原来是现在 centos6 版本源的问题,上面的 yum 命令并没有下载到任何文件,解决入口:Centos6.5 解决源无法使用问题_啊 这的博客-CSDN博客

4、重新 yum 相关文件后编译 libfastcommon

(1)查看到有此文件即可

  1. [root@localhost libfastcommon-1.0.7]# ll /usr/lib64/ |grep libfastcommon
  2. -rwxr-xr-x. 1 root root 283984 Apr 8 19:39 libfastcommon.so

5、编译安装 fastdfs

  1. [root@localhost opt]# cd fastdfs-6.07
  2. [root@localhost fastdfs-6.07]# ./make.sh && ./make.sh install

(1)报错:

  1. >>>>>>>>>>>>>>>>>>>
  2. /usr/include/fastcommon/ioevent.h:82:2: error: #error port me
  3. /usr/include/fastcommon/ioevent.h:95:2: error: #error port me
  4. /usr/include/fastcommon/ioevent.h:108:2: error: #error port me
  5. In file included from tracker_client_thread.h:15,
  6. from tracker_client_thread.c:31:
  7. storage_sync.h:14:32: error: fastcommon/fc_list.h: No such file or directory
  8. In file included from tracker_client_thread.h:15,
  9. from tracker_client_thread.c:31:
  10. storage_sync.h:43: error: field ‘link’ has incomplete type
  11. tracker_client_thread.c: In function ‘do_set_trunk_server_myself’:
  12. tracker_client_thread.c:1230: warning: implicit declaration of function ‘INIT_SCHEDULE_ENTRY_EX’
  13. tracker_client_thread.c:1234: error: ‘ScheduleEntry’ has no member named ‘new_thread’
  14. tracker_client_thread.c:1244: error: ‘ScheduleEntry’ has no member named ‘new_thread’
  15. >>>>>>>>>>>>>>>>>>>
  16. collect2: ld returned 1 exit status
  17. make: *** [fdfs_monitor] Error 1
  18. mkdir -p /usr/bin
  19. mkdir -p /etc/fdfs
  20. cp -f fdfs_trackerd /usr/bin
  21. cp: cannot stat `fdfs_trackerd': No such file or directory
  22. make: *** [install] Error 1
  23. mkdir -p /usr/bin
  24. mkdir -p /etc/fdfs
  25. cp -f fdfs_storaged /usr/bin
  26. cp: cannot stat `fdfs_storaged': No such file or directory
  27. make: *** [install] Error 1
  28. mkdir -p /usr/bin
  29. mkdir -p /etc/fdfs
  30. mkdir -p /usr/lib64
  31. mkdir -p /usr/lib
  32. cp -f fdfs_monitor fdfs_test fdfs_test1 fdfs_crc32 fdfs_upload_file fdfs_download_file fdfs_delete_file fdfs_file_info fdfs_appender_test fdfs_appender_test1 fdfs_append_file fdfs_upload_appender fdfs_regenerate_filename /usr/bin
  33. cp: cannot stat `fdfs_monitor': No such file or directory
  34. cp: cannot stat `fdfs_test': No such file or directory
  35. cp: cannot stat `fdfs_test1': No such file or directory
  36. cp: cannot stat `fdfs_crc32': No such file or directory
  37. cp: cannot stat `fdfs_upload_file': No such file or directory
  38. cp: cannot stat `fdfs_download_file': No such file or directory
  39. cp: cannot stat `fdfs_delete_file': No such file or directory
  40. cp: cannot stat `fdfs_file_info': No such file or directory
  41. cp: cannot stat `fdfs_appender_test': No such file or directory
  42. cp: cannot stat `fdfs_appender_test1': No such file or directory
  43. cp: cannot stat `fdfs_append_file': No such file or directory
  44. cp: cannot stat `fdfs_upload_appender': No such file or directory
  45. cp: cannot stat `fdfs_regenerate_filename': No such file or directory
  46. make: *** [install] Error 1

(2)解决:降低 fastdfs 版本 fastdfs-6.07、fastdfs-6.06、fastdfs-5.03  >> fastdfs-5.03 (中间的版本都是我尝试过的,最后5.03入围了),这个过程很漫长,我看到网上大多数人说是 gcc 版本的问题,中间我还对 gcc 进行了一个升级,升级到 4.8 以上了,但结果还是不理想,一样的报错。

(3)注意:检查 fdfs 相关配置文件及启动文件,若为 Centos7 编译完成,此目录下的都是以 sample 结尾的文件,需要自行用 cp 命令复制一份作为 config 配置文件

  1. [root@localhost FastDFS]# ll /etc/fdfs/
  2. total 56
  3. -rw-r--r--. 1 root root 1461 Apr 8 19:51 client.conf
  4. -rw-r--r--. 1 root root 858 Apr 8 19:51 http.conf
  5. -rw-r--r--. 1 root root 31172 Apr 8 19:51 mime.types
  6. -rw-r--r--. 1 root root 7535 Apr 8 19:51 storage.conf
  7. -rw-r--r--. 1 root root 6990 Apr 8 19:51 tracker.conf
  8. [root@localhost ~]# ll /usr/bin/ |grep fdfs
  9. [root@localhost ~]#

a、问题:只有配置文件,没有启动文件?

b、解决:原来 fdfsdfs-5.0.3 编译完成后的启动文件不是在 /usr/bin 下,而是在编译目录的 init.d 目录中,进入该目录即可看到

  1. [root@localhost init.d]# pwd
  2. /opt/FastDFS/init.d
  3. [root@localhost init.d]# ll
  4. total 8
  5. -rwxr-xr-x. 1 8980 users 1186 Aug 12 2014 fdfs_storaged
  6. -rwxr-xr-x. 1 8980 users 1186 Aug 12 2014 fdfs_trackerd
  7. [root@localhost init.d]#

(4)修改 tracker.conf 文件,因为该配置使用的 base_path 作为默认目录,所以我并没有修改 tracker.conf 文件,如果要修改请自行创建相关目录

(5)启动 tracker 服务

  1. [root@localhost init.d]# ./fdfs_trackerd start
  2. Starting FastDFS tracker server:
  3. [root@localhost init.d]# [2021-04-08 20:09:53] ERROR - file: ../common/process_ctrl.c, line: 189, "/home/yuqing/fastdfs" can't be accessed, error info: No such file or directory
  4. ^C
  5. [root@localhost init.d]# mkdir -p /home/yuqing/fastdfs
  6. [root@localhost init.d]# ./fdfs_trackerd start
  7. Starting FastDFS tracker server:

(6)修改 storage.conf 文件,修改 地址和端口,base_path 和 store_path0 可根据自己需求修改

  1. tracker_server = 192.168.0.200:22122
  2. http.server_port = 80

(7)启动 storage 服务

  1. [root@localhost init.d]# ./fdfs_storaged start
  2. Starting FastDFS storage server:

(8)修改 client.conf 文件,修改 base_path 和 tracker.conf 的base_path 一样的路径,并修改 tracker_server

tracker_server = 192.168.0.200:22122

6、编译安装 nginx 并整个 fastdfs-nginx-module 模块

(1)安装 pcre

[root@localhost ~]# yum -y install pcre pcre-devel

(2)配置 nginx ,添加 http_stub_status_module 模块和 http_ssl_module(ssl是因为我后面要配置 ssl 所以才加上)

[root@localhost nginx-1.18.0]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

(3)编辑 fastdfs-nginx-module 的配置文件 /opt/fastdfs-nginx-module-1.22/src/config 

  1. 将:/usr/local/include 都改为:/usr/include
  2. :%s+/usr/local+/usr

(4)配置 nginx ,添加 fastdfs-nginx-module 模块

[root@localhost nginx-1.18.0]# ./configure --add-module=/opt/fastdfs-nginx-module-1.22/src/

(5)编译安装 nginx 

a、make 编译的时候报错

  1. /http/modules -I /usr/include \
  2. -o objs/addon/src/ngx_http_fastdfs_module.o \
  3. /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c
  4. In file included from /opt/fastdfs-nginx-module-1.22/src//common.c:26,
  5. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  6. /usr/local/include/fastdfs/fdfs_define.h:15:27: error: common_define.h: No such file or directory
  7. In file included from /opt/fastdfs-nginx-module-1.22/src//common.c:27,
  8. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  9. /usr/local/include/fastdfs/fdfs_global.h:16:29: error: connection_pool.h: No such file or directory
  10. In file included from /opt/fastdfs-nginx-module-1.22/src//common.c:27,
  11. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  12. /usr/local/include/fastdfs/fdfs_global.h:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’
  13. In file included from /opt/fastdfs-nginx-module-1.22/src//common.c:28,
  14. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  15. /usr/local/include/fastdfs/fdfs_http_shared.h:17:29: error: ini_file_reader.h: No such file or directory
  16. /usr/local/include/fastdfs/fdfs_http_shared.h:18:18: error: hash.h: No such file or directory
  17. In file included from /opt/fastdfs-nginx-module-1.22/src//common.c:29,
  18. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  19. /usr/local/include/fastdfs/fdfs_client.h:12:25: error: shared_func.h: No such file or directory
  20. In file included from /usr/local/include/fastdfs/fdfs_client.h:13,
  21. from /opt/fastdfs-nginx-module-1.22/src//common.c:29,
  22. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  23. /usr/local/include/fastdfs/tracker_types.h:390: error: expected specifier-qualifier-list before ‘ConnectionInfo’
  24. /usr/local/include/fastdfs/tracker_types.h:398: error: expected specifier-qualifier-list before ‘ConnectionInfo’
  25. In file included from /usr/local/include/fastdfs/fdfs_client.h:14,
  26. from /opt/fastdfs-nginx-module-1.22/src//common.c:29,
  27. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  28. /usr/local/include/fastdfs/tracker_proto.h:218: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before*’ token
  29. /usr/local/include/fastdfs/tracker_proto.h:228: error: expected ‘)’ before*’ token
  30. /usr/local/include/fastdfs/tracker_proto.h:240: error: expected ‘)’ before*’ token
  31. /usr/local/include/fastdfs/tracker_proto.h:249: error: expected ‘)’ before*’ token
  32. /usr/local/include/fastdfs/tracker_proto.h:251: error: expected ‘)’ before*’ token
  33. /usr/local/include/fastdfs/tracker_proto.h:254: error: expected ‘)’ before*’ token
  34. /usr/local/include/fastdfs/tracker_proto.h:259: error: expected ‘)’ before*’ token
  35. In file included from /usr/local/include/fastdfs/client_global.h:16,
  36. from /usr/local/include/fastdfs/tracker_client.h:14,
  37. from /usr/local/include/fastdfs/fdfs_client.h:15,
  38. from /opt/fastdfs-nginx-module-1.22/src//common.c:29,
  39. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  40. /usr/local/include/fastdfs/fdfs_shared_func.h:65: error: expected ‘)’ before*’ token
  41. In file included from /usr/local/include/fastdfs/fdfs_client.h:15,
  42. from /opt/fastdfs-nginx-module-1.22/src//common.c:29,
  43. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  44. /usr/local/include/fastdfs/tracker_client.h:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before*’ token
  45. /usr/local/include/fastdfs/tracker_client.h:84: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before*’ token
  46. /usr/local/include/fastdfs/tracker_client.h:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before*’ token
  47. /usr/local/include/fastdfs/tracker_client.h:127: error: expected ‘)’ before*’ token
  48. /usr/local/include/fastdfs/tracker_client.h:140: error: expected ‘)’ before*’ token
  49. /usr/local/include/fastdfs/tracker_client.h:155: error: expected ‘)’ before*’ token
  50. /usr/local/include/fastdfs/tracker_client.h:172: error: expected ‘)’ before*’ token
  51. /usr/local/include/fastdfs/tracker_client.h:202: error: expected ‘)’ before*’ token
  52. /usr/local/include/fastdfs/tracker_client.h:218: error: expected ‘)’ before*’ token
  53. /usr/local/include/fastdfs/tracker_client.h:263: error: expected ‘)’ before*’ token
  54. /usr/local/include/fastdfs/tracker_client.h:278: error: expected ‘)’ before*’ token
  55. /usr/local/include/fastdfs/tracker_client.h:317: error: expected ‘)’ before*’ token
  56. /usr/local/include/fastdfs/tracker_client.h:331: error: expected ‘)’ before*’ token
  57. In file included from /usr/local/include/fastdfs/fdfs_client.h:16,
  58. from /opt/fastdfs-nginx-module-1.22/src//common.c:29,
  59. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  60. /usr/local/include/fastdfs/storage_client.h:67: error: expected ‘)’ before*’ token
  61. /usr/local/include/fastdfs/storage_client.h:151: error: expected ‘)’ before*’ token
  62. /usr/local/include/fastdfs/storage_client.h:158: error: expected ‘)’ before*’ token
  63. /usr/local/include/fastdfs/storage_client.h:175: error: expected ‘)’ before*’ token
  64. /usr/local/include/fastdfs/storage_client.h:226: error: expected ‘)’ before*’ token
  65. /usr/local/include/fastdfs/storage_client.h:244: error: expected ‘)’ before*’ token
  66. /usr/local/include/fastdfs/storage_client.h:275: error: expected ‘)’ before*’ token
  67. /usr/local/include/fastdfs/storage_client.h:297: error: expected ‘)’ before*’ token
  68. /usr/local/include/fastdfs/storage_client.h:314: error: expected ‘)’ before*’ token
  69. /usr/local/include/fastdfs/storage_client.h:337: error: expected ‘)’ before*’ token
  70. /usr/local/include/fastdfs/storage_client.h:361: error: expected ‘)’ before*’ token
  71. /usr/local/include/fastdfs/storage_client.h:386: error: expected ‘)’ before*’ token
  72. /usr/local/include/fastdfs/storage_client.h:405: error: expected ‘)’ before*’ token
  73. /usr/local/include/fastdfs/storage_client.h:422: error: expected ‘)’ before*’ token
  74. /usr/local/include/fastdfs/storage_client.h:439: error: expected ‘)’ before*’ token
  75. /usr/local/include/fastdfs/storage_client.h:456: error: expected ‘)’ before*’ token
  76. /usr/local/include/fastdfs/storage_client.h:475: error: expected ‘)’ before*’ token
  77. /usr/local/include/fastdfs/storage_client.h:494: error: expected ‘)’ before*’ token
  78. /usr/local/include/fastdfs/storage_client.h:510: error: expected ‘)’ before*’ token
  79. /usr/local/include/fastdfs/storage_client.h:532: error: expected ‘)’ before*’ token
  80. /usr/local/include/fastdfs/storage_client.h:550: error: expected ‘)’ before*’ token
  81. In file included from /usr/local/include/fastdfs/fdfs_client.h:17,
  82. from /opt/fastdfs-nginx-module-1.22/src//common.c:29,
  83. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  84. /usr/local/include/fastdfs/storage_client1.h:50: error: expected ‘)’ before*’ token
  85. /usr/local/include/fastdfs/storage_client1.h:89: error: expected ‘)’ before*’ token
  86. /usr/local/include/fastdfs/storage_client1.h:130: error: expected ‘)’ before*’ token
  87. /usr/local/include/fastdfs/storage_client1.h:145: error: expected ‘)’ before*’ token
  88. /usr/local/include/fastdfs/storage_client1.h:158: error: expected ‘)’ before*’ token
  89. /usr/local/include/fastdfs/storage_client1.h:178: error: expected ‘)’ before*’ token
  90. /usr/local/include/fastdfs/storage_client1.h:224: error: expected ‘)’ before*’ token
  91. /usr/local/include/fastdfs/storage_client1.h:240: error: expected ‘)’ before*’ token
  92. /usr/local/include/fastdfs/storage_client1.h:255: error: expected ‘)’ before*’ token
  93. /usr/local/include/fastdfs/storage_client1.h:274: error: expected ‘)’ before*’ token
  94. /usr/local/include/fastdfs/storage_client1.h:288: error: expected ‘)’ before*’ token
  95. /usr/local/include/fastdfs/storage_client1.h:300: error: expected ‘)’ before*’ token
  96. /usr/local/include/fastdfs/storage_client1.h:315: error: expected ‘)’ before*’ token
  97. /usr/local/include/fastdfs/storage_client1.h:334: error: expected ‘)’ before*’ token
  98. /usr/local/include/fastdfs/storage_client1.h:356: error: expected ‘)’ before*’ token
  99. /usr/local/include/fastdfs/storage_client1.h:379: error: expected ‘)’ before*’ token
  100. /usr/local/include/fastdfs/storage_client1.h:396: error: expected ‘)’ before*’ token
  101. /usr/local/include/fastdfs/storage_client1.h:411: error: expected ‘)’ before*’ token
  102. /usr/local/include/fastdfs/storage_client1.h:427: error: expected ‘)’ before*’ token
  103. /usr/local/include/fastdfs/storage_client1.h:442: error: expected ‘)’ before*’ token
  104. /usr/local/include/fastdfs/storage_client1.h:459: error: expected ‘)’ before*’ token
  105. /usr/local/include/fastdfs/storage_client1.h:477: error: expected ‘)’ before*’ token
  106. /usr/local/include/fastdfs/storage_client1.h:498: error: expected ‘)’ before*’ token
  107. /usr/local/include/fastdfs/storage_client1.h:524: error: expected ‘)’ before*’ token
  108. In file included from /opt/fastdfs-nginx-module-1.22/src//common.c:31,
  109. from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  110. /usr/local/include/fastdfs/trunk_shared.h:18:20: error: base64.h: No such file or directory
  111. In file included from /opt/fastdfs-nginx-module-1.22/src//ngx_http_fastdfs_module.c:6:
  112. /opt/fastdfs-nginx-module-1.22/src//common.c: In function ‘fdfs_mod_init’:
  113. /opt/fastdfs-nginx-module-1.22/src//common.c:349: error: request for member ‘path’ in something not a structure or union
  114. /opt/fastdfs-nginx-module-1.22/src//common.c:387: error: request for member ‘countin something not a structure or union
  115. /opt/fastdfs-nginx-module-1.22/src//common.c:387: error: request for member ‘countin something not a structure or union
  116. /opt/fastdfs-nginx-module-1.22/src//common.c:399: error: request for member ‘path’ in something not a structure or union
  117. cc1: warnings being treated as errors
  118. /opt/fastdfs-nginx-module-1.22/src//common.c: In function ‘fdfs_calc_content_length’:
  119. /opt/fastdfs-nginx-module-1.22/src//common.c:598: error: implicit declaration of functionget_current_time_us’
  120. /opt/fastdfs-nginx-module-1.22/src//common.c:598: error: format ‘%lx’ expects type ‘long unsigned int’, but argument 3 has type ‘int’
  121. /opt/fastdfs-nginx-module-1.22/src//common.c: In function ‘fdfs_http_request_handler’:
  122. /opt/fastdfs-nginx-module-1.22/src//common.c:1086: error: request for member ‘path’ in something not a structure or union
  123. /opt/fastdfs-nginx-module-1.22/src//common.c:1246: error: ‘FDFSHTTPParams’ has no member named ‘support_multi_range’
  124. /opt/fastdfs-nginx-module-1.22/src//common.c:1350: error: ‘ConnectionInfo’ undeclared (first use in this function)
  125. /opt/fastdfs-nginx-module-1.22/src//common.c:1350: error: (Each undeclared identifier is reported only once
  126. /opt/fastdfs-nginx-module-1.22/src//common.c:1350: error: for each function it appears in.)
  127. /opt/fastdfs-nginx-module-1.22/src//common.c:1350: error: expected ‘;’ before ‘storage_server’
  128. /opt/fastdfs-nginx-module-1.22/src//common.c:1354: error: ‘storage_server’ undeclared (first use in this function)
  129. /opt/fastdfs-nginx-module-1.22/src//common.c:1367: error: implicit declaration of function ‘storage_download_file_ex1
  130. /opt/fastdfs-nginx-module-1.22/src//common.c:1431: error: request for member ‘path’ in something not a structure or union
  131. make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] Error 1
  132. make[1]: Leaving directory `/opt/nginx-1.18.0'
  133. make: *** [build] Error 2

b、解决:更换 fastdfs-nginx-module 版本 fastdfs-nginx-module_1.22  >> fastdfs-nginx-module_1.16

(6)清理一下刚刚 make 编译文件

  1. [root@localhost nginx-1.18.0]# make clean
  2. rm -rf Makefile objs

(7)重新配置 nginx 添加相关模块(注:fastdfs-nginx-module-1.16 版本不需要修改 config 配置)

  1. [root@localhost nginx-1.18.0]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
  2. [root@localhost nginx-1.18.0]# ./configure --add-module=/opt/fastdfs-nginx-module/src

(8)重新编译安装 nginx

[root@localhost nginx-1.18.0]# make && make install

(9)将 mod_fastdfs.conf 文件复制到 /etc/fdfs/ 目录下 并修改配置

  1. [root@localhost src]# cp mod_fastdfs.conf /etc/fdfs/
  2. [root@localhost src]# vi mod_fastdfs.conf
  3. connect_timeout=10
  4. tracker_server=192.168.0.200:22122
  5. url_have_group_name = true

(10)复制 fastdfs 源码配置文件目录的 http.conf 和 mime.types 到 /etc/fdfs/ 目录下(这一步只有安装 fastdfs 高一点的版本才需要做,这个版本在 /etc/fdfs 目录下已经存在,centos7安装的时候会用)

(11)创建软连接,将其链接到实际存放数据的目录

  1. [root@localhost conf]# ll /home/yuqing/fastdfs/
  2. data/ logs/
  3. [root@localhost conf]# ln -s /home/yuqing/fastdfs/data /home/yuqing/fastdfs/data/M00

(12)修改 nginx 配置文件,内容如下:

  1. [root@localhost src]# vi /usr/local/nginx/conf/nginx.conf
  2. server {
  3. listen 80;
  4. server_name 192.168.0.200;
  5. location ~/group([0-9])/M00 {
  6. root /home/yuqing/fastdfs/data;
  7. ngx_fastdfs_module;
  8. }
  9. }

(13)启动 nginx

  1. [root@localhost ~]# /usr/local/nginx/sbin/nginx
  2. ngx_http_fastdfs_set pid=12902
  3. [root@localhost ~]# ps -ef |grep nginx
  4. root 12903 1 0 23:47 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
  5. root 12906 2228 0 23:47 pts/0 00:00:00 grep nginx

三、测试

1.上传一张测试图片,得到返回名

  1. [root@localhost ~]# /usr/local/bin/fdfs_upload_file /etc/fdfs/client.conf /opt/test.png
  2. group1/M00/00/00/wKgAyGBvLOGAFXdLAAKfqVbAb8c289.png

2.浏览器访问测试

(1)访问:http://192.168.0.200/group1/M00/00/00/wKgAyGBvLOGAFXdLAAKfqVbAb8c289.png

(2)如果你发现访问的时候没反应或者无法访问连接,一个是确定防火墙是否开放了80端口或者关闭防火墙、二是后面更改了 fastdfs-nginx-module 版本后忘记修改 mod_fastdfs.conf 文件的 tracker.server,这个可以在 nginx 日志中看到

四、总结

1.centos 6.5 安装 fastdfs 所需文件

fastdfs-5.03.tar.gz

fastdfs-nginx-module_1.16

libfastcommon-1.0.7.tar.gz

nginx-1.18.0.tar.gz

2.适用范围

该过程也适合其他 6 版本的系统

最后,如果大家看到有什么不对的请批评指出,相关文件大家根据自己方式网上下载或者用我提供的方式下载

CSDN:https://download.csdn.net/download/qq_25868251/16690497

百度云:链接:https://pan.baidu.com/s/1IFbOnVpk7UhttvoHQZ83pQ  提取码:7163 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/201201
推荐阅读
相关标签
  

闽ICP备14008679号