美文网首页
2020-03-07

2020-03-07

作者: 敲到顺为止 | 来源:发表于2020-03-07 23:27 被阅读0次

nginx+fastdfs安装

1.准备部署安装包

(将所有包放到/usr/local/page目录下,pape是自己命名创建的目录)

FastDFS_v5.08.tar.gz

fastdfs-nginx-module_v1.16.tar.gz

libevent-2.0.20-stable.tar.gz

libfastcommon-1.0.36.tar.gz

nginx-1.17.6.tar.gz

nginx-http-concat-master.zip

openssl-1.0.2j.tar.gz

pcre-8.39.tar.gz

zlib-1.2.11.tar.gz

2.安装开始

###先安装fastdfs

cd /usr/local/page

tar -zxvf libevent-2.0.20-stable.tar.gz

tar -zxvf libfastcommon-1.0.36.tar.gz

tar -xvf FastDFS_v5.08.tar.gz

cd libevent-2.0.20-stable

./configure --prefix=/usr/local/libevent-2.0.20

make

make install

cd /usr/local/page/libfastcommon-1.0.36

sh make.sh

sh make.sh install

cd /usr/local/page/FastDFS

./make.sh

./make.sh install

cd /etc/fdfs

mv storage.conf.sample storage.conf

mv tracker.conf.sample tracker.conf

mkdir -p /data/fastdfs

cp /etc/fdfs/tracker.conf /etc/fdfs/tracker.conf.bak

cp /etc/fdfs/storage.conf /etc/fdfs/storage.conf.bak

sed -i 's/http.server_port=8080/http.server_port=8881/' /etc/fdfs/tracker.conf

sed -i 's/home\/yuqing\/fastdfs/data\/fastdfs/' /etc/fdfs/tracker.conf

sed -i 's/base_path=\/home\/yuqing\/fastdfs/base_path=\/data\/fastdfs/' /etc/fdfs/storage.conf

sed -i 's/store_path0=\/home\/yuqing\/fastdfs/store_path0=\/data\/fastdfs/' /etc/fdfs/storage.conf

sed -i 's/tracker_server=192.168.209.121:22122/tracker_server=tracker所在机器实际ip:22122/' /etc/fdfs/storage.conf

cp /usr/local/kernel/FastDFS/conf/http.conf /etc/fdfs

cp /usr/local/kernel/FastDFS/conf/mime.types /etc/fdfs

####启动fastdfs

/usr/bin/fdfs_monitor /etc/fdfs/storage.conf       ----先启动storage

/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf       ----再启动tracker

####安装nginx

cd /usr/local/page

tar -zxvf nginx-1.17.6.tar.gz

tar -zxvf  openssl-1.0.2j.tar.gz

tar -zxvf  pcre-8.39.tar.gz

tar -zxvf  zlib-1.2.11.tar.gz

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

unzip  nginx-http-concat-master.zip

sed -i.bak 's/usr\/local\/include\/fastdfs \/usr\/local\/include\/fastcommon/usr\/include\/fastdfs \/usr\/include\/fastcommon/' /usr/local/kernel/fastdfs-nginx-module/src/config

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

cp /etc/fdfs/mod_fastdfs.conf /etc/fdfs/mod_fastdfs.conf.bak

sed -i 's/tracker_server=tracker:22122/tracker_server=tracker所在机器实际ip:22122/'  /etc/fdfs/mod_fastdfs.conf

sed -i 's/store_path0=\/home\/yuqing\/fastdfs/store_path0=\/data\/fastdfs/'  /etc/fdfs/mod_fastdfs.conf

sed -i 's/url_have_group_name = false/url_have_group_name = true/'  /etc/fdfs/mod_fastdfs.conf

chmod 755 /etc/fdfs

chmod 755 /etc/fdfs/*

cd /usr/local/page/openssl-1.0.2j

./config

make

make install

cd /usr/local/page/zlib-1.2.11

./configure

make

make install

cd /usr/local/page/pcre-8.39

./configure

make

make install

cd /usr/local/page/nginx-1.17.6

./configure \

--prefix=/usr/local/nginx \

--with-stream \

--with-http_ssl_module \

--with-http_stub_status_module \

--with-pcre=../pcre-8.39 \

--with-zlib=../zlib-1.2.11 \

--with-openssl=../openssl-1.0.2j \

--add-module=../fastdfs-nginx-module/src \

--add-module=../nginx-http-concat-master

make

make install

sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

###启动nginx

/usr/local/nginx/sbin/nginx

3.相关命令

/usr/local/nginx/sbin/nginx  ---启动nginx

/usr/local/nginx/sbin/nginx -s reload   ---重启nginx

/usr/bin/fdfs_test /etc/fdfs/client.conf upload t1.jpg    ----fastdfs手动上传图片,前提要配合/etc/fdfs/client.conf里边的tracker ip

/usr/bin/fdfs_monitor /etc/fdfs/client.conf          ---查看fdfs状态

相关文章

  • git notes

    title: git notesdate: 2020-03-07 01:13:12tags: 工具 hexocat...

  • 【漫画优选】斗破苍穹

    简介 状态[连载中] 作者[天蚕土豆 任翔] 更新[2020-03-07] 最新[第834话 海角天涯,两鬓生华(...

  • 观察视角

    中原焦点团队 高艳峰 信阳 网络中级九期 坚持分享第703天 2020-03-07 错过了周四刘友龙老师...

  • 淘书小助手隐私协议

    **生效日期:2020-03-07 ** 淘书(以及以下提到的“我們”,“我們的”或“此應用程序”。)由主體公司提...

  • 每天日常隐私协议

    **生效日期:2020-03-07 ** 每天日常(以及以下提到的“我們”,“我們的”或“此應用程序”。)由主體公...

  • 你喜欢谁就去追,因为——

    2020-03-07 回来了? 我还没来得及给你做饭呢! 女:那我点外卖吧,你吃什么? 我看看哈 女:等我回个信息...

  • 产品创新地图:4个问题逼出成果--1

    编号:研习社2020-03-07 并不是每一篇混沌大学的课程,吴叔都会推荐。但能学习和借鉴,帮助落地的课程...

  • 2020-03-07

    2020-03-07 星期六 一、亿万富翁制造机分享 早上起床照镜子,看着自己的眼睛:美女,早上好!我爱你。吻! ...

  • 看书/《被讨厌的勇气》

    2020-03-07/03-08 昨日由于写推文已经没有多余的精力日更日记了。 忙着写女神节的广告推文。 对了,昨...

  • 读完这本书,让我想去伊朗转转

    2020-03-07 星期六 晴第184段文字 1 之前读过一本书《追风筝的人》。 看后觉得难以抑制内心的波澜,...

网友评论

      本文标题:2020-03-07

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