通过yum安装nginx

  1. 安装nginx源

  2. rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

  3. 安装nginx

    Yum install nginx

    Service nginx start   启动nginx

3.然后进入浏览器,输入http://ip/测试,如果看到

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at 
nginx.com.

Thank you for using nginx.

 恭喜你,你成功了!

注:

如果不能连接到nginx,原因很多,但是可以先检查

1,nginx服务是否真的起来了;

2,linux服务器防火墙是否打开


你可能感兴趣的:(nginx,centos,yum)