zoukankan      html  css  js  c++  java
  • centos6快速搭建nginx

    step1:配置本地 yum库,保存
     
    $vi   /etc/yum.repos.d/nginx.repo

     
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
    gpgcheck=0
    enabled=1
     
    其中,"OS"为系统类型,如centos, rhel;"OSRELEASE"为系统发布版本,如“6”,“7”
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/centos/6/$basearch/
    gpgcheck=0
    enabled=1

     
    step2:yum安装
    $ sudo yum install -y nginx
     
     
    step3:启动服务
     
    ## 启动服务
    $ nginx
     
    ## 关闭nginx服务
    $ nginx -s stop
     
    step4:部署测试
    $ nginx -t
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
     
    ## 配置文件路径
    $ vi /etc/nginx/nginx.conf
     
    或者 
     
    $ vi /etc/nginx/init.d/default.conf

    最后访问web路径:

    http://test-host/


  • 相关阅读:
    第17章 委托
    第16章 数组
    第15章 枚举类型和位标志
    第14章 字符、字符串和文本处理
    第13章 接口
    第12章 泛型
    第10章 属性
    第11章 事件
    内部类(转载)
    Collections.sort的三种用法
  • 原文地址:https://www.cnblogs.com/SeaSky0606/p/7380623.html
Copyright © 2011-2022 走看看