CentOS安装FastDFS

下载安装libfastcommon

wgethttps://github.com/happyfish100/libfastcommon/archive/V1.0.39.tar.gz

tar-zxvfV1.0.39.tar.gz

cdlibfastcommon-1.0.39

./make.sh

./make.shinstall

下载安装FastDFS

wgethttps://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz

tar-zxvfV5.11.tar.gz

cdfastdfs-5.11

./make.sh

./make.shinstall

修改配置FastDFS

cd/etc/fdfs

cptracker.conf.sampletracker.conf

cpstorage.conf.samplestorage.conf

vistorage.conf

修改tracker_server=112.74.44.203:22122

创建基础目录

mkdir/home/yuqing

mkdir/home/yuqing/fastdfs

分别启动服务

/etc/init.d/fdfs_trackerdstart

/etc/init.d/fdfs_storagedstart

文件上传测试

cd/etc/fdfs

cpclient.conf.sampleclient.conf

viclient.conf

修改tracker_server=112.74.44.203:22122

cd

echohello>test.txt

/usr/bin/fdfs_upload_file/etc/fdfs/client.conftest.txt

/usr/bin/fdfs_test/etc/fdfs/client.confuploadtest.txt

下载配置fastdfs-nginx-module

wgethttps://github.com/happyfish100/fastdfs-nginx-module/archive/V1.20.tar.gz

tar-zxvfV1.20.tar.gz

vifastdfs-nginx-module-1.20/src/config

修改ngx_module_incs="/usr/local/include/usr/include/fastcommon"

修改CORE_INCS="$CORE_INCS/usr/local/include/usr/include/fastcommon"

cpfastdfs-nginx-module-1.20/src/mod_fastdfs.conf/etc/fdfs

cd/etc/fdfs

vimod_fastdfs.conf

修改tracker_server=112.74.44.203:22122

修改url_have_group_name=true

cd/root/fastdfs-5.11/conf

cphttp.confmime.types/etc/fdfs

下载安装Nginx

yuminstall-ypcrepcre-devel

yuminstall-yzlibzlib-devel

yuminstall-yopensslopenssl-devel

wgethttp://nginx.org/download/nginx-1.15.8.tar.gz

tar-zxvfnginx-1.15.8.tar.gz

cdnginx-1.15.8

./configure--add-module=/root/fastdfs-nginx-module-1.20/src

make

makeinstall

/usr/local/nginx/sbin/nginx-V

cd/usr/local/nginx/conf

vinginx.conf

location~/group1/M00{

ngx_fastdfs_module;

}

cd/usr/local/nginx/sbin

./nginx

如果设置url_have_group_name=false

则nginx.conf配置文件需要改成

location~/M00{

ngx_fastdfs_module;

}

相关推荐