1、下载nginx rpm包

下载地址:http://nginx.org/packages/mainline/centos/7/x86_64/RPMS/ ,可查看所有安装包

从中如下载:

wget http://nginx.org/packages/mainline/centos/7/x86_64/RPMS/nginx-1.11.5-1.el7.ngx.x86_64.rpm

2、安装nginx

rpm -ivh nginx-1.11.5-1.el7.ngx.x86_64.rpm

3、检查是否安装成功

nginx -v

输入此命令后显示nginx版本信息

4、开启服务

查看服务状态命令:systemctl status nginx.service

开启/停止/重启服务命令:systemctl start/stop/restart nginx.service 如开启服务:systemctl start nginx.service

开机启动/取消命令:systemctl enable/disable nginx.service  开机启动:systemctl enable nginx.service

5、查看服务是否正常

打开浏览器,输入地址:http://localhost  会显示nginx欢迎界面

无界面情况下,可以通过telnet loaclhost 80(telnet 127.0.0.1  80) 查看80端口是否开启(telnet没有安装 可以通过yum install telnet),然后输入任意字符比如"d",telnet 窗口返回服务器信息

[root@localhost /]# telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
d
HTTP/1.1 400 Bad Request
Server: nginx/1.11.5
Date: Thu, 03 Nov 2016 02:20:49 GMT
Content-Type: text/html
Content-Length: 173
Connection: close <html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.11.5</center>
</body>
</html>
Connection closed by foreign host.

在信息输出http头信息里面含Server: nginx/1.11.5,表示nginx已经提供服务

centos 7 nginx 安装的更多相关文章

  1. Centos下 Nginx安装与配置

    网上找了好多资料.都很难找全,这里以这个目录为主,进行备注. Nginx是一款轻量级的网页服务器.反向代理服务器.相较于Apache.lighttpd具有占有内存少,稳定性高等优势.它最常的用途是提供 ...

  2. centos下Nginx安装和配置多个域名的虚拟主机

    nginx安装步骤,源码编译安装(源码编译,可以自定制更多功能) openssl #user nobody; worker_processes ; #error_log logs/error.log; ...

  3. 虚拟机 centos 7 nginx安装

    1下载vmware 12,并安装.百度即可 2下载centos 7,将其安装在vmware 12中.百度即可,无复杂设置. 3设置vmware 中centos7能上网: a.右键计算机->管理- ...

  4. centos下nginx安装和配置

    注:此文是根据前辈的博客和自己实际动手总结出来的,不喜勿喷 1.准备工作 Nginx的安装依赖于以下三个包,意思就是在安装Nginx之前首先必须安装一下的三个包,注意安装顺序如下: 1 SSL功能需要 ...

  5. CentOS系统Nginx安装配置,随时更新

    ./configure --prefix=/etc/nginx \ #指定安装目录 --sbin-path=/usr/sbin/nginx \ #指定执行路径--conf-path=/etc/ngin ...

  6. centos下nginx安装与配置

    nginx依赖以下模块: l  gzip模块需要 zlib 库 l  rewrite模块需要 pcre 库 l  ssl 功能需要openssl库 tar xzvf nginx-1.9.15.tar. ...

  7. CentOS 7 Nginx安装配置

    1.添加Nginx源 yum install epel-release 2.安装Nginx yum install nginx 3.启动Nginx systemctl start nginx //配置 ...

  8. Centos下nginx安装

    安装很简单,这里记录只是为了记下下载地址: A.[root@localhost soft]# wget http://nginx.org/download/nginx-1.4.2.tar.gz B.[ ...

  9. 腾讯云centos,nginx安装

随机推荐

  1. 26. The Greenhouse Effect and Its Consequences 温室效应及其后果

    26. The Greenhouse Effect and Its Consequences 温室效应及其后果 ①The greenhouse effect causes trouble by rai ...

  2. lpm_clshift ip仿真

    今天仿真了一下lpm_clshift ip 其中din为输入的信号,sh_out为输出的信号. 以上为IP的设置. 可以看到din 的00000010 对应的step的2,一个时钟后sh_out的输出 ...

  3. Mouse Touch Stylus

    Mouse操作: preview mouse down, StylusDevice:null mouse down,StylusDevice:null preview mouse up, Stylus ...

  4. 《SLAM for Dummies》中文版《SLAM初学者教程》

    SLAM for Dummies  SLAM初学者教程A Tutorial Approach to Simultaneous Localization and Mapping  一本关于实时定位及绘图 ...

  5. gridview的编辑,更新,取消,自动分页等

    gridview编辑列,把左下角的"自动生成字段"的复选框的勾去掉 添加boundfield(绑定列)将其datafield设置为productname,headertext设置为 ...

  6. office2010安装不成功提示缺少MSXML 6.10.1129.0?

    office2010安装 1. office重装 由于之前重装系统后安装office2010很顺利,这次删除office2010,由于没有删除干净,在程序删除面板中误点删除了其他文件所致,所以在此安装 ...

  7. hdu 5063 操作逆推+mul每次要*2%(modo - 1)

    http://acm.hdu.edu.cn/showproblem.php?pid=5063 只有50个询问,50个操作逆推回去即可,注意mul每次要*2%(modo - 1)因为是指数! #incl ...

  8. PHP Functions - arsort()

    <?php $characters = array('a','b','c','d','e','f'); arsort($characters); print_r($characters); /* ...

  9. Thread in depth 4:Synchronous primitives

    There are some synchronization primitives in .NET used to achieve thread synchronization Monitor c# ...

  10. Mina Session

    Chapter 4 - Session The Session is at the heart of MINA : every time a client connects to the server ...