zoukankan      html  css  js  c++  java
  • Linux下安装nginx

    一。安装nginx的依赖

    1、安装gcc (yum -y install gcc)

    先运行gcc -v查看版本信息,看系统是否已经安装gcc

    2、安装pcre 

    yum -y install pcre-devel

    3、安装zlib

    yum -y install zlib zlib-devel

    4、安装openssl

    yum -y install openssl openssl-devel

    说明:如需支持ssl,才需要安装openssl

    综合命令

    yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel

    二。安装nginx

    1、下载源码包,选择稳定版本的

    2、解压到/usr/local

    tar -xzvf nginx.tar.gz -C /usr/local

    3、进入nginx目录,执行./configure

    4、执行make

    5、执行make install

    三、配置虚拟域名以及测试

    1、在/usr/local/nginx/conf下新建vhost文件夹

    mkdir vhost

    2、编辑nginx配置文件

    vim /usr/local/nginx/nginx.conf

    增加 include vhost/*.conf (将vhost里面的.conf结尾的文件加载到nginx.conf里面)

    3、创建域名转发配置文件

    4、重启nginx

    5、访问验证

    http://localhost:80

  • 相关阅读:
    FOJ2250 不可能弹幕结界
    寻找最大值
    Haybale Guessing
    MG loves string
    Curious Cupid
    Anton and Permutation
    TLE
    Jzzhu and Numbers
    Divisible Group Sums
    The merchant
  • 原文地址:https://www.cnblogs.com/metu/p/9038860.html
Copyright © 2011-2022 走看看