Home >Operation and Maintenance >Nginx >How to check whether nginx is started on windows
View process method (Recommended learning: nginx tutorial)
If the nginx service is started, Its process can be seen in the task manager, otherwise it means that it did not start normally.
View method: Right-click on the blank space of the taskbar and select "Task Manager" from the pop-up menu
Command Status Method
Run nginx -s stop (stop) nginx -s reopen (restart) If no error message is reported, it means that nginx was originally started.
Method: Press win R at the same time, enter: cmd, and press Enter to open the command line window. Then use the Cd command to switch to the nginx installation directory and run the above command.
Note: After running nginx -s stop, you need to run: start nginx again to start the service.
View file method
As can be seen from the above, nginx will generate the nginx.pid file in the logs directory after starting, and it will be automatically deleted after stopping. So you can also determine whether the nginx service is started by checking whether this file is generated in the directory.
Method: Go to the logs directory to check whether the nginx.pid file exists.
Check the port method
You can also use the netstat command to check whether the listening port of nginx is listening. If it is listening, it means that the nginx service starts normally (of course the premise is: No other program is also using this port), otherwise it will not start.
Method: Run the command: netstat -an|findstr 8080 to see if the record is found
Web page access method
Because nginx is a web server, If it starts normally, you can access its web page. For example: We enter: 127.0.0.1 (or add the set port) in the browser. After pressing Enter, you should see a welcome page (without changing the default web page). If you can see it, it means nginx starts normally.
The above is the detailed content of How to check whether nginx is started on windows. For more information, please follow other related articles on the PHP Chinese website!