Ubuntu FastDFSv5.05+Nginx1.9.15 环境搭建
来源:互联网 发布:php浏览次数 编辑:程序博客网 时间:2024/05/20 06:55
#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
可以参照 http://blog.csdn.net/zht666/article/details/17137205
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 -fPIC && 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为(去掉local,并将lib->lib64)
CORE_INCS=”
为了nginx自启动还需要
ln -s /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/software/pcre-8.38 --with-zlib=/root/software/zlib-1.2.8 --add-module=/root/software/fastdfs-nginx-module/src --with-http_ssl_module --with-openssl=/root/software/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/
cd /etc/fdfs
mv storage.conf.sample storage.conf
mv tracker.conf.sample tracker.conf
mv client.conf.sample client.conf
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
5.配置文件实践
mkdir -p /usr/fastdfs/tracker
mkdir -p /usr/fastdfs/storage
mkdir -p /usr/fastdfs/storage0
mkdir -p /usr/fastdfs/client
mkdir -p /home/lmzhou/fastdfs-test-log
tracker.conf
base_path=/usr/fastdfs/trackerstorage.conf
base_path=/usr/fastdfs/storage
store_path0=/usr/fastdfs/storage0
#注意下面的ip是外网IP
tracker_server=120.27.26.94:22122
#下面的端口与nginx的listen端口一致
http.server_port=8888mod_fastdfs.conf
base_path=/usr/fastdfs/client
tracker_server=10.45.228.80:22122
url_have_group_name = true
store_path0=/usr/fastdfs/storage0/usr/local/nginx/conf/nginx.conf
listen 8888;
location /group1/M00 {
root /usr/fastdfs/storage0/data;
ngx_fastdfs_module;
}
-client.conf
base_path=/home/lmzhou/fastdfs-test-log
/home/lmzhou/fastdfs-test-log 要提前创建,用于使用fdfs_test测试上传
tracker_server=120.27.26.94:22122
- Ubuntu FastDFSv5.05+Nginx1.9.15 环境搭建
- 搭建lnmp环境(nginx1.9.15-源码)
- 搭建lnmp环境(nginx1.9.15-源码)
- Nginx1.7.4+Tomcat7+memcached集群环境搭建
- Nginx1.7.4+Tomcat7+memcached集群环境搭建
- windows php7+nginx1.10 环境搭建
- Windows2012+PHP7+NGINX1.9 搭建PHP环境
- centos6.5 搭建nginx1.6.0 +gridfs +mongodb2.4..10环境
- Centos 6.5 Nginx1.6.0 + php5.4.31 + mysql 环境搭建成功。
- LNMP环境搭建,自启动 php7,mysql5.6,nginx1.11
- LAMP环境搭建系列之四:编译安装Nginx1.8.1
- LNMP环境搭建 mysql5.7.20+nginx1.13.7+php7.1.12
- Ubuntu 编程环境搭建
- Ubuntu LAMP环境搭建
- ubuntu codeblocks环境搭建
- Ubuntu搭建Android环境
- Ubuntu开发环境搭建
- ubuntu java 环境搭建
- 查看mysql版本的四种方法
- 程序人生-002-往与今
- 索引器如何定义?有什么特点?和属性、数组之间的区别?
- 组播地址基础详解
- 使用scrapy爬取域名的whois信息
- Ubuntu FastDFSv5.05+Nginx1.9.15 环境搭建
- springmvc+jquery使用itext生存pdf文件
- MVC框架下分布视图重新加载
- 动态在RadioGroup加载RadioButton
- Contiki协议栈Rime:缓冲区管理packetbuf management
- Android FragmentTabHost轻松实现微博主界面(一)
- 调用Android手机相册功能并获取图片路径
- 一步步学spark之一scala面向对象之Object对象2.2
- ppt资料