Nginx: Kill all Nginx process on Linux and Run a command without navigating to the directory in Linux Ubuntu

Nginx Tips and Tricks

Tip 1. Kill all process for nginx [If there are processes hang for nginx could cause all sorts

of problems includes]

Starting LSB: Stop/start nginx...
nginx.service: Control process exited, code=exited status=1
nginx.service: Failed with result 'exit-code'.
Failed to start LSB: Stop/start nginx.

solution: sudo killall nginx

Tip 2. If you ever wanted to run command without changing directory type command as  below:
Solution: nginx -t -c /etc/nginx/nginx.conf

Tip 3. If you want to see the status of nginx along with logs command below:
solution: systemctl status nginx.service && journalctl -xe

Tip 4. If you want to read file located in another directory in Linux
solution: ls folderName/ #will show you the files inside the folder name specified.
solution: cat nginx/fileName #will show (readonly mode) the file content


Edit this Article
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy