您的位置:首页 > 运维架构 > Nginx

Ubuntu FastDFSv5.05+Nginx1.9.15 环境搭建

2016-05-23 14:25 393 查看

FastDFS安装实践

环境简介

Ubuntu 12.04

单台机器测试

安装步骤

可以参照 http://dorole.com/1365/

1.安装FastDFS基础服务(Tracker, Storage节点都需要安装)

1)安装libfastcommon

git clone https://github.com/happyfish100/libfastcommon.git

cd libfastcommon/

./make.sh

./make.sh install

设置环境变量

export LD_LIBRARY_PATH=/usr/lib64/

ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so

2)安装FastDFS基础服务

wget http://iweb.dl.sourceforge.net/project/fastdfs/FastDFS%20Server%20Source%20Code/FastDFS%20Server%20with%20PHP%20Extension%20Source%20Code%20V5.05/FastDFS_v5.05.tar.gz

tar xzf FastDFS_v5.05.tar.gz

cd FastDFS

./make.sh

./make.sh install

确认make没有错误后,执行安装,默认会安装到/usr/bin中,并在/etc/fdfs中添加三个配置文件。

2.在Storage节点上安装nginx+fastdfs-nginx-module

可以参照 /article/1771905.html

nginx用于提供http访问存储的资源,fastdfs-nginx-module用于解决同一个group下资源同步延迟问题,可以将http的访问转发到一开始存储的节点上。

1)安装nginx依赖库

zlib

wget http://zlib.net/zlib-1.2.8.tar.gz

tar xzf zlib-1.2.8.tar.gz

cd zlib-1.2.8

./configure - -prefix=/usr/local/zlib-1.2.8 && make &&make install

pcre

wget http://exim.mirror.fr/pcre/pcre-8.38.tar.gz

tar xzf pcre-8.38.tar.gz

cd pcre-8.38

./configure –prefix=/usr/local/pcre-8.33 –libdir=/usr/local/lib/pcre –includedir=/usr/local/include/pcre && make && make install

openssl

wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz

tar xzf openssl-1.0.1e.tar.gz

cd openssl-1.0.1e

./config –prefix=/usr/local/openssl-1.0.1e && make && make install

2)安装ngnix

wget http://jaist.dl.sourceforge.net/project/fastdfs/FastDFS%20Nginx%20Module%20Source%20Code/fastdfs-nginx-module_v1.16.tar.gz

tar xzf fastdfs-nginx-module_v1.16.tar.gz

设置fastdfs-nginx-module使用的lib路径

cd fastdfs-nginx-module/src

vi config

修改CORE_LIBS为

CORE_LIBS=”$CORE_LIBS -L**/usr/lib64** -lfastcommon -lfdfsclient”

为了nginx自启动还需要

ln -n /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so

下载并安装nginx

wget http://nginx.org/download/nginx-1.9.15.tar.gz

tar xzf nginx-1.9.15.tar.gz

cd nginx-1.9.15

./configure –prefix=/usr/local/nginx –with-pcre=/root/pcre-8.38 –with-zlib=/root/zlib-1.2.8 –add-module=/root/fastdfs-nginx-module/src –with-http_ssl_module –with-openssl=/root/openssl-1.0.1e –sbin-path=/usr/local/nginx/sbin/nginx && make && make install

3)拷贝配置文件至/etc/fdfs/

cp FastDFS(源码解压目录)/conf/http.conf /etc/fdfs/

cp FastDFS(源码解压目录)/conf/mime.types /etc/fdfs/

cp FastDFS(源码解压目录)/conf/anti-steal.jpg /etc/fdfs/

cp fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/

3.修改配置文件

1) tracker.conf说明 http://www.tuicool.com/articles/RjQf22f

2) storage.conf说明 http://www.tuicool.com/articles/fuMJjyf

3) mod_fastdfs.conf 该文件中的配置决定了nginx的URL指向具体的文件位置

4) /usr/local/nginx/conf/nginx.conf 配置一个新的location

4.fastdfs java api开发说明

http://blog.sina.com.cn/s/blog_69357fbb0100r5c3.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: