官网:
This package contains yum configuration file and a public PGP key necessary to authenticate signed RPMs. Download and install it, then run the following:
yum install nginx
Alternatively, a repository configuration can be added manually without installing the nginx-release package. Create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5”, “6”, or “7”, for 5.x, 6.x, or 7.x versions, respectively.
服务器 执行 安装:
yum install nginx-release-centos-6-0.el6.ngx.noarch.rpm
在进行:
yum install nginx
服务器 被安装在
service nginx 命令:
Usage: nginx {start|stop|restart|condrestart|try-restart|force-reload|upgrade|reload|status|help|configtest}
配置 文件:
/etc/nginx/nginx.conf