最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Linux中在线安装nginx环境方法(Centos/Ubuntu/Debian)
时间:2022-11-14 22:08:17 编辑:袖梨 来源:一聚教程网
首先创建个文件
vi /etc/yum.repos.d/nginx.repo
复制下面文本,保存并退出
[nginx]
name=nginx repo
baseurl=http://ngin*x.*o*rg/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
运行以下命令进行安装
#yum install pcre 安装依赖包
#yum install nginx
后面整理了一些如/Ubuntu/Debian系统的安装包了
Red Hat/CentOS packages
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://ngin*x.*o*rg/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
RHEL:
[nginx]
name=nginx repo
baseurl=http://ng**inx.or*g/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://ng*i*nx.*org/packages/ubuntu/ lucid nginx
deb-src http://ng*i*nx.*org/packages/ubuntu/ lucid nginx
Debian 6:
deb http://ngi*nx.or**g/packages/debian/ squeeze nginx
deb-src http://ngi*nx.or**g/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 nginxIf 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.l*au*nc*hpad.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
官网参考http://wiki.n*g**inx.org/Install
相关文章
- 长佩文学城网页版直达-长佩文学城快捷登录入口 01-16
- 夸克老司机模式如何开启-夸克老司机模式登录入口显示内容 01-16
- Mail.ru官网登录-mailru邮箱登录链接直达 01-16
- 秋蝉漫画免费阅读入口-秋蝉韩漫sss级土豪版在线观看 01-16
- 微博网页版入口-微博电脑版官方登录地址 01-16
- 樱花动漫下载安装最新版本-樱花动漫官方正版获取入口与新手使用指南 01-16