Junior — Middle
How can the presence of nginx on a server be determined?
sobes.tech AI
Answer from AI
To determine if nginx is installed on the server, you can use several methods:
- Check for the process:
ps aux | grep nginx
If nginx is running, you will see processes named nginx.
- Check the installed package:
For Debian/Ubuntu:
dpkg -l | grep nginx
For CentOS/RHEL:
rpm -qa | grep nginx
- Check command availability:
which nginx
If the command returns a path, nginx is installed.
- Check open ports:
sudo netstat -tulpn | grep nginx
- Try to get the version:
nginx -v
If the command executes and shows a version, nginx is installed.
These methods will help quickly determine the presence of nginx on the server.