Nginx简介(待编辑)

Nginx是一款轻量级但高性能的Web服务器及反向代理服务器,也是邮件的代理服务器,越来越多的人开始使用Nginx来替代原本使用的Apache。

Nginx的安装:

1、CentOS&Redhat的yum安装(以CentOS6.x为例):

确认系统信息

[[email protected] ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
[[email protected] ~]# uname -r
2.6.32-504.el6.x86_64
[[email protected] ~]# uname -m
x86_64

确认是否已经安装

[[email protected] ~]# rpm -aq nginx
[[email protected] ~]#

首先建议将yum源修改为阿里云

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

使用yum搜索nginx包

[[email protected] ~]# yum search nginx
Loaded plugins: fastestmirror, security
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                                           | 3.7 kB     00:00
epel                                                                                                                                           | 4.3 kB     00:00
epel/primary_db                                                                                                                                | 5.8 MB     00:13
extras                                                                                                                                         | 3.4 kB     00:00
updates                                                                                                                                        | 3.4 kB     00:00
updates/primary_db                                                                                                                             | 3.9 MB     00:10
========================================================================= N/S Matched: nginx =========================================================================
collectd-nginx.x86_64 : Nginx plugin for collectd
munin-nginx.noarch : Network-wide graphing framework (cgi files for nginx)
nginx-filesystem.noarch : The basic directory layout for the Nginx server
owncloud-nginx.noarch : Nginx integration for ownCloud
nginx.x86_64 : A high performance web server and reverse proxy server
Name and summary matches only, use "search all" for everything.
[[email protected] ~]#

        yum安装nginx

[[email protected] ~]# yum install nginx -y

启动nginx

[[email protected] ~]# /etc/init.d/nginx start
Starting nginx:                                            [  OK  ]

设置开机自启动nginx

[[email protected] ~]# chkconfig --list nginx
nginx          0:off1:off2:off3:off4:off5:off6:off
[[email protected] ~]# chkconfig nginx on
[[email protected] ~]# chkconfig --list nginx
nginx          0:off1:off2:on3:on4:on5:on6:off

2、Ubuntu&Debian的apt安装(以Debian7.x为例):

确认系统信息

[email protected]:~# cat /etc/issue
Debian GNU/Linux 7 \n \l
[email protected]:~#
[email protected]:~# uname -r
3.2.0-4-amd64
[email protected]:~# uname -m
x86_64

确认是否已经安装

[email protected]:~# dpkg -s nginx
dpkg-query: package ‘nginx‘ is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

使用apt搜索nginx包

[email protected]:~# apt-cache search nginx
collectd-core - statistics collection and monitoring daemon (core system)
fcgiwrap - simple server to run CGI applications over FastCGI
gitweb - fast, scalable, distributed revision control system (web interface)
gunicorn - Event-based HTTP/WSGI server
libplack-middleware-file-sass-perl - Sass and SCSS support for all Plack-based PSGI frameworks
nginx - small, powerful, scalable web/proxy server
nginx-common - small, powerful, scalable web/proxy server - common files
nginx-doc - small, powerful, scalable web/proxy server - documentation
nginx-extras - nginx web/proxy server (extended version)
nginx-extras-dbg - nginx web/proxy server (extended version) - debugging symbols
nginx-full - nginx web/proxy server (standard version)
nginx-full-dbg - nginx web/proxy server (standard version) - debugging symbols
nginx-light - nginx web/proxy server (basic version)
nginx-light-dbg - nginx web/proxy server (basic version) - debugging symbols
nginx-naxsi - nginx web/proxy server (version with naxsi)
nginx-naxsi-dbg - nginx web/proxy server (version with naxsi) - debugging symbols
nginx-naxsi-ui - nginx web/proxy server - naxsi configuration front-end
rt4-fcgi - External FastCGI support for request-tracker4
ruby-passenger - Rails and Rack support for Apache2 and Nginx
stud - scalable TLS unwrapping daemon
uwsgi-extra - fast, self-healing application container server (extra files)

通过apt安装nginx

[email protected]:~# yes | apt-get install nginx

再次查看nginx是否已经安装

[email protected]:~# dpkg -s nginx
Package: nginx
Status: install ok installed
Priority: optional
Section: httpd
Installed-Size: 87
Maintainer: Kartik Mistry <[email protected]>
Architecture: all
Version: 1.2.1-2.2+wheezy3
Depends: nginx-full | nginx-light
Description: small, powerful, scalable web/proxy server
 Nginx ("engine X") is a high-performance web and reverse proxy server
 created by Igor Sysoev. It can be used both as a standalone web server
 and as a proxy to reduce the load on back-end HTTP or mail servers.
 .
 This is a dependency package to install either nginx-full (by default) or
  nginx-light.
Homepage: http://nginx.net
时间: 2024-08-04 18:57:26

Nginx简介(待编辑)的相关文章

nginx简介及模块、缓存、反向代理

nginx简介 一.什么是Nginx: 实现web服务.实现web代理功能: 二.nginx的优点: 模块化设计.较好的扩展性,高可靠性,支持热部署,支持事件驱动等: 高可靠: master --> worker 低内存消耗: 10000个keep-alive模式下的connection,仅需要2.5MB的内存: 支持热部署: 不停机而更新配置文件.日志文件滚动.升级程序版本: 支持事件驱动.AIO.mmap: 三.nginx: 首先介绍下httpd的工作模式: httpd: MPM prefo

Nginx学习总结(1):Nginx简介

(最近,部门组织了好几个技术兴趣小组,对当前的热门技术进行研究.我加入了Nginx学习小组,与几个同事一道围绕Nginx来进行研究和学习.从今天起,我会陆陆续续发一系列有关Nginx的学习总结.本文是系列之一:Nginx简介.) 一.Nginx概况 1.Nginx是Igor Sysoev为俄罗斯访问量第二的Rambler.ru站点开发的,第一个公开版本0.1.0发布于2004年10月4日.目前最新的版本是nginx-1.9.0(2015年4月28日发布). 2.Nginx是一款高性能的HTTP和

Nginx简介与源码编译安装

1.Nginx简介 Nginx官方站点:http://nginx.orgNginx官方文档:http://nginx.org/en/docs Nginx是一款免费,开源,轻量级高性能的网站服务器(http server)和反向代理(reverse proxy)服务器程序,能够反向代理http协议和mail协议. Nginx原作者于2002年开发nginx,正式第一版于2004年发布,至今nginx已经在web server占据了很大的市场份额如图(可以在http://news.netcraft.

Nginx简介及配置实用

Nginx简介 Nginx是一个高性能的HTTP和反向代理服务器: 支持的操作系统众多,windows.linux. MacOS X: 可实现负载均衡: Rewrite功能强大: 电商架构大部分都采用Nginx+应用服务器(如:Tomcat等web服务器)的架构. 目录说明 conf – 配置文件 contrib – 存放一些实用的工具 docs – 文档 html – 静态页面 logs – 日志 tmp – 临时目录 nginx.exe  主服务 使用(windows) 注:(nginx.e

nginx简介及nginx安装

1.nginx简介 常见WebServer(排行https://news.netcraft.com/archives/2018/, https://w3techs.com/technologies/overview/web_server/all )老牌:Httpd(早期叫Apache) ,开源,市场份额最高微软:IIS轻量:Lighttpd,性能高,低耗能,功能欠缺Nginx诞生2004年10月发布,俄国人Igor Sysoev开发,rambler.ruNginx官网.版本nginx.org 1

Nginx简介及用户认证、访问控制和反向代理配置

Nginx 是一个很强大的高性能Web和反向代理服务器及及电子邮件(IMAP/POP3)代理服务器,由俄罗斯程序员设计师Igor Syaoev所开发,官方网站:http://nginx.org/  特点是占有内存少.并发能力强. Nginx配置文件及目录简介: - /usr/local/nginx/                                                           安装目录 - /usr/local/nginx/conf/nginx.conf  

Ubuntu/Debian nginx 简介

Linux运营维护(简称运维) 这里是简单的使用介绍: 参考:http://einverne.github.io/post/2017/06/ubuntu-debian-install-nginx.html  (安装和简介) Nginx 是非常流行的 HTTP/HTTPS 服务器软件,它也可以作为反向代理服务器,邮件代理服务器,可以用于负载均衡,缓存等等. 基本的Nginx 由 master 进程和 worker 进程组成, master 读取配置文件,并维护 worker 进程,而 worker

nginx简介及优点总结

简介:nginx是web服务器,由C语言开发,基于事件驱动能处理百万级别的tcp连接,高度模块化的设计和自由的许可证使得扩展其功能的模块层出不穷, 跨平台,可使用当前操作系统特有的一些高效API来提高自己的性能,nginx以性能为王. 选择nginx的核心理由是处理高并发请求的同时保持高效的服务. 优点 1. 更快 单次请求更快,高峰期也更快 2. 高扩展性 极具扩展性,它由多个不同功能.不同层次.不同类型且耦合度极高的模块组成,这种低耦合的设计,造就了它庞大的第三方模块 3. 高可靠性 每个w

nginx简介及安装

如果你听说过apache软件,那么就会很快熟悉nginx软件,与apache软件类似,nginx(engine x)是一个开源的,支持高性能,高并发的www的服务和代理服务软件 nginx因具有高并发(特别是静态资源).占用系统资源少等,且功能丰富 在功能应用方面,nginx不但是一个优秀的web服务软件,还具有反向代理负载均衡和缓存服务功能,在反向代理.负载均衡方面,它类似于大名鼎鼎的LVS负载均衡及HAPROXY等专业代理软件,但是NGINX部署起来更方便,在缓存服务功能方面,它又类似于Sq