FastDFS + Nginx 反向代理缓存 安装与配置
FastDFS + Nginx 反向代理缓存 安装与配置
操作系统 CentOS release 6.5 (Final) 64
nginx相关软件
nginx-1.4.7 下载地址: http://nginx.org/en/download.html#
nginx清除缓存模块 ngx_cache_purge-2.1http://labs.frickle.com/nginx_ngx_cache_purge/
pcre-8.36 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
FastDFS相关软件
FastDFS_v5.04
http://sourceforge.net/projects/fastdfs/filesFastDFS Nginx Module 1.16
http://sourceforge.net/projects/fastdfs/files/FastDFS%20Nginx%20Module%20Source%20Code/libfastcommon
https://github.com/happyfish100/libfastcommon.git拓扑图
二、tracker的安装与配置
1.安装
以下操作是在 tracker 10.10.10.124上操作
通过rz工具,把软件上传到/usr/local/src目录下,如果没有rz工具,可以使用 yum -y install lrzsz 安装
[root@tracker src]# ls
FastDFS_v5.04.tar.gz
[root@tracker src]# tar xf FastDFS_v5.04.tar.gz
[root@tracker src]# cd FastDFS
[root@tracker FastDFS]# ll
总用量 132
drwxr-xr-x. 3 8980 users 4096 9月 21 22:14 client
drwxr-xr-x. 2 8980 users 4096 9月 21 22:14 common
drwxr-xr-x. 2 8980 users 4096 9月 21 22:14 conf
-rw-r--r--. 1 8980 users 35067 9月 21 22:14 COPYING-3_0.txt
-rw-r--r--. 1 8980 users 2802 9月 21 22:14 fastdfs.spec
-rw-r--r--. 1 8980 users 31224 9月 21 22:14 HISTORY
drwxr-xr-x. 2 8980 users 4096 9月 21 22:14 init.d
-rw-r--r--. 1 8980 users 7755 9月 21 22:14 INSTALL
-rwxr-xr-x. 1 8980 users 5735 9月 21 22:14 make.sh
drwxr-xr-x. 2 8980 users 4096 9月 21 22:14 php_client
-rw-r--r--. 1 8980 users 2380 9月 21 22:14 README.md
-rwxr-xr-x. 1 8980 users 1768 9月 21 22:14 restart.sh
-rwxr-xr-x. 1 8980 users 1680 9月 21 22:14 stop.sh
drwxr-xr-x. 4 8980 users 4096 9月 21 22:14 storage
drwxr-xr-x. 2 8980 users 4096 9月 21 22:14 test
drwxr-xr-x. 2 8980 users 4096 9月 21 22:14 tracker
[root@tracker FastDFS]# ./make.sh
执行make.sh 遇到的错误
[root@tracker FastDFS]# ./make.sh
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I/usr/include/fastcommon
../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录
在包含自 ../common/fdfs_global.c:21 的文件中:
../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录
../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录
In file included from ../common/fdfs_global.c:21:
../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内)
../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’
../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’
../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’
../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内)
../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内)
../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’
../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’
../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’
../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中:
../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’
../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’
make: *** [../common/fdfs_global.o] 错误 1
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon
../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录
在包含自 ../common/fdfs_global.c:21 的文件中:
../common/fdfs_global.h:14:27: 错误:common_define.h:没有那个文件或目录
../common/fdfs_global.h:16:29: 错误:connection_pool.h:没有那个文件或目录
In file included from ../common/fdfs_global.c:21:
../common/fdfs_global.h:26: 错误:‘MAX_PATH_SIZE’未声明(不在函数内)
../common/fdfs_global.h:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’
../common/fdfs_global.h:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’
../common/fdfs_global.h:29: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’
../common/fdfs_global.c:23: 错误:‘DEFAULT_CONNECT_TIMEOUT’未声明(不在函数内)
../common/fdfs_global.c:24: 错误:‘DEFAULT_NETWORK_TIMEOUT’未声明(不在函数内)
../common/fdfs_global.c:26: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_fdfs_version’
../common/fdfs_global.c:27: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_use_connection_pool’
../common/fdfs_global.c:28: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_connection_pool’
../common/fdfs_global.c: 在函数‘fdfs_check_data_filename’中:
../common/fdfs_global.c:39: 警告:隐式声明函数‘logError’
../common/fdfs_global.c:45: 警告:隐式声明函数‘IS_UPPER_HEX’
make: *** [../common/fdfs_global.o] 错误 1
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -DIOEVENT_USE_EPOLL -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I../tracker -I/usr/include/fastcommon
../common/fdfs_global.c:20:20: 错误:logger.h:没有那个文件或目录
在包含自 ../common/fdfs_global.c:21 的文件中:
../common/fdfs_global.h: