在CentOS 7中安装nginx服务器

简要地介绍一下,如何在CentOS 7中安装nginx服务器

  1.  下载对应当前系统版本的nginx包(package)

    # wget  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

  2.  建立nginx的yum仓库

    # rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm

  3.  下载并安装nginx

    # yum install nginx

  4.  启动nginx服务

    systemctl start nginx

  5.  配置

    默认的配置文件在 /etc/nginx 路径下,使用该配置已经可以正确地运行nginx;如需要自定义,修改其下的 nginx.conf 等文件即可。

  6. 测试

    在浏览器地址栏中输入部署nginx环境的机器的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.

原文地址:https://www.cnblogs.com/lixiaoran/p/5574339.html