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)安装libfastcommongit 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.htmlnginx用于提供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/RjQf22f2) 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相关文章推荐
- nginx的基本配置和虚拟主机的配置
- Ansible安装配置Nginx
- nginx禁止未绑定域名访问 并且强行断开连接
- nginx配置静态资源地址
- 转:Nginx RTMP 功能研究
- Ubuntu下Nginx简单使用
- nginx整理
- CenOS Linux安装nginx
- nginx 静态服务器搭建
- NGINX日志切割
- Nginx安装/配置/使用
- nginx配置location总结及rewrite规则写法
- 高流量站点NGINX与PHP-fpm配置优化
- nginx的编译参数说明(百度的)
- Nginx+PHP实现无后缀访问
- nginx rewrite uri地址重写
- Nginx日志分割脚本
- Nginx源码安装
- nginx支持flv点播回放
- nginx镜像站操作记录