黑帽联盟
标题: centos服务器下yum安装nginx [打印本页]
作者: 定位 时间: 2017-1-2 22:35
标题: centos服务器下yum安装nginx
Ubuntu下安装nginx,直接apt-get install nginx就行了,很方便。
但是今天装了CentOS6.5,直接yum install nginx不行,要先处理下源,下面是安装完整流程,也十分简单:
1、CentOS 6,先执行:
2,查看yum的nginx信息
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: mirrors.cn99.com
Installed Packages
Name : nginx
Arch : x86_64
Version : 1.10.2
Release : 1.el6.ngx
Size : 2.1 M
Repo : installed
From repo : nginx
Summary : High performance web server
URL : http://nginx.org/
License : 2-clause BSD-like license
Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
: a mail proxy server.
3,安装并启动nignx
[root@server ~]# yum install nginx
[root@server ~]# service nginx start
Starting nginx: [ OK ]
4,然后进入浏览器,输入http://192.168.129.128/测试,如果看到
恭喜你,你成功了!
如果不能连接到nginx,原因很多,但是可以先检查 1,nginx服务是否真的起来了;2,linux服务器防火墙是否打开;3,selinux有没有关闭
欢迎光临 黑帽联盟 (https://bbs.cnblackhat.com/) |
Powered by Discuz! X2.5 |