CentOS7 install Nginx

Reference:

    http://nginx.org/en/linux_packages.html

    https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7

The main steps:

    1、create file /etc/yum.repos.d/nginx.repo with following contents:

    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/centos/7/$basearch/
    gpgcheck=0
    enabled=1

    2、yum install epel-release -y
    3、yum install nginx -y
    4、systemctl start nginx
    # config files: /etc/nginx/conf.d/default.conf

    5、firewall-cmd --zone=public --add-port=80/tcp --permanent success
    6、firewall-cmd --reload

   

猜你喜欢

转载自blog.csdn.net/u013845177/article/details/86502932