Official Red Hat/CentOS packages
To add nginx yum repository, create a file named /etc/yum.repos.d/nginx.repo and paste one of the configurations below:
CentOS:
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
RHEL:
[nginx] name=nginx repo baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/ gpgcheck=0 enabled=1
Due to differences between how CentOS, RHEL, and Scientific Linux populate the $releasever variable, it is necessary to manually replace $releasever with either "5" (for 5.x) or "6" (for 6.x), depending upon your OS version.
Official Debian/Ubuntu packages
Append the appropriate stanza to /etc/apt/sources.list. The Pgp page explains the signing of the nginx.org released packaging.
Ubuntu 10.04:
deb http://nginx.org/packages/ubuntu/ lucid nginx deb-src http://nginx.org/packages/ubuntu/ lucid nginx
Debian 6:
deb http://nginx.org/packages/debian/ squeeze nginx deb-src http://nginx.org/packages/debian/ squeeze nginx
Ubuntu PPA
This PPA is maintained by volunteers and is not distributed by nginx.org. It has some additional compiled-in modules and may be more fitting for your environment.
You can get the latest stable version of Nginx from the Nginx PPA on Launchpad: You will need to have root privileges to perform the following commands.
For Ubuntu 10.04 and newer:
sudo -s nginx=stable # use nginx=development for latest development version add-apt-repository ppa:nginx/$nginx apt-get update apt-get install nginx
If you get an error about add-apt-repository not existing, you will want to install python-software-properties. For other Debian/Ubuntu based distributions, you can try the lucid variant of the PPA which is the most likely to work on older package sets.
sudo -s nginx=stable # use nginx=development for latest development version echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu lucid main" > /etc/apt/sources.list.d/nginx-$nginx-lucid.list apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C apt-get update apt-get install nginx
Official Win32 Binaries
As of 0.8.50, Nginx is now available as an official Windows binary.
The Windows version is provided as a binary-only due to the current build process (which currently uses some Wine tools). When the build process has been cleaned up, source will be made available. Igor does not want to support build issues with the current system.
Installation:
cd c:\ unzip nginx-1.2.3.zip ren nginx-1.2.3 nginx cd nginx start nginx
Control:
nginx -s [ stop | quit | reopen | reload ]
For problems look in c:\nginx\logs\error.log or in EventLog.
In addition, Kevin Worthington maintains earlier Windows builds of the development branch.
Building Nginx From Source
After extracting the source, run these commands from a terminal:
./configure make sudo make install
By default, Nginx will be installed in /usr/local/nginx. You may change this and other options with the compile-time options.
You might also want to peruse the catalog of third-party modules, since these must be built at compile-time.
Command:nginx –h help
安装nginx之前需要zlib和pcre先用rpm查看是否安装。
备注centos系统下:
yum search 软件名
yum install 软件名
rpm –q 软件名
<!--StartFragment -->
相关推荐
Nginx 安装成Windows 服务方法
Nginx所需环境的安装,及nginx安装,nginx相关功能开启,后端节点健康检查插件安装,静态资源缓存插件,缩略图插件安装等。
自己整理的nginx安装部署相关的一些经验,供参考
nginx安装全流程,包括安装流程,配置流程,还有开机自启动
nginx安装,有什么不好的多提宝贵意见
Nginx安装的时候不指定安装目录,会默认安装到/usr/local/nginx下,因此如果需要改变安装目录的同学,可以按照以下方法安装。
nginx安装、配置、负载均衡
nginx安装环境及nginx_1.18.0安装包,gcc、g++、pcre、zlib、nginx包
nginx 安装及配置文档包含 下载安装及相关配置步(反向代理,负载均衡)骤说明。
nginx安装与使用 http://blog.163.com/njut_wangjian/blog/static/1657964252013327103716818/ Nginx开发从入门到精通 http://tengine.taobao.org/book/index.html nginx官网上下载相应的安装包,--- 直接解压就...
nginx安装使用教程nginx安装使用教程
nginx安装.
一、nginx 安装与运行 (Mac OS环境) 1. 安装 nginx 可通过 Homebrew 可直接安装: $brew install nginx 安装好后,默认首页的文件在 /usr/local/var/www 文件夹下 默认的配置文件地址在 /usr/local/etc/nginx/nginx...
(1) Nginx安装配置 - 1 - 1) Nginx安装 - 1 - 2) Nginx配置 - 1 - a)对c:\nginx\conf\nginx.conf文件进行配置: - 1 - b)常用的 Nginx 参数 - 3 - c)静态文件处理 - 4 - d)动态页面请求处理 - 4 - e)下面为nginx....
php+mysql+nginx安装与常遇到的错误 centos系统为例子 在高并发连接的情况下,Nginx是Apache服务器不错的替代品。Nginx同时也可以作为7层负载均衡服务器来使用。根据我的测试结果,Nginx 0.8.15 + PHP 5.2.10 ...
一、安装nginx 二、关闭和重启nginx 三、卸载nginx 四、nginx加入到系统服务并自启动 该方案测试成功过!
nginx安装插件包和部署包含了文档和脚本以及其中nginx的安装包是直接在linux在线下载。不是非常详细啊!