• centos7.2安装Nginx


    Nginx的下载网址为:http://nginx.org/en/download.html

    Nginx源码下载

    # mkdir /root/nginx

    # cd /root/nginx

    # wget http://nginx.org/download/nginx-1.12.2.tar.gz

    # tar zxvf nginx-1.12.2.tar.gz

    安装依赖软件

    # yum -y install gcc gcc-c++ autoconf automake make zlib zlib-devel openssl openssl-devel pcre pcre-devel

    gccgcc-c++:标准GCC编译器;

    pcrepcre-devel:支持rewrite模块;

    zlib zlib -devel:支持gzip模块;

    opensslopenssl-devel:支持ssl模块。

    安装Nginx

    指定安装路径./configure --prefix=/usr/local/nginx指定安装路径为/usr/local/nginx

    # cd nginx-1.12.2

    # ./configure --prefix=/usr/local/nginx  

    编译

    # make

    安装

    # make install

    启动Nginx

    # cd /usr/local/nginx/sbin

    # ./nginx

    默认的端口为80端口,我安装Nginx的主机IP172.21.13.165,浏览器输入该IP地址,访问

    关于域名转发proxy_pass

    有一个需求,访问m.XXX.com的时候,需要实际访问www.YYY.com/m

    server {
      listen 80;
      server_name 172.21.13.165;

      #charset koi8-r;

      #access_log logs/host.access.log main;

      location / {
        # root html;
        # index index.html index.htm;
        proxy_pass http://172.21.16.151:8088/logins/;

      }

    }

  • 相关阅读:
    MQ
    redis
    MongoDB
    进程相关命令
    catalina.sh
    tomcat-jvm
    中间件简介
    websphere
    mysql
    shell变量与字符串操作
  • 原文地址:https://www.cnblogs.com/michaelcnblogs/p/12509287.html
Copyright © 2020-2023  润新知