centos7安裝nginx
第一種方式:通過yum安裝
直接通過 yum install nginx 肯定是不行的,因為yum沒有nginx,所以首先把 nginx 的源加入 yum 中。
運行下面的命令:
1.將nginx放到yum repro庫中
復制代碼 代碼如下:
[root@localhost ~]# rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2.查看nginx信息
[root@localhost ~]# yum info nginx
3.使用yum安裝ngnix
[root@localhost ~]# yum install nginx
效果如下:
[root@localhost ~]# yum install nginx
已加載插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.usc.edu
* extras: mirror.raystedman.net
* updates: mirror.metrocast.net
正在解決依賴關系
--> 正在檢查事務
---> 軟件包 nginx.x86_64.1.1.10.1-1.el7.ngx 將被 安裝
??????
??????
正在安裝 : 1:nginx-1.10.1-1.el7.ngx.x86_64
Thanks for using nginx!
Please find the official documentation for nginx here:
* http://nginx.org/en/docs/
Commercial subscriptions for nginx are available on:
* http://nginx.com/products/
----------------------------------------------------------------------
驗證中 : 1:nginx-1.10.1-1.el7.ngx.x86_64 1/1
已安裝:
nginx.x86_64 1:1.10.1-1.el7.ngx
完畢!
4.啟動nginx
[root@localhost ~]# service nginx start
5.查看nginx版本
[root@localhost ~]# nginx -v
新聞熱點
疑難解答