Installation and Configuration

Dependency Configuration

yum install git gcc gcc-c++ make automake vim wget libevent -y
sudo yum -y groupinstall "Development Tools"
sudo yum -y install libaio-devel

Compile and Install

# libfastcommon
git clone https://github.com/happyfish100/libfastcommon.git
cd libfastcommon/
./make.sh && sudo ./make.sh install
sudo ldconfig

# FastDFS
git clone https://github.com/happyfish100/fastdfs.git
cd fastdfs/
./make.sh && sudo ./make.sh install

Nginx Module Compilation

# Install Nginx
yum install nginx

# Compile module
NGINX_VER=$(nginx -v 2>&1 | sed -n 's/.*nginx\/\([0-9.]\+\).*/\1/p')
./configure --with-compat --add-dynamic-module=../fastdfs-nginx-module/src
make modules

Nginx Configuration

load_module /etc/nginx/modules/ngx_http_fastdfs_module.so;

server {
    listen 8888;
    location ~/group[0-9]+/M00 {
        ngx_fastdfs_module;
    }
}