FastDFS安装配置以及整合Nginx测试
2017-08-23 17:37
253 查看
FastDFS安装配置以及整合Nginx测试
本机平台:ubuntu 17.4第一步:安装前准备:
1:安装pthread库
buntu 下默认是没有pthread库的 ,用下面的指令安装 就可以了(可以不安装,但是我的好像不安装有点问题)view
p cop
sudo apt-get install glibc-doc sudo apt-get install manpages-posix-dev
2:安装Git
fastdfs依赖libfastcommon,需要从github上clone到本地编译安装。因此首先需要安装Git。
执行命令:
[html] view
plain copy
apt-get install git
3:克隆libfastcommon库
libfastcommon的源在项目 https://github.com/happyfish100/libfastcommon 需要使用git将其clone至本地安装。[html] view
plain copy
git clone https://github.com/happyfish100/libfastcommon.git
4:安装libfastcommon依赖
进入libfastcommon目录,依次执行脚本:
[html] view
plain copy
./make.sh
和
[html] view
plain copy
./make.sh install
5:设置环境变量和软链接
在32位ubuntu中,libfastcommon会安装在/usr/lib 中,64位系统则安装在 /usr/lib64 中。依次执行以下命令:(根据自己的操作系统选择路径)[html] view
plain copy
export LD_LIBRARY_PATH=/usr/lib/
和
[html] view
plain copy
ln -s /usr/lib/libfastcommon.so /usr/local/lib/libfastcommon.so
6.下载源文件和nginx插件,以及上传
放出地址:http://download.csdn.net/download/java__han/9947167
上传直linux
第二步:安装以及配置
1:安装Tracker服务。
1、解压缩
2、./make.sh
3、./make.shinstall
安装后在/usr/bin/目录下有以fdfs开头的文件都是编译出来的。
配置文件都放到/etc/fdfs文件夹
4、把/root/FastDFS/conf目录下的所有的配置文件都复制到/etc/fdfs下。
5、配置tracker服务。修改/root/FastDFS/conf/tracker.conf文件。
6、启动tracker。/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
重启使用命令:/usr/bin/fdfs_trackerd/etc/fdfs/tracker.confrestart
2:安装storage服务。
1、如果是在不同的服务器安装,第四步的1~4需要重新执行。
2、配置storage服务。修改/root/FastDFS/conf/storage.conf文件
3、启动storage服务。
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
3:测试服务。
1、修改配置文件/etc/fdfs/client.conf
2、测试
/usr/bin/fdfs_test/etc/fdfs/client.conf upload anti-steal.jpg
4:搭建nginx提供http服务。
可以使用官方提供的nginx插件。要使用nginx插件需要重新编译。
fastdfs-nginx-module_v1.16.tar.gz
1、解压插件压缩包
2、修改/root/fastdfs-nginx-module/src/config文件,把其中的local去掉。
3、对nginx重新config
./configure--sbin-path=/usr/local/nginx/nginx \
--conf-path=/usr/local/nginx/nginx.conf\
--pid-path=/usr/local/nginx/nginx.pid\
--with-http_ssl_module\
--add-module=/home/hc/upload/fastdfs-nginx-module/src
4、make 然后make install
5、把/root/fastdfs-nginx-module/src/mod_fastdfs.conf文件复制到/etc/fdfs目录下。编辑:
6、nginx的配置
在nginx的配置文件中添加一个Server:
[html] view
plain copy
server {
listen 80;
server_name 192.168.101.3;
location /group1/M00/{
#root/home/FastDFS/fdfs_storage/data;
ngx_fastdfs_module;
}
}
7、将libfdfsclient.so拷贝至/usr/lib下
cp /usr/lib64/libfdfsclient.so /usr/lib/
8、启动nginx
上传测试成功
相关文章推荐
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- FastDFS安装配置(整合fastDFs和nginx)
- FastDFS安装和配置,整合Nginx-1.13.3
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- WebSphere 6.1安装配置SSH2以及与MyEclipse整合手顺
- Hadoop2.6安装配置以及整合Eclipse开发环境
- Nginx缩略图和Fastdfs整合以及image_filter配置,7点经验结论和5个参考资料
- Linux 下 Trac SVN apache SSL 配置安装以及整合
- Nginx缩略图和Fastdfs整合以及image_filter配置,7点经验结论和5个参考资料
- SVN的安装配置 以及与MyEclipse 整合使用开发
- SVN的安装配置 以及与MyEclipse 整合使用开发
- Nginx缩略图和Fastdfs整合以及image_filter配置,7点经验结论和5个参考资料
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- unbuntu安装FastDFS遇到的问题以及配置
- 快速搭建springboot框架以及整合ssm+shiro+安装Rabbitmq和Erlang、Mysql下载与配置
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- php服务安装和配置以及和apache整合
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- Nexus OSS私服仓库的安装和配置以及与Maven整合配置