下载fastdfs-5.0.5.tar.gz、libfastcommon.zip、fastdfs-nginx-module_v1.15.tar.gz
安装、设置libfastcommon
libfastcommon:./make.sh、./make.sh install
install -m 755 libfastcommon.so /usr/lib64
mkdir -p /usr/include/fastcommon
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
安装设置fastdfs
make、make install
vim /etc/fdfs/tracker.conf:base_path=/tracker
fdfs_trackerd tracker.conf
vim /etc/fdfs/storage.conf:
http.disabled=true
http.server_port=80
group_name=group1
base_path=/storage
store_path0=/storage
tracker_server=192.168.1.68:22122
fdfs_storaged storage.conf
cp conf/http.conf /etc/fdfs/
安装配置fastdfs-nginx-module,安装在storage机器上;
vi /etc/fdfs/mod_fastdfs.conf:
tracker_server=192.168.1.68:22122
url_have_group_name = true
store0_path=/storage
cp src/mod_fastdfs.conf /etc/fdfs/
vi fastdfs-nginx-module/conf:
CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"
改为
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
测试
vi /etc/fdfs/client.conf:
base_path=/tmp
tracker_server=192.168.1.68:22122
client/fdfs_upload_file /etc/fdfs/client.conf /tmp/index.html
安装nginx
./configure --prefix=/usr/local/nginx-1.9.4 \
--sbin-path=/usr/local/nginx-1.9.4/sbin/nginx \
--conf-path=/usr/local/nginx-1.9.4/conf/nginx.conf \
--pid-path=/usr/local/nginx-1.9.4/nginx.pid \
--with-http_ssl_module \
--with-zlib=/usr/local/zlib-1.2.8 \
--with-openssl=/usr/local/openssl-1.0.2d \
--add-module=/usr/local/fastdfs-nginx-module/src
make、make install