Redis background configuration
1. Enter the DOS window
2. Enter the redis installation directory
3. Input: redis-server --service-install redis.windows.conf --loglevel verbose (install redis service)
4. Enter: redis-server --service-start (start service)
5. Enter: redis-server --service-stop (stop service)
Background configuration of nginx
1 Download the winsw tool
Windows Service Wrapper gadget: https://github.com/winsw/winsw/releases
2 Tool installation and use
Step 1: After downloading, put the tool into the Nginx installation directory, and rename it to nginx-service.exe;
Step 2: Create a new service log folder server-logs folder in the nginx installation directory , used to store nginx service related logs.
Step 3: Create a new nginx-service.xml file in this directory, and write configuration information. After configuration, you can register Nginx as a Windows service through this.
The content of the file configuration is as follows: there are three key points, the location of the log file, the startup command, and the shutdown command; just follow the cat and draw the tiger:
<!-- nginx-service.xml -->
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<logpath>D:\work\nginx\nginx -1.18.0\server-logs\</logpath>
<logmode>roll</logmode>
<depend></depend>
<executable>D:\work\nginx\nginx-1.18.0\nginx.exe</executable >
<stopexecutable>D:\work\nginx\nginx-1.18.0\nginx.exe -s stop</stopexecutable>
</service>
3 Register into the Windows service
After the above content is configured, manage it under the nginx installation directory The staff runs the command: .\nginx-service.exe install to successfully register it as a Windows service. At this time, we can view the nginx service in the service of Windows Task Manager. You can right-click the service to run, stop, and restart it, and you can also directly operate it in the task manager. Right-click the service to confirm whether the startup type is automatic. Generally, it is automatic. If it is automatic, it will start automatically.