Home > AI > OperatingSystem > CentOS >

Install Nginx on CentOS

Step 1: install Nginx repository

$sudo yum install epel-release

Step 2: install Nginx

$sudo yum install nginx

Step 3: start Nginx

$sudo systemctl start nginx
$systemctl status nginx
$systemctl enable nginx // bind nginx with server
$nginx -t // test nginx configuration
$systemctl restart nginx
$netstat -tln (tcp listen with numbers)

It is not running, change the default port from 80 to 8080 in /etc/nginx/nginx.conf

Leave a Reply