How to deploy Nginx in CentOS

  1. SSH to VPS

    ssh root@ip
  2. Update yum to install Nginx

    yum -y update
  3. Install Nginx

    yum install nginx
  4. Start Nginx and start Nginx when server launch

    systemctl start nginx
    systemctl enable nginx
  5. Check Nginx status

    systemctl status nginx
  6. Set firewall for visiting

    sudo firewall-cmd --permanent --zone=public --add-service=http 
    sudo firewall-cmd --permanent --zone=public --add-service=https
    sudo firewall-cmd --reload
  7. Or we can stop firewall

    systemctl step firewalld
  • Where is configuration file?

    cd /etc/nginx/
  • Where is default page?

    cd /usr/share/nginx/html

Leave a Reply