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/


  • 相关阅读:
    第二次作业
    动手动脑
    第五周总结
    第四周总结
    二维数组
    返回一个整数数组中最大子数组的和---第一次完善
    第三周总结
    第二周进度
    自我介绍
    返回一个整数数组中最大子数组的和
  • 原文地址:https://www.cnblogs.com/SeaSky0606/p/7380623.html
Copyright © 2011-2022 走看看