Install nginx manually using instsrv and srvany in windows

Source: Internet
Author: User

Windows has two small tools, instsrv.exeand srvany.exe, to package any applications into windows services. Instsrv (install service) is used to install services. srvany (service anything) encapsulates the shells of any services.
 
Download instsrv.exeand srvany.exe first, and you can go to the Baidu download address step. The steps are as follows:


1. First, use instsrvto install srvanyinto a service. The instsrvcommand format (instsrv.exe /?) :

The code is as follows: Copy code

Installand removes system services from NT
 
INSTSRV <service name> (<exe location> | REMOVE)
[-A <Account Name>] [-p <Account Password>]
 
Install service example:
 
INSTSRV MyService C: MyDirDiskService. Exe
-OR-
INSTSRV MyService C: mailsrvmailsrv.exe-a MYDOMAINjoebob-p foo
 
Remove service example:
 
INSTSRV MyService REMOVE



Location is the complete path.

Therefore, my installation commands

The code is as follows: Copy code
Instsrv.exe nginx e: tempclean_daynginx-1.4.7srvany.exe



2. The first step is to install the service shell. Here we need to configure this shell to execute the real application. Modify the registry

Run regedit.exe and open registry editor ";
Expand the following sub-keys in sequence: [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices]. Find and right-click nginx under the sub-key (corresponding to the service name created in step 1) and select "item" under "new ", name it Parameters.
Click Select Parameters, create a new string value named Application in the right window, set its numeric data to the absolute path of the Application corresponding to the nginx service, for example: E: tempclean_daynginx-1.4.7nginx.exe;
Then create two new string values: AppDirectory and AppParameters, AppDirectory specifies the directory where the program is located, such as: E: tempclean_daynginx-1.4.7;
AppParameters indicates the program running parameter. If not, you do not need to set a value;

3. Start the service

You can use the net command to start/stop or SC command to configure the service.

4. Delete a service

You can use the remove option of instsrv to delete the service, or use the SC command.

For convenience, you can also create bat files, including installation, uninstallation, start, stop, and even registry operations. If you are interested, try it yourself.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.