Home > Articles > Details

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]

error:
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:

Please Login to see the rest of the answer
Answer:
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

 


If you log in, you will be notified when someone leaves a comment.

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


© 2022 - ErnesTech - Privacy