安装nginx源
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
最好先 su 一下(权限不足),
查看yum的nginx信息
yum info nginx
使用yum安装nginx
yum -y install nginx
启动nignx
service nginx start
查看nginx启动进程和配置文件 (可以查看一下)
ps -ef|grep nginx
测试 默认端口为80,所以只需要输入ip地址即可,如下就可以了。(记得关闭防火墙)

查看防火墙状态
service iptables status

这个样子就是打开状态
关闭防火墙
service iptables stop

开启防火墙

网友评论