Operations 3 min read

Linux Service and Process Management with Nginx

This guide explains how to install Nginx on a Linux server, manage it with systemctl commands, verify its operation using netstat, and control related processes via ps and kill utilities, providing practical command examples for each step.

DevOps Cloud Academy
DevOps Cloud Academy
DevOps Cloud Academy
Linux Service and Process Management with Nginx

Linux service and process management tutorial covering installation, control, verification, and monitoring of the Nginx web server on a Linux system.

Linux Service Process Management

Service management

Process management

Preparation – Install Nginx Service

Install an Nginx web server (default port 80) for testing purposes.

yum -y install nginx

Service Management – systemctl

Use systemctl (or legacy service ) to control the Nginx service:

Start: systemctl start nginx

Stop: systemctl stop nginx

Restart: systemctl restart nginx

Reload: systemctl reload nginx

Status: systemctl status nginx

Enable at boot: systemctl enable nginx

Disable at boot: systemctl disable nginx

Service Verification

Check listening ports with netstat (TCP: -anlpt , UDP: -anlpu ).

[root@myserver ~]# netstat -anlpt | grep 80
tcp      0      0 0.0.0.0:80          0.0.0.0:*          LISTEN      6416/nginx: master
tcp6     0      0 :::80               :::*               LISTEN      6416/nginx: master

Process Management

View Nginx processes with ps :

[root@myserver ~]# ps aux | grep nginx
root       6416  0.0  0.5 118672  9920 ?   Ss   09:10   0:00 nginx: master process /usr/sbin/nginx
nginx      6447  0.0  0.4 150020  9000 ?   S    09:10   0:00 nginx: worker process
root       6635  0.0  0.0  12108  1088 pts/0 S+ 09:15   0:00 grep --color=auto nginx

Terminate processes using kill (graceful -15 , force -9 ) or killall to stop all Nginx processes:

kill PID
kill -9 123
kill -15 123
killall nginx   ## stop all nginx processes

Monitor system processes with top .

More content and community: Follow DevOps Cloud Classroom for additional resources.

operationsprocess managementLinuxnginxServicesystemctl
DevOps Cloud Academy
Written by

DevOps Cloud Academy

Exploring industry DevOps practices and technical expertise.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.