• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

三木筒子

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

linux安装nginx(两种方式)

第一:yum 方式安装

  1:参考http://nginx.org/en/linux_packages.html#stable    

  2:根据自己的系统类型进行更改

  Pre-Built Packages for Stable version
  To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents:

  [nginx]
  name=nginx repo
  baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
  gpgcheck=0
  enabled=1


  Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “6” or “7”, for 6.x or 7.x versions, respectively.

  3:    查看 yum list | grep  nginx

    安装  yum install  nginx

  4: nginx -v 查看版本

     查看安装路径

   rpm -ql nginx

   得到安装路径后

  5:最后启动nginx /usr/sbin/nginx

  6:重启服务可以 使用

  systemctl restart nginx   或者  systemctl reload nginx

以上就结束安装了,

如有错误,请邮件zs253499660@sina.com,如有更好的方法,可以推荐

posted on 2018-09-21 15:54  森酱  阅读(267)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3