前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >centos6快速搭建nginx

centos6快速搭建nginx

作者头像
云海谷天
发布2022-08-09 14:35:48
3640
发布2022-08-09 14:35:48
举报
文章被收录于专栏:技术一点点成长

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/


本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017-08-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档