没有用tar包的方法,太麻烦,还需要找,还需要编译,还需要下乱七八糟的依赖模块。麻烦的一逼,看网上说的。就采用了在线安装的方法。很快。注意一下,这种方法安装是安装到系统默认的位置。我也不知道怎么换。留个坑,有空填,毕竟我也是linux菜逼。先用起来再说。

参考链接:https://blog.csdn.net/monologue_88/article/details/71520272

1.安装nginx

yum install yum-priorities -y
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install nginx
systemctl start nginx.service #启动nginx
systemctl stop nginx.service #停止
systemctl restart nginx.service #重启
systemctl enable nginx.service #设置开机启动

2.更改nginx端口号(根据自己需求)

cd /etc/nginx/conf.d/
vim default.conf
把listen 80改成listen 81
systemctl restart nginx.service #重启nginx 

3.访问http://ip:81即可看到nginx首页

亲测有效

centos7下安装nginx的方法的更多相关文章

  1. 学习笔记(1)centos7 下安装nginx

    学习笔记(1)centos7 下安装nginx 这里我是通过来自nginx.org的nginx软件包进行安装的. 1.首先为centos设置添加nginx的yum存储库 1.通过vi命令创建一个rep ...

  2. Windows和Linux(Centos7)下安装Nginx

    安装Nginx 这篇记录只不过做了一个简单总结,如果对这块没什么概念的话可以看一下知乎的这篇文章 https://zhuanlan.zhihu.com/p/83890573 window下安装 win ...

  3. centos7下安装nginx

    1.yum install epel-release(安装epel(Extra Packages for Enterprise Linux)) 2.yum repolist(确保epel添加到yum的 ...

  4. centos7下安装nginx(转)

    一.下载nginx安装包 访问地址:https://nginx.org 根据自己的需求下载合适的安装包 二.安装gcc gcc是用来编译下载下来的nginx源码 yum install gcc-c++ ...

  5. <亲测>CentOS7中使用yum安装Nginx的方法

    CentOS7中使用yum安装Nginx的方法   最近无意间发现Nginx官方提供了Yum源.因此写个文章记录下. 1.添加源 默认情况Centos7中无Nginx的源,最近发现Nginx官网提供了 ...

  6. Linux centos7环境下安装Nginx

    Linux centos7环境下安装Nginx的步骤详解 1.    首先到Nginx官网下载Nginx安装包 http://nginx.org/download/nginx-1.5.9.tar.gz ...

  7. centos7 下 安装部署nginx

    centos7 下 安装部署nginx 1.nginx安装依赖于三个包,注意安装顺序 a.SSL功能需要openssl库,直接通过yum安装: #yum install openssl b.gzip模 ...

  8. CentOS7下安装NVIDIA独立显卡驱动出现X service error问题解决方法

    问题症状: 最近在CentOS7下安装NVIDIA独立显卡驱动的过程中出现X service error问题,如下图所示: 解决方法: 0.到NVIDIA 官网上下载驱动文件(.run 格式) : N ...

  9. 在Centos7下安装与部署.net core

    在Centos7下安装与部署.net core 2018年02月28日 19:36:16 阅读数:388 个人安装流程,参照文档 https://www.cnblogs.com/Burt/p/6566 ...

随机推荐

  1. Hangfire Net Core2

    https://hangfire.jonecheung.win/configuration/using-redis.html Hangfire 官方支持 MSSQL 与 Redis(Hangfire. ...

  2. 使用Java+Kotlin双语言的LeetCode刷题之路(二)

    BasedLeetCode LeetCode learning records based on Java,Kotlin,Python...Github 地址 序号对应 LeetCode 中题目序号 ...

  3. ACL访问控制

    /etc/squid/squid.conf 定义语法: acl aclname  acltype   string acl  aclname  acltype   "file" s ...

  4. [2017BUAA软工]第零次作业

    第一部分:结缘计算机     你为什么选择计算机专业?你认为你的条件如何?和这些博主比呢?(必答) 我当初选择计算机,是因为:1.北航的前辈对北航计算机专业评价非常高:2.我也喜欢通过编程来代替我完成 ...

  5. springsession 实现session 共享

    首先加入依赖1 <dependency> <groupId>org.springframework.session</groupId> <artifactId ...

  6. Mysql8 连接提示 Client does not support authentication protocol requested by server; consider upgrading MySQL client 解决方法

    USE mysql;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';FLUSH PR ...

  7. 17mysql2█▓

    一.数据库的查询用法 1. 数据表记录的查询: 运算符.虑重.列运算.别名.排序.聚合函数.分组 1.1数据准备 create table exam(   id int primary key aut ...

  8. UVa - 10339

    It has been said that a watch that is stopped keeps better time than one that loses 1 second per day ...

  9. Java8 使用

    Java8 使用 链接:https://www.jianshu.com/p/936d97ba0362 链接:https://www.jianshu.com/p/41de7b5ac7b9 本文主要总结了 ...

  10. 学习Spring Boot:(二十六)使用 RabbitMQ 消息队列

    前言 前面学习了 RabbitMQ 基础,现在主要记录下学习 Spring Boot 整合 RabbitMQ ,调用它的 API ,以及中间使用的相关功能的记录. 相关的可以去我的博客/RabbitM ...