nginx common commands put into shell script details
1. Create a folder to store shell scripts for nginx
/usr/local/task/nginx
- Restart the shell script for nginx
vim reload.sh
#!/bin/bash
nginx -s reload
- The shell script that sets the nginx user’s permission to read and write all files in the html directory
vim setfacl.sh
#!/bin/bash
setfacl -m u:nginx:rwx -R /usr/local/nginx/html/
setfacl -m d:u:nginx:rwx -R /usr/local/nginx/html/
- The shell script to start the nginx process
vim start.sh
#!/bin/bash
nginx
- Stop the shell script of the nginx process
vim stop.sh
#!/bin/bash
nginx -s stop
2. Use
- Add execution permission to shell file script of nginx
chmod -R 755 /usr/local/task/nginx
- Execute the start. sh script
/usr/local/task/nginx/start.sh