Home > Operation and Maintenance > Nginx > Is nginx starting?

Is nginx starting?

(*-*)浩
Release: 2019-11-20 11:19:16
Original
4324 people have browsed it

Each application running in Linux will generate a process, so we can determine whether the Nginx process has started by checking whether it exists.

Is nginx starting?

1. Sometimes if you want to know whether nigix is ​​running normally, you need to use linux commands to check the running status of nginx. Execute command: ps -A | grep nginx.

If the result is returned, it means nginx is running and the service has been started. (Recommended learning: nginx tutorial )

If you are not afraid of Nginx closed. You can also execute: service nginx restart.

Restart the nginx service. During the restart, you can also see if there are any specific errors.

2. Check the port netstat -ntlp;

Check the process ps -ef|grep nginx;

Check whether the log is updated tail -f access. log.

3. Check the process id directly: ps -C nginx -o pid.

This method of directly returning the pid is more suitable for use in combination with other programs. For example, execute this command in a shell/python script to get the pid, and then use the pid to determine whether Nginx is started. This method is recommended.

Is nginx starting?

The above is the detailed content of Is nginx starting?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template