FastDFS + Nginx代理方式访问

                                           作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.在storage上安装nginx

1>.下载nginx软件(http://nginx.org/en/download.html)

2>.下载fastdfs-nginx-module模块并编译安装nginx

[root@node101 ~]# wget http://nginx.org/download/nginx-1.15.8.tar.gz
--2019-02-20 10:34:21--  http://nginx.org/download/nginx-1.15.8.tar.gz
Resolving nginx.org (nginx.org)... 95.211.80.227, 62.210.92.35, 2001:1af8:4060:a004:21::e3
Connecting to nginx.org (nginx.org)|95.211.80.227|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1027862 (1004K) [application/octet-stream]
Saving to: ‘nginx-1.15.8.tar.gz’100%[=========================================================================================================================================================================>] 1,027,862   27.0KB/s   in 15s    2019-02-20 10:34:37 (65.0 KB/s) - ‘nginx-1.15.8.tar.gz’ saved [1027862/1027862][root@node101 ~]# 

[root@node101 ~]# wget http://nginx.org/download/nginx-1.15.8.tar.gz

[root@node101 ~]# yum -y install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* base: mirror.jdcloud.com* extras: mirror.jdcloud.com* updates: mirror.jdcloud.com
base                                                                                                                                                                                        | 3.6 kB  00:00:00
extras                                                                                                                                                                                      | 3.4 kB  00:00:00
myglusterfs                                                                                                                                                                                 | 2.9 kB  00:00:00
mysql-connectors-community                                                                                                                                                                  | 2.5 kB  00:00:00
mysql-tools-community                                                                                                                                                                       | 2.5 kB  00:00:00
mysql80-community                                                                                                                                                                           | 2.5 kB  00:00:00
updates                                                                                                                                                                                     | 3.4 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-20.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-20.el7 for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-20.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-20.el7.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-20.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved===================================================================================================================================================================================================================Package                                                 Arch                                          Version                                                Repository                                      Size
===================================================================================================================================================================================================================
Installing:git                                                     x86_64                                        1.8.3.1-20.el7                                         updates                                        4.4 M
Installing for dependencies:perl-Error                                              noarch                                        1:0.17020-2.el7                                        base                                            32 kperl-Git                                                noarch                                        1.8.3.1-20.el7                                         updates                                         55 kperl-TermReadKey                                        x86_64                                        2.30-20.el7                                            base                                            31 kTransaction Summary
===================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)Total download size: 4.5 M
Installed size: 22 M
Downloading packages:
(1/4): perl-Error-0.17020-2.el7.noarch.rpm                                                                                                                                                  |  32 kB  00:00:00
(2/4): perl-TermReadKey-2.30-20.el7.x86_64.rpm                                                                                                                                              |  31 kB  00:00:00
(3/4): perl-Git-1.8.3.1-20.el7.noarch.rpm                                                                                                                                                   |  55 kB  00:00:00
(4/4): git-1.8.3.1-20.el7.x86_64.rpm                                                                                                                                                        | 4.4 MB  00:00:04
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              929 kB/s | 4.5 MB  00:00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                               1/4 Installing : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                             2/4 Installing : git-1.8.3.1-20.el7.x86_64                                                                                                                                                                       3/4 Installing : perl-Git-1.8.3.1-20.el7.noarch                                                                                                                                                                  4/4 Verifying  : perl-Git-1.8.3.1-20.el7.noarch                                                                                                                                                                  1/4 Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                               2/4 Verifying  : git-1.8.3.1-20.el7.x86_64                                                                                                                                                                       3/4 Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                             4/4 Installed:git.x86_64 0:1.8.3.1-20.el7                                                                                                                                                                                      Dependency Installed:perl-Error.noarch 1:0.17020-2.el7                                    perl-Git.noarch 0:1.8.3.1-20.el7                                    perl-TermReadKey.x86_64 0:2.30-20.el7                                   Complete!
[root@node101 ~]# 

[root@node101 ~]# yum -y install git

[root@node101 ~]# yum -y install gcc automake autoconf libtool make gcc-c++ openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* base: mirror.jdcloud.com* extras: mirror.jdcloud.com* updates: mirror.jdcloud.com
Package gcc-4.8.5-36.el7.x86_64 already installed and latest version
Package 1:make-3.82-23.el7.x86_64 already installed and latest version
Package gcc-c++-4.8.5-36.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: perl(Data::Dumper) for package: autoconf-2.69-11.el7.noarch
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
--> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.4-3.el7.noarch
--> Processing Dependency: perl(TAP::Parser) for package: automake-1.13.4-3.el7.noarch
---> Package libtool.x86_64 0:2.4.2-22.el7_3 will be installed
--> Running transaction check
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
---> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved===================================================================================================================================================================================================================Package                                                  Arch                                          Version                                                  Repository                                   Size
===================================================================================================================================================================================================================
Installing:autoconf                                                 noarch                                        2.69-11.el7                                              base                                        701 kautomake                                                 noarch                                        1.13.4-3.el7                                             base                                        679 klibtool                                                  x86_64                                        2.4.2-22.el7_3                                           base                                        588 k
Installing for dependencies:perl-Data-Dumper                                         x86_64                                        2.145-3.el7                                              base                                         47 kperl-Test-Harness                                        noarch                                        3.28-3.el7                                               base                                        302 kperl-Thread-Queue                                        noarch                                        3.02-2.el7                                               base                                         17 kTransaction Summary
===================================================================================================================================================================================================================
Install  3 Packages (+3 Dependent packages)Total download size: 2.3 M
Installed size: 6.8 M
Downloading packages:
(1/6): autoconf-2.69-11.el7.noarch.rpm                                                                                                                                                      | 701 kB  00:00:00
(2/6): perl-Thread-Queue-3.02-2.el7.noarch.rpm                                                                                                                                              |  17 kB  00:00:00
(3/6): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                                                                                              |  47 kB  00:00:00
(4/6): libtool-2.4.2-22.el7_3.x86_64.rpm                                                                                                                                                    | 588 kB  00:00:00
(5/6): perl-Test-Harness-3.28-3.el7.noarch.rpm                                                                                                                                              | 302 kB  00:00:01
(6/6): automake-1.13.4-3.el7.noarch.rpm                                                                                                                                                     | 679 kB  00:00:03
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              729 kB/s | 2.3 MB  00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : perl-Thread-Queue-3.02-2.el7.noarch                                                                                                                                                             1/6 Installing : perl-Test-Harness-3.28-3.el7.noarch                                                                                                                                                             2/6 Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                                             3/6 Installing : autoconf-2.69-11.el7.noarch                                                                                                                                                                     4/6 Installing : automake-1.13.4-3.el7.noarch                                                                                                                                                                    5/6 Installing : libtool-2.4.2-22.el7_3.x86_64                                                                                                                                                                   6/6 Verifying  : autoconf-2.69-11.el7.noarch                                                                                                                                                                     1/6 Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                                             2/6 Verifying  : perl-Test-Harness-3.28-3.el7.noarch                                                                                                                                                             3/6 Verifying  : perl-Thread-Queue-3.02-2.el7.noarch                                                                                                                                                             4/6 Verifying  : automake-1.13.4-3.el7.noarch                                                                                                                                                                    5/6 Verifying  : libtool-2.4.2-22.el7_3.x86_64                                                                                                                                                                   6/6 Installed:autoconf.noarch 0:2.69-11.el7                                        automake.noarch 0:1.13.4-3.el7                                        libtool.x86_64 0:2.4.2-22.el7_3                                       Dependency Installed:perl-Data-Dumper.x86_64 0:2.145-3.el7                                 perl-Test-Harness.noarch 0:3.28-3.el7                                 perl-Thread-Queue.noarch 0:3.02-2.el7                                Complete!
[root@node101 ~]#

[root@node101 ~]# yum -y install gcc automake autoconf libtool make gcc-c++ openssl

[root@node101 ~]# tar -zxf nginx-1.15.8.tar.gz -C /yinzhengjie/softwares/
[root@node101 ~]#
[root@node101 ~]# cd /yinzhengjie/softwares/nginx-1.15.8/
[root@node101 nginx-1.15.8]#
[root@node101 nginx-1.15.8]# ll
total 764
drwxr-xr-x 6 1001 1001   4096 Feb 20 10:35 auto
-rw-r--r-- 1 1001 1001 294414 Dec 25 22:53 CHANGES
-rw-r--r-- 1 1001 1001 449169 Dec 25 22:53 CHANGES.ru
drwxr-xr-x 2 1001 1001   4096 Feb 20 10:35 conf
-rwxr-xr-x 1 1001 1001   2502 Dec 25 22:53 configure
drwxr-xr-x 4 1001 1001   4096 Feb 20 10:35 contrib
drwxr-xr-x 2 1001 1001   4096 Feb 20 10:35 html
-rw-r--r-- 1 1001 1001   1397 Dec 25 22:53 LICENSE
drwxr-xr-x 2 1001 1001   4096 Feb 20 10:35 man
-rw-r--r-- 1 1001 1001     49 Dec 25 22:53 README
drwxr-xr-x 9 1001 1001   4096 Feb 20 10:35 src
[root@node101 nginx-1.15.8]#
[root@node101 nginx-1.15.8]# git clone https://github.com/happyfish100/fastdfs-nginx-module
Cloning into 'fastdfs-nginx-module'...
remote: Enumerating objects: 89, done.
remote: Total 89 (delta 0), reused 0 (delta 0), pack-reused 89
Unpacking objects: 100% (89/89), done.
[root@node101 nginx-1.15.8]#
[root@node101 nginx-1.15.8]# ll
total 768
drwxr-xr-x 6 1001 1001   4096 Feb 20 10:35 auto
-rw-r--r-- 1 1001 1001 294414 Dec 25 22:53 CHANGES
-rw-r--r-- 1 1001 1001 449169 Dec 25 22:53 CHANGES.ru
drwxr-xr-x 2 1001 1001   4096 Feb 20 10:35 conf
-rwxr-xr-x 1 1001 1001   2502 Dec 25 22:53 configure
drwxr-xr-x 4 1001 1001   4096 Feb 20 10:35 contrib
drwxr-xr-x 4 root root   4096 Feb 20 10:39 fastdfs-nginx-module                  #这个就是咱们刚刚clone的模块
drwxr-xr-x 2 1001 1001   4096 Feb 20 10:35 html
-rw-r--r-- 1 1001 1001   1397 Dec 25 22:53 LICENSE
drwxr-xr-x 2 1001 1001   4096 Feb 20 10:35 man
-rw-r--r-- 1 1001 1001     49 Dec 25 22:53 README
drwxr-xr-x 9 1001 1001   4096 Feb 20 10:35 src
[root@node101 nginx-1.15.8]#
[root@node101 nginx-1.15.8]#
[root@node101 nginx-1.15.8]# useradd -s /sbin/nologin -M www                    #创建用户用于一会编译时使用,你也可以自定义其他的用户名称
[root@node101 nginx-1.15.8]#
[root@node101 nginx-1.15.8]# cp fastdfs-nginx-module/src/config fastdfs-nginx-module/      #编译的时候必须有配置文件存在,否则会报错!
[root@node101 nginx-1.15.8]# 

[root@node101 ~]# whereis openssl
openssl: /usr/bin/openssl /usr/lib64/openssl /usr/share/man/man1/openssl.1ssl.gz
[root@node101 ~]#
[root@node101 ~]# ls /usr/lib64/openssl
engines
[root@node101 ~]#
[root@node101 nginx-1.15.8]# ./configure --prefix=/yinzhengjie/softwares/nginx-1.15.8 --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --add-module=./fastdfs-nginx-module  --with-openssl=/usr/lib64/openssl
checking for OS+ Linux 3.10.0-957.el7.x86_64 x86_64
checking for C compiler ... found+ using GNU C compiler+ gcc version: 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for EPOLLEXCLUSIVE ... not found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for prctl(PR_SET_KEEPCAPS) ... found
checking for capabilities ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for sched_setaffinity() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_SENDSRCADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for clock_gettime(CLOCK_MONOTONIC) ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in ./fastdfs-nginx-module+ ngx_http_fastdfs_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for zlib library ... found
creating objs/MakefileConfiguration summary+ using system PCRE library+ using OpenSSL library: /usr/lib64/openssl+ using system zlib librarynginx path prefix: "/yinzhengjie/softwares/nginx-1.15.8"nginx binary file: "/yinzhengjie/softwares/nginx-1.15.8/sbin/nginx"nginx modules path: "/yinzhengjie/softwares/nginx-1.15.8/modules"nginx configuration prefix: "/yinzhengjie/softwares/nginx-1.15.8/conf"nginx configuration file: "/yinzhengjie/softwares/nginx-1.15.8/conf/nginx.conf"nginx pid file: "/yinzhengjie/softwares/nginx-1.15.8/logs/nginx.pid"nginx error log file: "/yinzhengjie/softwares/nginx-1.15.8/logs/error.log"nginx http access log file: "/yinzhengjie/softwares/nginx-1.15.8/logs/access.log"nginx http client request body temporary files: "client_body_temp"nginx http proxy temporary files: "proxy_temp"nginx http fastcgi temporary files: "fastcgi_temp"nginx http uwsgi temporary files: "uwsgi_temp"nginx http scgi temporary files: "scgi_temp"[root@node101 nginx-1.15.8]# echo $?
0
[root@node101 nginx-1.15.8]# 

[root@node101 nginx-1.15.8]# ./configure --prefix=/yinzhengjie/softwares/nginx-1.15.8 --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --add-module=./fastdfs-nginx-module --with-openssl=/usr/lib64/openssl

  编译安装nginx后,可参考连接:https://github.com/happyfish100/fastdfs-nginx-module/blob/master/INSTALL

转载于:https://www.cnblogs.com/yinzhengjie/p/10398928.html

FastDFS + Nginx代理方式访问相关推荐

  1. Nginx代理无法访问Nexus问题

    文章目录 一.问题现象 nginx和nexus的配置方式 二.原因分析 三.解决方式 一.问题现象 通过域名访问Nexus主页,主页html可以正常加载,但是静态资源加载超时,原因是静态资源的请求地址 ...

  2. 内网Linux服务器如何通过代理方式访问外网

    在目前5G网络和互联网高速发展的时代,还有云计算的普及,但是考虑到很多安全的因素考虑,在现实工作中,很多时候需要脱离外网进入linux,这样导致工作的效率大幅度减低,下面介绍几种通过代理的方式访问内网 ...

  3. vue项目nginx代理图片访问请求

    vue前台访问springboot项目图片,路径无法访问到图片文件,需要做下地址转换,推荐在springboot中配置虚拟路径,但是如果很多地方已经配置的磁盘路径,修改的地方比较多,可以使用nginx ...

  4. 安装cockpit通过nginx代理访问

    安装cockpit通过nginx代理访问 安装cockpit后,默认只能通过IP地址+端口号来访问.其实,还可以通过nginx代理来访问. Nginx代理设置 添加Nginx.conf配置 ## 添加 ...

  5. 二、Nginx 代理

    一.Nginx 配置 二.Nginx 代理 三.Nginx 负载均衡 四.Nginx 性能调优 一.Nginx 代理 提高访问速度. 由于 目标主机 返回的数据,会存放在 代理服务器 的硬盘中. 因此 ...

  6. 若依前后端分离版本,Windows下使用Nginx代理的方式进行部署(全流程,图文教程)

    场景 若依官网: http://doc.ruoyi.vip/ 前提: 服务器上安装Mysql,并将数据库导入,在SpringBoot中的application-druid.yml配置mysql数据库连 ...

  7. (转)IIS tomcat共用80端口解决一个IP多个域名:使用Nginx反向代理方式使两者兼容...

    from :http://www.cnblogs.com/wuyou/p/3455619.html 环境: windows server 2003,IIS6服务器,Tomcat7服务器 域名有几个: ...

  8. nginx 代理多个服务器——多个server方式

    原文链接:https://blog.csdn.net/wild46cat/article/details/52997005 -------------------------------------- ...

  9. Linux Centos8 安装Minio开机启动并Nginx代理访问

    查看官方文档(MinIO)进行操作 安装minio #下载 wget https://dl.min.io/server/minio/release/linux-amd64/minio#创建目录 sud ...

最新文章

  1. server 2008 R2 使用笔记
  2. 第九章 Redis过期策略
  3. 对抗焦虑症(恐惧症)研究
  4. 关闭edge任务栏预览_如何在Microsoft Edge中关闭选项卡预览
  5. 轻量级开源小程序SDK发车啦
  6. docker registry v2与harbor的搭建
  7. 【elasticsearch】 elasticsearch document 路由 (routing) 到shard
  8. 怎样设置计算机安全模式,电脑如何设置F8进入安全模式?
  9. 【毕业设计】jsp+sql毕业选题系统(论文)
  10. 计算机毕业设计中用js+html+java文件下载(一)
  11. python 运算符及 字符串格式化输出方式 if条件语句判断 random函数简单应用练习
  12. 二叉树前序中序后序javascript_详解二叉树遍历(前序、中序、后序、层次遍历、深度优先、广度优先)...
  13. Spring mvc 项目整合P6Spy
  14. golang中的dns问题
  15. Android Pitfall - 扒一扒RadioGroup 和 RadioButton
  16. 自动打call机 qq伪自动发消息
  17. 厦门市各公交线路途经站点
  18. 海康iSecure Center 综合安防管理平台安装部署教程 - CentOS系统
  19. 打算的亲爱额请问请问额
  20. Sqlite中文排序研究

热门文章

  1. [Java开发之路](23)装箱与拆箱
  2. SpringInAction--Spring Web应用之SpringMvc 注解配置
  3. compass reset和layout [Sass和compass学习笔记]
  4. Tomcat安全加固
  5. 安装Redis Live监控服务
  6. typedef 函数指针
  7. html转义符 xsl转义符
  8. com学习笔记(6)类厂
  9. 理论与实践中的CNN模型结构,如何引领深度学习热潮
  10. C++中的向上类型转换和向下类型转换+四种强制类型转换