美文网首页
nginx-fastdfs-module整合

nginx-fastdfs-module整合

作者: JepWei | 来源:发表于2022-07-26 15:12 被阅读0次

参考
https://blog.csdn.net/qq_43644273/article/details/117442927
https://blog.csdn.net/k_520_w/article/details/115803398
https://blog.csdn.net/winsanity/article/details/120652198

一、安装依赖

yum install -y gcc gcc-c++ libevent make zlib zlib-devel gcc-c++ libtool openssl openssl-devel pcre pcre-devel

二、准备安装包

1.libfastcommon  版本:V1.0.56
git clone https://github.com/happyfish100/libfastcommon.git
2.fastdfs  版本:V6.08
git clone https://github.com/happyfish100/fastdfs.git
3.fastdfs-nginx-module  版本:V1.22
git clone https://github.com/happyfish100/fastdfs-nginx-module
4.nginx   版本:V1.22.0
wget http://nginx.org/download/nginx-1.22.0.tar.gz

三、安装nginx

useradd -M -s /sbin/nologin nginx
cd nginx-1.12.0/
./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_stub_status_module
make && make install
ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/nginx

四、安装libfastcommon、fastdfs、整合fastdfs-nginx-module

将以上三个包均解压到/usr/local/目录下

1.libfastcommon
cd libfastcommon/
./make.sh clean && ./make.sh && ./make.sh install

2.fastdfs
cd fastdfs/
./make.sh clean && ./make.sh && ./make.sh install
cd fastdfs/conf/
cp ./* /etc/fdfs/         #将配置文件复制到/etc/fdfs目录  或者 ./setup.sh /etc/fdfs
vi /etc/fdfs/tracker.conf        #将port和base_path按需修改
vi /etc/fdfs/storage.conf       #将base_path、store_path0、tracker_server按需修改

3.fastdfs-nginx-module
cp /usr/local/fastdfs-nginx-module-1.22/src/mod_fastdfs.conf /etc/fdfs/
vi /etc/fdfs/mod_fastdfs.conf      #将store_path0、storage_server_port、tracker_server修改成对应端口及路径。

4.启动服务
#将用到的路径目录生成
mkdir -p /home/yuqing/fastdfs
mkdir -p /home/yuqing/storage
#启动tracert和storage
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
#整合fastdfs模块
cd /opt/nginx-1.22.0
./configure --add-module=/usr/local/fastdfs-nginx-module-1.22/src
make
make install
vi /usr/local/nginx/conf/nginx.conf
在nginx.conf的server区域添加如下内容
server {
         location ~/group([0-9]){
         ngx_fastdfs_module;
            }
......

启动nginx
nginx
弹出
ngx_http_fastdfs_set pid=xxx
说明整合的模块启动了


相关文章

网友评论

      本文标题:nginx-fastdfs-module整合

      本文链接:https://www.haomeiwen.com/subject/fbpoirtx.html